Here is the problem with using _. - it matches h !
[from-sip-external] ;give external sip users congestion and hangup ; Yes. This is _really_ meant to be _. - I know asterisk whines about it, but ; I do know what I'm doing. This is correct. exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN}) exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})}) exten => _.,n,Goto(s,1) exten => s,1,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?from-trunk,${DID},1) exten => s,n,Set(TIMEOUT(absolute)=15) exten => s,n,Answer exten => s,n,Wait(2) exten => s,n,Playback(ss-noservice) exten => s,n,Playtones(congestion) exten => s,n,Congestion(5) exten => h,1,NoOp(Hangup) exten => i,1,NoOp(Invalid) exten => t,1,NoOp(Timeout)
Here is how execution of a call looks like:
-- Executing [[email protected]:1] NoOp("SIP/10.168.0.228-0000011d", "Received incoming SIP connection from unknown peer to 99999") in new stack -- Executing [[email protected]:2] Set("SIP/10.168.0.228-0000011d", "DID=99999") in new stack -- Executing [[email protected]:3] Goto("SIP/10.168.0.228-0000011d", "s,1") in new stack -- Goto (from-sip-external,s,1) -- Executing [[email protected]:1] GotoIf("SIP/10.168.0.228-0000011d", "0?from-trunk,99999,1") in new stack -- Executing [[email protected]:2] Set("SIP/10.168.0.228-0000011d", "TIMEOUT(absolute)=15") in new stack -- Executing [[email protected]:3] Answer("SIP/10.168.0.228-0000011d", "") in new stack -- Executing [[email protected]:4] Wait("SIP/10.168.0.228-0000011d", "2") in new stack -- Executing [[email protected]:5] Playback("SIP/10.168.0.228-0000011d", "ss-noservice") in new stack -- Playing 'ss-noservice.alaw' (language 'en') -- Executing [[email protected]:6] PlayTones("SIP/10.168.0.228-0000011d", "congestion") in new stack -- Executing [[email protected]:7] Congestion("SIP/10.168.0.228-0000011d", "5") in new stack -- Executing [[email protected]:1] NoOp("SIP/10.168.0.228-0000011d", "Hangup") in new stack We should be done at this point, but there are more matches so the dialplan continues: -- Executing [[email protected]:2] Set("SIP/10.168.0.228-0000011d", "DID=s") in new stack -- Executing [[email protected]:3] Goto("SIP/10.168.0.228-0000011d", "s,1") in new stack -- Goto (from-sip-external,s,1) -- Executing [[email protected]:1] GotoIf("SIP/10.168.0.228-0000011d", "0?from-trunk,s,1") in new stack -- Executing [[email protected]:2] Set("SIP/10.168.0.228-0000011d", "TIMEOUT(absolute)=15") in new stack -- Executing [[email protected]:3] Answer("SIP/10.168.0.228-0000011d", "") in new stack