[asterisk-dev] new priority of pattern matching in 1.4. Does it makes sense?

John Lange john.lange at open-it.ca
Mon Feb 25 14:51:55 CST 2008


My example was contrived (to protect the innocent) so working through
the way I have it in the real world I'm slowly coming to the realization
that the order of inclusion is what was throwing it off.

So I think I finally have a handle on how Asterisk does matching. It's
kind of embarrassing that I've been doing Asterisk so long and not had a
complete understanding of how it works.

Anyhow, does this description do it justice?

Asterisk pattern matching works like this:

1) Asterisk searches for *ANY* matching pattern in the starting context
giving priority to the best match.

2) Only if no pattern could possibly match in the starting context,
Asterisk will search the first specified included context, again giving
priority to the best match.

3) Only if no pattern could possibly match in the first included
context, then Asterisk will search the second, then third included
context, and so on until a match is found or all patterns have been
tested.

4) if no pattern matches, the "i" extension will be matched.

5) if no "i" extension exists, the "t" extension will match after the
specified timeout.

John





More information about the asterisk-dev mailing list