Tony Mountifield
2012-Nov-08 16:44 UTC
[asterisk-users] How to propagate NOANSWER up through a Local channel?
I am using a Local channel in order to provide a layer of processing when dialling out. I have put a timeout on the inner dial, which returns a DIALSTATUS of NOANSWER if the call times out while ringing. However, this then causes the Local channel to return CHANUNAVAIL instead of NOANSWER, because effectively the proxy channel has just gone away. Here is a simplified example: [test] exten => _X.,1,Dial(Local/${EXTEN}@outbound) exten => _X.,n,NoOp(${CONTEXT}:DIALSTATUS=${DIALSTATUS}) [outbound] exten => _X.,1,Dial(SIP/ext${EXTEN},30) exten => _X.,n,NoOp(${CONTEXT}:DIALSTATUS=${DIALSTATUS}) So if I don't answer within 30 sec, I see outbound:DIALSTATUS=NOANSWER but test:DIALSTATUS=CHANUNAVAIL If instead I put the timeout on the outer Dial instead, I see test:DIALSTATUS=NOANSWER and outbound:DIALSTATUS=CANCEL, because the Local channel hung up the inner Dial while it was still ringing. So I understand the reasons for the above behaviours, but my question is: How can I propagate the NOANSWER status upwards from the inner Dial, so that the Local channel also returns NOANSWER? Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
Chad Wallace
2012-Nov-08 17:29 UTC
[asterisk-users] How to propagate NOANSWER up through a Local channel?
On Thu, 8 Nov 2012 16:44:32 +0000 (UTC) tony at softins.co.uk (Tony Mountifield) wrote:> Here is a simplified example: > > [test] > exten => _X.,1,Dial(Local/${EXTEN}@outbound) > exten => _X.,n,NoOp(${CONTEXT}:DIALSTATUS=${DIALSTATUS}) > > [outbound] > exten => _X.,1,Dial(SIP/ext${EXTEN},30) > exten => _X.,n,NoOp(${CONTEXT}:DIALSTATUS=${DIALSTATUS}) > > So if I don't answer within 30 sec, I see outbound:DIALSTATUS=NOANSWER > but test:DIALSTATUS=CHANUNAVAIL > > If instead I put the timeout on the outer Dial instead, I see > test:DIALSTATUS=NOANSWER and outbound:DIALSTATUS=CANCEL, because the > Local channel hung up the inner Dial while it was still ringing. > > So I understand the reasons for the above behaviours, but my question > is: How can I propagate the NOANSWER status upwards from the inner > Dial, so that the Local channel also returns NOANSWER?Try Hangup(NO_ANSWER) if DIALSTATUS is NOANSWER after the Dial in the Local channel. -- C. Chad Wallace, B.Sc. The Lodging Company http://www.lodgingcompany.com/ OpenPGP Public Key ID: 0x262208A0