[asterisk-users] Passing dialstatus back through an IAX chain ..

Gordon Henderson gordon+asterisk at drogon.net
Wed May 16 07:17:59 MST 2007


I feel I'm doing something obviously wrong here and will kick myself when I see 
the answer!!!

The scenario:

SIP phone -> Asterisk1 -> IAX -> Asterisk2 -> IAX -> Asterisk3 -> PSTN

So I place a call from the SIP phone. A1 picks it up and forwards it to A2 
which forwards it to A3. A3 sends the call to the PSTN. I control A1 and A2, 
but not A3.

When a call fails (for either unavalable or busy), A2 sees the failure code 
back from A3. A2 doesn't do anything with it other than reach the end of the 
dialplan segment for that call. A1 carries on after it had waited for it's 
Dial() to A2 to complete, however A1 doesn't then see the status code - it 
always gets CONGESTION.

Output from the monitor on A2 looks like:

     -- Executing NoOp("IAX2/a1-3", "Call failled. Result code is: CHANUNAVAIL") 
in new stack
   == Auto fallthrough, channel 'IAX2/a1-3' status is 'CHANUNAVAIL'

This is good - I had dialled an invalid number.

And on A1 it gets:

     -- IAX2/a2-16384 is circuit-busy
     -- Hungup 'IAX2/a2-16384'
   == Everyone is busy/congested at this time (1:0/1/0)
     -- Executing NoOp("SIP/101-081563a0", "Dialling out via VoIP Trunk failed: 
CONGESTION") in new stack

Congestion and not Unavail... Where did I go wrong?



A1 has this in extensions.conf:

exten =>  _0.,n,Dial(IAX2/a2/${EXTEN},WTo)
exten =>  _0.,n,Noop(Dialling out via VoIP Trunk failed: ${DIALSTATUS})


and A2 has:


exten => _[0-9].,n,SetCallerID(0123456789)
exten => _[0-9].,n,Set(CDR(accountcode)=a1)
exten => _[0-9].,n,Dial(IAX2/trunk1/${EXTEN})
exten => _[0-9].,n,Noop(Call failled. Result code is: ${DIALSTATUS})

So how can I get the original status code that A2 sees be returned to A1 ? I 
feel I'm simply missing a simple flag, parameter, variable to set or 
something.... Any clues?

Thanks,

Gordon


More information about the asterisk-users mailing list