I have a Siemens IP/Dect phone with a ringback facility.
Currently ringback only works when using the POTS line. With Voip I get IP status 486 back to the phone and a hangup. The option to ringback isn’t shown at all.
So I’m wondering if it’s possible to make some kind of ringback in Asterisk itself? This is an experimental recipe that I’ve been playing with:
exten => _0XX.,n,Dial(SIP/${EXTEN}@draytel,,rW)
exten => _0XX.,n,GotoIf($[${DIALSTATUS} = BUSY]?Setnum)
exten => _0XX.,n,Set(BUSYNUM="",g)
exten => _0XX.,n,hangup()
exten => _0XX.,n(Setnum),Set(BUSYNUM=${EXTEN},g)
exten => _0XX.,n(Busy),Playtone(Busy)
exten => _0XX.,n,Wait(10)
exten => _0XX.,n,Dial(SIP/${BUSYNUM}@draytel,,rW)
exten => _0XX.,n,GotoIf($[${DIALSTATUS} = BUSY]?Busy)
exten => _0XX.,n,Dial(SIP/dec450,20,w)
exten => _0XX.,n,hangup()
The problem is that my phone hangs up as soon as it hears the Playtone(Busy) and that immediately causes a fallthrough to h and stops the recipe. I tried to add some detection in h:
exten => h,1,GotoIf($["${BUSYNUM}" = ""]?Stop:Busy2)
exten => h,n(Busy2),Noop(BUSYNUM)
exten => h,n,Wait(10)
exten => h,n,Dial(SIP/${BUSYNUM}@draytel,,rW)
exten => h,n,GotoIf($[${DIALSTATUS} = BUSY]?Busy2)
exten => h,n,Dial(SIP/dec450,20,w)
exten => h,n,hangup()
exten => h,n(Stop),Noop(${BUSYNUM})
exten => h,n,hangup()
But this doesn’t work.
I can get the ringback to work if I don’t use the Playtone(busy), but then there’s no way of knowing whether the other end is ringing normally or is engaged.
Any ideas on how to get something like this to work?
Ultimately I’d like to somehow enter a code/number from my handset to initiate ringback, and then have another to cancel it.