How to handle the status line Asterisk?

Good day! The Asterisk are a beginner please do not swear. In Google already.

The bottom line is this. There are 2 ATS
1 Aster on it turns the majority of users.
2 BIT.PBX routed external calls.

The BIT.The PBX if the destination phone is busy disabled etc Aster said matching phrase is not, apparently I broke the dialplan for this case. Please help

[call-out]
;Applications

;Call to internal number
;Enable recording

exten => _5XXX,1,Dial(SIP/${EXTEN}@bit)
exten => _XXX,1,Macro(recording${CALLERID(num)},${EXTEN})
;GROUP

exten => 456,1,Dial(SIP/319&SIP/320&SIP/321,,m(default))
exten => 457,1,Dial(SIP/137&SIP/138&SIP/139,,m(default))
exten => 603,1,Dial(SIP/603@bit)
exten => 458,1,Dial(SIP/${EXTEN}@bit)

exten => _XXX,n,Dial(SIP/${EXTEN},15)
exten => _XXXX,n,Dial(SIP/${EXTEN},15)
exten => _XXX,n,Set(dstNUM=${EXTEN})
;Check the status of PIR exists or not
exten => _XXX,n,GotoIf($["${SIPPEER(${EXTEN},status)}" = ""]?num-not-exist,1)
;Check the status of the feast, connected or not
exten => _XXX,n,GotoIf($["${SIPPEER(${EXTEN},status):0:2}" = "UN"]?num-not-connected,1)
;Check channel employment
exten => _XXX,n,ChanIsAvail(SIP/${EXTEN},s)
;Output to log the value of the function ChanIsAvail, you only need to debug, you can delete the line
exten => _XXX,n,Verbose(=========== ChanIsAvail STATUS: ${AVAILSTATUS} ===========)
;If the function returns 2 or 3, then the subscriber is busy
exten => _XXX,n,GoToIf($[${AVAILSTATUS} = 2]?num-BUSY,1)
exten => _XXX,n,GoToIf($[${AVAILSTATUS} = 3]?num-BUSY,1)
exten => _XXX,n,GoToIf($[${AVAILSTATUS} = 6]?num-BUSY,1)
;Processed other status
exten => _XXX,n,Goto(num-${DIALSTATUS},1)

;If is say "wrong number, try again"
exten => num-not-exist,1,Wait(2)
exten => num-not-exist,n,Playback(invalid)
;If the number is not connected, say "the number you Dialed is disconnected please check the number and try again
exten => num-not-connected,1,Wait(2)
exten => num-not-connected,n,Playback(ss-noservice)
;If the number is busy, say "Busy"
exten => num-BUSY,1,Wait(2)
exten => num-BUSY,n,Playback(vm-isonphone)
;If for some reason the status is CHANUNAVAIL, saying that the number is not available at the moment
exten => num-CHANUNAVAIL,1,Wait(2)
exten => num-CHANUNAVAIL,n,Playback(vm-isunavail)
;If for some reason the status is CHANUNAVAIL, saying that the number is not available at the moment
exten => num-UNKNOWN,1,Wait(2)
exten => num-UNKNOWN n,Playback(vm-isunavail)
March 19th 20 at 08:57
0 answer

Find more questions by tags Asterisk