Fast question on extensions.conf, the "priority" for context

Fast and simple question: suppose this simple extensions.conf

[local]
exten=>500,1,Noop(UnixTime)
exten=>500,n,SayUnixTime(,EST5EDT)
exten=>500,n,NoOp(demo-echotest)
exten=>500,n,Playback(demo-echotest)
exten=>500,n(echo),Echo()
exten=>500,n,Playback(demo-echodone)
exten=>500,n,Hangup()

[sip]
exten => _X.,1,NoOp()
same => n,Dial(PJSIP/${EXTEN}@asterisk01,30,tTkK)
same => n,Hangup()

exten = s,1,NoOp()
same => n,Dial(PJSIP/telefono1&DAHDI/1,30,tTkK)
same => n,Hangup()

[from-dahdi]
include => local
include => sip

exten => 4001,1,Dial(dahdi/1,10,t,m)
;exten => 1004,2,Voicemail(1004@local)
exten => 4001,3,Hangup

exten => s,n,Answer()
exten => s,n,Dial(Local/${EXTEN},10,t,m)
exten => s,n,Hangup()

Works fine, but If I call the 500 to hear echo test…it use my sip (voip TELCO) line!
Is possible to prioritize the context?
For example…

I call 500, if is in the local context it answer, otherwise use SIP context.
I know is possible to use the patterns:

_XXXXX.

But some number in my country (info, emergency, etc) are 4 and even 3 digits.

Very nice. I’ve set the voicemail phone

exten => 7500,1,VoicemailMain(@interni)

I call it, it answer the voicemail menu(OK) but…at the end it call using my external line. :frowning:

Which device represents your provider’s line?

In the meantime, note that each priority is matched against direct and include cases and the extension pattern doesn’t have to be the same for each priority to still match.

I’d expect this to fault, as you have no default context. Also, m is not a valid URL.

Using a local channel, rather than GoTo, seem strange.

This will result in their being no priority 2 at the outer level, so this line:

at the inner level will be matched and used.

1 Like

This should have a priority ‘1’ instead of ‘n’.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.