Asterisk Application ‘System()’ in h extension to
create callfile which will handle your callback.
You can also try for ‘Originate()’ application.
Example:
[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/)
OR
exten => 1,1,Wait(2)
exten => 1,n,Set(CID=${CALLERID(num)})
exten => 1,n,NoOp(Call from ${CID})
exten => 1,n,Hangup
exten => h,n,Originate(SIP/1001,app,Dial,SIP/1002)
0 comments:
Post a Comment