How to get the phone number(callerID) in asterisk

允我心安 提交于 2019-12-12 03:24:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!