[Asterisk-Users] pattern matching problem

Joseph syscon at interbaun.com
Mon Jan 17 10:03:37 MST 2005


On Mon, 2005-01-17 at 09:02 +0100, Jens Vagelpohl wrote:
> On Jan 17, 2005, at 7:29, Joseph wrote:
> 
> > How do I solve the problem with between patterns:
> > _1800
> > _1NXX
> >
> > I would like all numbers 1800, 1877 etc to go through iaxtel
> > but all other numbers 1xxx via voipjet
> 
> When you combine these contexts, e.g. when you include them in your 
> default context, you need to make sure that the more specific 
> expression (in this case the iaxtel expression) appears *before* the 
> less specific expression (outgoing-voipjet). First match wins.
> 
> jens

Yes, I recall reading about it in they way they are sorted.
So I include them in Internal context. 

[internal]
include => iaxtel
include => outgoing-voipjet

[iaxtel]
exten => _1700NXXXXXX,1,Dial(IAX2/xxx:xxx at iaxtel.com/${EXTEN}@iaxtel)
exten => _1888NXXXXXX,1,Dial(IAX2/xxx:xxx at iaxtel.com/${EXTEN}@iaxtel)

[outgoing-voipjet]
exten => _1NXXNXXXXXX,1,SetCallerID(7475451055)
exten => _1NXXNXXXXXX,2,Dial,IAX2/1555 at voipjet/${EXTEN}

Though what you are saying I should combine these two.

-- 
#Joseph



More information about the asterisk-users mailing list