Hello, I am using Asterisk 13 and cannot understand why my dialplan is choosing a pattern over an explicit extension. Can you please look at this and tell me what I need to change?
[internalextensions]
exten => 4030,1,Dial(SIP/operatorone)
same => n,HangUp()
exten => 3030,1,Goto(internalextensions,4030,1)
same => n,HangUp()
exten => _3XXX,1,Set(CALLERID(num)=00${CALLERID(num)})
same => n,Dial(SIP/4${EXTEN}@otherpbx)
same => n,GotoIf($["${DIALSTATUS}"="CONGESTION"]?OtherRoute)
same => n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?OtherRoute:StopTrying)
same => n(OtherRoute),Dial(SIP/4${EXTEN}@otherpbx2)
same => n,GotoIf($["${DIALSTATUS}"="CONGESTION"]?Sorry)
same => n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?Sorry:StopTrying)
same => n(Sorry),Playback(sorry-pbx)
same => n(StopTrying),HangUp()
The command dialplan show 3030@internalextensions shows that the explicit extension 3030 should come first but when I dial this extension from a device in that same context the call follows the _3XXX pattern.
The weird thing is that if I move the patterned extension to appear in the context before the explicit extension it works as I expect it to: Dialling 3030 is pushed to 4030 but dialling a different 3XXX number follows the pattern. In both cases the dialplan show command displays the same order, which is that the explicit extension comes first.