[Asterisk-Users] Dialplan pattern match discrepancy

Steve Davies davies147 at gmail.com
Mon Nov 28 02:43:59 MST 2005


On 11/25/05, Daniel Wright <dw at wonderwave.net> wrote:
> Steve Davies wrote:
> > Hi,
> >
> > This is probably just me mis-reading the documentation, but I have
> > been led to believe that the '.' in extensions.conf means zero or more
> > digits, such that
> >
> > exten => _X.,1,NoOp()
> >
> > Would trigger for either a single digit, or for a longer number (as
> > long as it starts with a digit)
> >
> > In practice (I am using 1.0.7 and 1.0.9) the '.' seems to match *one*
> > or more digits, so in the above example, a single digit is not matched
> > as expected.
> >
> > Is this correct? A bug? Fixed in 1.2 ;-) ?
> >
>
> The period is match 1 or more characters(can be a number or letter).
> So in your example, you are saying first match a number 0-9, then match
> any one or more characters.
>
> Dan

Thanks Dan.

It does make the extensions.conf warning that '_.' should be replaced
with '_X.' a bit counter-intuitive then :) I completely understand why
'_.' is risky, but '_X.' is not the same thing at-all!

I assume that the only way to match one digit, followed by
zero-or-more alphanumeric is to have 2 sets of rules:

exten => _X,1,NoOp("One Digit")
exten => _X.,1,NoOp("One Digit and more stuff")

even if the same operation is to be carried out.

Ho hum!
Steve



More information about the asterisk-users mailing list