At 8:04 PM on 12 May 2010, Robert Wagner wrote:

> i need to match a number with like 03012345678*0 or 03012345*9
> I tried _X.*X and _X!*X but both are maching 03012345678 too, ignoring
> that *X is required at the end.
> The interesting part is that like expected _X*X is matching only
> numbers like 1*1 and not 11

The . in a pattern is meant only to be used at the end, to match any
remaining characters.  The *X after the dot in your pattern is just
being ignored.  Have you checked for warnings in your log?  I'm not
sure if Asterisk issues a warning on that, but I think it should.

One thing you could do is make one pattern for each possible length.
e.g.: _XXXXXXXXXXX*X and _XXXXXXXX*X

If you need it to be variable length, I think you would need to use the
Read application instead of standard dialplan matching.


-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0

Attachment: signature.asc
Description: PGP signature

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to