简体   繁体   中英

How to get the phone number(callerID) in asterisk

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)}')})

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})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM