[asterisk-dev] CID match uses "shortest prefix match"

Leif Madsen leif.madsen at asteriskdocs.org
Thu Mar 19 07:57:24 CDT 2009



Klaus Darilion wrote:
> Thanks for helping in clarifying things.

In an attempt to try and answer you question and try clarifying as opposed to 
making more opaque (and I'm sure Jared or someone else will correct me if my 
understanding is incorrect)

> So what about dialing 123456 and having:
> exten => _12345.,NoOp(Option 1)
> exten => _123.,1,NoOp(Option 2)
> 
> Which one will be used? I do not found this scenario in your description.

The _12345. should be matched because

a) it is more specific of a match (matches more strict characters)

b) you have a . and not a ! -- my understanding is:  . means to match 1 or more 
characters, and ! means to match 0 or more characters.

> Or what will be used in this case (dialing 123456):
> exten => _X2345.,NoOp(Option 1)
> exten => _123.,1,NoOp(Option 2)

Ooooo.... that's a good one I've never used.

My guess is that _123. would be matched in that case because the first character 
is more "specific" than the X pattern match character.

Leif Madsen.



More information about the asterisk-dev mailing list