GotoIf DIALSTATUS – Not Working

Home » Asterisk Users » GotoIf DIALSTATUS – Not Working
Asterisk Users 2 Comments

What am I doing wrong?
Goif dialstatus: busy CONGESTION not working.

exten => _7NXXXXXX,1,Dial(SIP/7780${EXTEN:1}@pstn-5665,60,tr)
exten => _7NXXXXXX,n,GotoIf($[$[“${DIALSTATUS}” = “BUSY”] | $[“${DIALSTATUS}” = “CONGESTION”]]?line2)
exten => _7NXXXXXX,n(line2),Dial(SIP/9780${EXTEN:1}@pstn-1270,60,tr)
exten => _7NXXXXXX,n,Hangup()

When I try to call another number (7780476444) on a different line it supposed to jump to “(line2)” on busy (and dial Dial(SIP/9780${EXTEN:1}@pstn-1270) but instead the call hangs up.

— Called SIP/77804764444@pstn-5665
== Everyone is busy/congested at this time (1:0/0/1)
— Executing [74764444@internal:5] Hangup(“SIP/11-0000015b”, “”) in new stack

2 thoughts on - GotoIf DIALSTATUS – Not Working

  • I’d suggest a line to print the DIALSTATUS as below. I get CHANUNAVAIL, thus hangs up.

    exten => _7NXXXXXX,1,Dial(SIP/7780${EXTEN:1}@pstn-5665,60,tr)
    exten => _7NXXXXXX,n,NoOp(DialStatus=”${DIALSTATUS}”)
    exten => _7NXXXXXX,n,GotoIf($[$[“${DIALSTATUS}” = “BUSY”] |
    $[“${DIALSTATUS}” = “CONGESTION”]]?line2)
    exten => _7NXXXXXX,n,Hangup()
    exten => _7NXXXXXX,n(line2),Dial(SIP/9780${EXTEN:1}@pstn-1270,60,tr)
    exten => _7NXXXXXX,n,NoOp(DialStatus=”${DIALSTATUS}”)
    exten => _7NXXXXXX,n,Hangup()

    Alec