[asterisk-dev] extensions.conf included contexts priorities

Steve Murphy murf at parsetree.com
Wed Apr 25 07:04:21 MST 2007


On Wed, 2007-04-25 at 08:18 -0400, Andrew Kohlsmith wrote:
> On Tuesday 24 April 2007 8:26 pm, Jared Smith wrote:
> > Here's just one example of the many ways I use the current behavior.
> >
> > [long-distance]
> > exten => _1NXXNXXXXXX,1,Dial(IAX2/${UPSTREAM}/${EXTEN})
> > include => local
> >
> > [local]
> > exten => _NXXXXXX,1,Dial(IAX2/${LOCALPROVIDER}/${EXTEN})
> > exten => _1NXXNXXXXXX,1,Dial(no-permissions-to-make-this-type-of-call)
> 
> In this case, however, you could not dial locally if your context includes 
> longdistance!
> 
> i.e. don't you use something like this?
> 
> [international]
> exten => _011.,1,Dial(...)
> include => longdistance
> 
> [longdistance]
> exten => _1NXXNXXXXXX,1,Dial(...)
> include => local
> 
> [local]
> exten => _NXXNXXXXXX,1,Dial(...)
> exten => _NXXXXXX,1,Goto(519${EXTEN},1)
> 
> [trusted]
> include => nine11
> include => internal
> include => international
> 
> [polycom]
> include => hints
> include => trusted
> 
> sip.conf:
> [221]
> context = polycom
> 
> ??  In that case, putting a _1NXXNXXXXXX,1,Dial(...) in local will never get 
> executed, since the wildcard match in longdistance will always hit first.  In 
> what I thought it should be, your local will override since wildcards are 
> lowest-priority, and the local wildcard will match before the LD wildcard 
> since includes of a context are searched before wildcards of the context.
> 
> -A.

Andrew--

Well, I guess the magic of putting the _1NXXNXXXXXX exten in the local
context wouldn't be useful until you define an "untrusted" context:

[untrusted]
include => local

And, maybe, it'd be better to define the local this way instead:

[local]
exten => _NXXNXXXXXX,1,Playback(gojumpinthelake)
exten => _011.,1,Playback(gojumpinthelake)
exten => _NXXXXXX,1,Dial(...)


so, sip.conf might have
[lobbyphone]
context = untrusted

(all you want folks using the phone in the lobby for is dialing local
numbers) 

So, now, a single local context can serve both trusted and untrusted
situations.
The gojumpinthelake message will only get played when not overridden by
higher contexts.

It's backwards to what you are accustomed to, but still useful.

murf







More information about the asterisk-dev mailing list