Another customer of ours requested this feature. By default, with blind transfers if the internal destination doesn’t answer the call, it goes to vociemail or terminates if vociemail is not configured. This customer wanted to return the call to the originator so that they can direct the call elsewhere.
You need to modify two places. They’re listed below.
globals_custom.conf:
TRANSFER_CONTEXT = custom-test_transfer
extensions_custom.conf:
[custom-test_transfer]
exten => _X.,1,NOOP(entering custom-test_transfer)
exten => _X.,n,set(timeoutd=25) ; set timeout in seconds
exten => _X.,n,set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,noop(the extenlength is ${extLeng})
exten => _x.,n,dial(local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Gotoif($[“$\{DIALSTATUS}”=”ANSWER”]?hangup,callback)
exten => _X.,n,Set(CALLERID(name)=RB:${CALLERID(name)})
exten => _X.,n(callback),dial(local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n(hangup),hangup()
exten => _*X.,1,dial(local/${EXTEN}@from-internal,15)
exten => _*X.,n,hangup()
Thanks to Alexander for fixing my earlier code. I am yet to test this on a live site 🙂
extensions_custom.conf:
[custom-test_transfer]
exten => _X.,1,NoOp(Entering custom-test_transfer)
exten => _X.,n,Set(timeoutd=25) ; set timeout in seconds
exten => _X.,n,Set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,NoOp(The extenlength is ${extLeng})
exten => _X.,n,Dial(Local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Set(CALLERID(name)=RB:${CALLERID(name)})
exten => _X.,n,Dial(Local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n,Hangup()
Once setup, reload asterisk and test this out.
There are several other scripts out there, but this is the one that worked correctly for me.