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
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) thank you -- Atif
On Tue, 2004-08-31 at 21:42, Atif Rasheed wrote:> 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)This is because asterisk is 'lazy'. It will not take the "first" matching extension, nor will it take the most specific matching extension, instead, it will take the least specific extension. This means, regardless of the number, if it matches 011* then it will always take that option. The only way to acheive what you want (AFAIK) is like this: [blah] include => foo include => bar [foo] 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) [bar] exten => _011.,1,AGI(iax.agi) exten => _011.,2,Dial(${MAG}/${EXTEN:3},45,tT) exten => _011.,103,playback(no-service) This will force asterisk to look/match extensions in foo before it attempts to look/match extensions in bar. Hope this helps (and it is actually correct, try it and see) Regards, Adam
thank you people for your help, I have done it, and in a different way, like 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) exten => _011XXXXX.,1,AGI(iax.agi) exten => _011XXXXX.,2,Dial(${MAG}/${EXTEN:3},45,tT) exten => _011XXXXX.,103,playback(no-service) I made the _011. more precise, I should say -- Atif