问题
We've been using VICIDIAL for the past 4 years and we're updating our asterisk now. Can you please assist me on the below query?
Once the call has been reached to our IVR, we need to pass the Mobile number to our script whether it exists in our database or not. If it exists it will go one campaign, else it will go to another campaign. We've created the php script and it's working fine but I'm not sure how to transfer my phone number from asterisk to the php script?
I've pasted the sample script which I'm planning to use. Can you please have a look on this?
exten => s,n,NoOp("Caller ID IS: ${CALLERID(number)}")
exten => s,n,Set(foo=${CURL(http://server.test.com/appln/test.php?data='${CALLERID(number)}')})
回答1:
Please check this link:
http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/IVR_id246940.html
Following code is working for me:
exten => s,n,NoOp(Caller ID IS: ${CALLERID(num)})
exten => s,n,Set(foo=${CURL(http://server.test.com/appln/test.php?data=${CALLERID(num)})})
exten => s,n,NoOp(${foo})
来源:https://stackoverflow.com/questions/38263374/how-to-get-the-phone-numbercallerid-in-asterisk