[asterisk-dev] New wildcards for pattern matching

Pavel Troller patrol at sinus.cz
Thu Feb 25 05:46:53 CST 2010


> > OK, a final '~' meaning 0 or more of the preceding 
> > character or class. Hmmm.   Instead, would it be OK to 
> > make it 1 or more
> 
> Zero or more makes it more useful as it can replace the ! wildcard too.
> It is always possible to make it one or more by simply doubling the last
> char e.g.
> 
> _123[0-9]~ is a numeric restriction of _123!
> _123[0-9][0-9]~ is a numeric restriction of _123.
> 
> 

Hi!
  I'm sorry but I still doesn't understand, how doubling the last char can
make "." from "!". The main difference between these two symbols are in the
fact, that "!" makes IMMEDIATE match, while "." tries to collect more digits.
The difference is visible on channels with overlap dialling support (like
DAHDI, SCCP and even SIP under certain conditions). For example, when a
pattern _123. is used and the number 123456 is received in overlap mode (like
in SS7 IAM message), a timer is started to wait for more digits (possibly
coming in SAM messages), and if 7, 8 and 9 comes later on, the real ${EXTEN}
will be 123456789. Using pattern _123! and receiving a number 123456 doesn't
start any timers, immediately executes the extension and its ${EXTEN} is,
of course, 123456. 
  Please explain, how can your ~ equivalents of "." and "!" work with my
examples above.
  With regards, Pavel.



More information about the asterisk-dev mailing list