INCOMING CALLER ID authentication with modified dial plan and php script


I am trying to verify caller id against the MySQL database when making a call to : _+44161XXXXXXX

I am using : FreePBX and Asterisk 11.8.1

I tried using SmartRoutes and Dynamic Routes without success - all calls are getting rejected with the default IVR so now I am trying the hard way.

  1. Verify Caller ID
    My plan is to use my php script to connect with mysql database on localhost check if I have stored the ${CALLERID(num)}) there, if not - do not connect the call - play busy tone ( i do not want the customer to be charged for the call that’s why I do not want to answer it in the system)

Fro what I googled I should edit extensions_custom.conf

exten => _+44161XXXXXXX,1,noop(Incoming call to from-trunk-noanswer context)
exten => system(/myscripts/myfile.php ${CALLERID(num)}))
exten => s,n,Busy(10)

It seems not to work for me and also I do not know yet what to put in my php file to return to asterisk if the CLI was found and I want to divert the call to IVR.

  1. Have a special dedicated number which I can ask customer to call to add his Caller Id to the database ( calling php script first - not answering but rejecting the call after 5 rings)

I am not so good with dialplans / Freepbx / Asterisk logic so any help will be appreciated.

###System is a 1 way road and NOT what you want

###AGI is what you are looking for

1 Like

Thanks a lot - I will test modify this agi scrip tomorrow