FreePBX transfer incoming call to destination based on database result

3.3k views Asked by At

How can I achieve the following with FreePBX 12 (and 6): I need our system to check on the fly the destination for that incoming phone call to be transferred too.

When a call comes in, the system needs to check a database table to see if there’s a record with that Caller ID, that record will also have the destination extension where that call needs to be routed too.

The database is a MySQL Table and it will consist of the following fields: id, callerid, destination_extension, created_at, updated_at

Call flow

1- answer incoming call

2- get call caller id: 876-718-7137

3- connect to mysql database

4- check if theres a record with that caller id and get the
destination extension where to route it (SELECT
destination_extension FROM callers_table WHERE caller_id =
876-718-7137) - (Returns: 1001)

5- transfer incoming from to extension 1001

Any suggestions on how to accomplish this? Thank you!

2

There are 2 answers

0
arheops On

There are no features like that in freepbx.

Only posibility - add all combination in inbound route in format DID/CID

You also can write custom dialplan using

http://www.voip-info.org/wiki/view/Asterisk+func+func_odbc

or

http://www.voip-info.org/wiki/view/Asterisk+RealTime

0
Deepspace On

I use the Dynamic Route module to accomplish this. See: http://www.voipsupport.it/pmwiki/pmwiki.php?n=Freepbx.DynamicRouting