Thursday, February 23, 2012

Asterisk Callback to the ANI and Dial another Call and Bridge them

Auto Callback to the ANI when ANI answers by the user, we Dial another Call and Bridge them

[Main]
exten => 111,1,Goto(cb,1,1)
exten => 222,1,Dial(SIP/666666)

[cb]
exten => 1,1,NoOp(Incoming call from # ${CALLERID(num)})
exten => 1,n,Goto(callback,333,1)

[callback]
;prepare for callback
exten => 333,1,NoOp(Hangup then callback to cellphone)
exten => 333,2,Hangup

exten => h,1,NoOp(copy callback.call file to /var/spool/asterisk/outgoing)
exten => h,n,System(echo -e "Channel: SIP/${CALLERID(num)}\\nContext: Main\\nExtension: 222" > /tmp/${UNIQUEID}.call)
exten => h,n,System(/bin/sleep 10s)
exten => h,n,System(mv /tmp/${UNIQUEID}.call /var/spool/asterisk/outgoing/)

0 comments:

Post a Comment