I haven’t debugged this, so bear in mind that dial plan variables confuse the heck out of me.
This version returns the call if the blind transfered to ext is busy or doesn’t answer. This assumes that a different ext is used to transfer straight to voicemail.
exten => 711,1,Set(btn=${BLINDTRANSFER})
exten => 711,2,Set(btn=${CUT(btn,,1)})
exten => 711,3,Dial(sip/gslounge,20,TtrWw)
exten => 711,4,Set(btreason="711 Not Answered")
exten => 711,5,GotoIf($[${LEN(${btn})} > 0]?110)
exten => 711,6,Voicemail(u711)
exten => 711,7,Wait(2)
exten => 711,8,Hangup
exten => 711,104,Set(btreason="711 Was Engaged")
exten => 711,105,GotoIf($[${LEN(${btn})} > 0]?110)
exten => 711,106,Voicemail(b711)
exten => 711,107,Wait(2)
exten => 711,108,Hangup
exten => 711,110,Set(CALLERID(name)="${btreason}")
exten => 711,111,Wait(2)
exten => 711,112,Dial(${btn},,TtrWw)
exten => 711,113,Hangup
exten => 711,213,Playback(ext-busy-pls-wait)
exten => 711,214,PlayTones(ring)
exten => 711,215,Wait(8)
exten => 711,216,StopPlayTones
exten => 711,217,Goto(112)
As I said, I have not tested or debugged this, so please excuse me if it needs work!
It also requires a sound file ‘ext-busy-pls-wait’ to play when the transfer back ext is busy. also, the Caller ID parts might not be wanted by all users, I just did that so that I can see why the phone is ringing.
I hope someone finds it useful.
Mike.