[Asterisk-Users] pattern matching problems

Florian Overkamp florian at obsimref.com
Tue Aug 31 04:42:02 MST 2004


Hi, 

> -----Original Message-----
> this is from my extensions.conf, the first three patterns are for
> toll-free numbers, and fourth pattern is for other numbers, 
> where an AGI
> is called for authentication. 
> now when I dial 011448000664327 if falls into the fourth 
> pattern, where
> as it should be matched by the first pattern. Any suggestions
> 
> 1 - exten => _01144800XXXXXXX,1,Dial(${MAG}/${EXTEN:3},45,tT)
> 2 - exten => _01144808XXXXXXX,1,Dial(${MAG}/${EXTEN:3},45,tT)
> 3 - exten => _01144500XXXXXXX,1,Dial(${MAG}/${EXTEN:3},45,tT)
> 
> 4 - exten => _011.,1,AGI(iax.agi)
> 4 - exten => _011.,2,Dial(${MAG}/${EXTEN:3},45,tT)
> 4 - exten => _011.,103,playback(no-service)

Better to do it like this:

[mycontext]
Include = numberedcases
Include = othercases

[numberedcases]
exten => _01144800XXXXXXX,1,Dial(${MAG}/${EXTEN:3},45,tT)
exten => _01144808XXXXXXX,1,Dial(${MAG}/${EXTEN:3},45,tT)
exten => _01144500XXXXXXX,1,Dial(${MAG}/${EXTEN:3},45,tT)

[othercases]
exten => _011.,1,AGI(iax.agi)
exten => _011.,2,Dial(${MAG}/${EXTEN:3},45,tT)
exten => _011.,103,playback(no-service)

Included contexts are matched sequentially.

Florian




More information about the asterisk-users mailing list