Monday, March 9, 2015

Asterisk Blind Transfer Callback


One of the problems amongst Asterisk, is that, when y'all blind transfer a telephone telephone to an internal extension, as well as the remote side never answers, the telephone telephone does non automatically become dorsum to the caller. The next slice of dial innovation logic should supervene upon your normal internal telephone telephone logic.

exten =>  _1XX,1,Dial(SIP/${EXTEN},15,tT)
same => n,GotoIf($[${LEN(${BLINDTRANSFER})}=0]?unsuccessful)
same => n,Set(CALLER=${CUT(BLINDTRANSFER,-,1)});
same => n,Goto(CallBack)
same => n(unsuccessful),GotoIf($[($[${LEN($TRANSFERERNAME})}=0]?Fail)
same => n,Set(CALLER=${CUT(TRANSFERERNAME,-,1)});
same => n(CallBack),Set(CALLERID(all)=${EXTEN} <${CALLERID(num)}>)
same => n,Dial(${CALLER},,tT)
same => n(Fail),Hangup()

It industrial plant equally follows:
1. Line i takes whatsoever extension betwixt 100 as well as 199 as well as rigs it for xv seconds. Both the originator as well as receiver of the telephone telephone volition move able to transfer beyond this point.
2. Asterisk writes the originating channel into the BLINDTRANSFER variable. If it is empty, the blindtransfer variable was non set. The dialplan jumps to the "unsuccessful" label.
3. Asterisk takes the originating extension from the BLINDTRANSFER variable as well as writes it into a novel variable called "CALLER"
4. Jumps to the "CallBack" Label.
5.Asterisk takes the originating extension from the TRANSFERERNAME variable as well as writes it into a novel variable called "CALLER".
6. Asterisk sets the CALLERID equally the Transfer Destination as well as the master CALLERID.
7. Asterisk calls dorsum the extension that initiated the transfer.
8. Asterisk hangs upwards the call.