[Asterisk-Users] How to cascade dial status back through IAX
Tony Mountifield
tony at softins.clara.co.uk
Thu Sep 8 09:34:22 MST 2005
On machine A I have something like the following in extensions.conf:
[iax-extensions]
exten => _9.,1,Dial(IAX2/machineB/${EXTEN:1}@mycontext)
exten => _9.,2,NoOp(DIALSTATUS=${DIALSTATUS})
exten => _9.,3,Hangup
On machineB I have something like this:
[mycontext]
exten => 2002,1,Dial(SIP/2002,60)
exten => 2002,2,NoOp(DIALSTATUS=${DIALSTATUS})
exten => 2002,3,Hangup
If I use a phone on machineA to dial 92002, then of course 2002 rings.
If 2002 is busy, then on machineB's console I see the NoOp command
with DIALSTATUS=BUSY, as expected.
However, on machineA's console I see DIALSTATUS=NOANSWER.
If I change machineB to this:
[mycontext]
exten => 2002,1,Dial(SIP/2002,60)
exten => 2002,2,NoOp(DIALSTATUS=${DIALSTATUS})
;exten => 2002,3,Hangup
exten => 2002,3,Goto(s-${DIALSTATUS},1)
exten => s-BUSY,1,Busy
exten => s-CONGESTION,1,Congestion
exten => s-NOANSWER,1,Hangup
exten => s-CHANUNAVAIL,1,Hangup
then I correctly get DIALSTATUS=BUSY on the originating machineA.
Is there a way to get Dial automatically to pass these failure statuses
back to the incoming channel automatically, rather than having to trap
each possible failure and return it manually? Something like an option
to Dial which means "never return, just pass status back to the originating
channel". I couldn't find such an option.
(If I just delete everything after the Dial line in mycontext, then it
still returns from Dial, and times out waiting for a new extension.)
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
More information about the asterisk-users
mailing list