Smartroutes or solution to dynamic inbound route based on mysql cdr query

hi all,

i have a relatively simple requirement but am struggling to find simple solution –

we have multiple people calling out a single trunk with a shared corporate caller-id.

when the called party rings us back, i want to route the call strait through to the extension that dialled their number.

i have downloaded and installed smartroutes, and i have a fast and effective mysql query to return the extension to recieve the incoming call:

“select src from asteriskcdrdb.cdr where dst like ‘%FROM_DID’ order by calldate desc limit 1;”

this query rapidly finds the last extension that dialled to this person, and the return value from the query is the extension for the incoming call to be routed to.

i cannot seem to express this in smartroutes – can anyone help?

is there a better way to do this?



so –

Not sure what version of FreePBX you are using, but it doesn’t look like Smartroutes has been updated to work with the latest GUI changes introduced in 2.10. Since it looks like your needs are pretty straight forward, I suggest you download and install the Dynamic Routes module from:
This module is quite a bit easier to configure, tho with fewer features, and it has been recently updated to work with the latest versions of FreePBX.

hi igatez,

thats’it – perfect :slight_smile:

huge thanks!