[asterisk-users] Can Asterisk match a literal "*" in extensions.conf

Atis atis at BEST.eu.org
Fri Sep 14 16:12:48 CDT 2007


On 9/14/07, Jared Smith <jsmith at digium.com> wrote:
> On Fri, 2007-09-14 at 10:51 -0600, Anthony Francis wrote:
> > . matches any number of the preceding character, change it to _X.*X.
>
> That still won't help.  Once the Asterisk pattern matching parser sees a
> period in the pattern, it ignores anything after it.  (I'm not exactly
> happy about that, but that's the way it is.)  In short, Asterisk doesn't
> currently have a good way of handling this situation.  Hopefully
> somebody infinitely smarter than I am will take pity on our plight and
> give us a some more advanced pattern-matching tools.  (Hint, hint)

Well, you can have some 10 or so patterns (how long can the number
before be), with X, as X means one digit..

For example:

exten => _X*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXXXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXXXXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXXXXXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXXXXXXX*.,1,Goto(default-wildcard|${EXTEN}|1)
exten => _XXXXXXXXXX*.,1,Goto(default-wildcard|${EXTEN}|1)

[default-wildcard]
exten => _X.,1,Macro(whatever)

Regards,
Atis

-- 
Atis Lezdins,
IT Responsible of BEST Riga,
atis at BEST.eu.org
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? -> www.BEST.eu.org



More information about the asterisk-users mailing list