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

Jared Smith jsmith at digium.com
Tue Feb 26 12:21:35 CST 2008


On Tue, 2008-02-26 at 12:00 -0600, John Lange wrote:
> I'd forgotten about nested includes. So the nested includes are searched
> all the way down the tree before the next included context. Correct?

Yes.  It's a depth-first search.

> And I second that question about how the special extensions play into
> this, especially "a" and "o".
> 
> If a call is sent into voicemail via an include or a nested include and
> the caller subsequently exits the voicemail system with "*" or "0", do
> they exit in the starting context, or into the context that voicemail
> was called? Or are all included contexts searched from the start down
> for the first match of 'a' or an 'o' ?

An include acts as if the included extension was actually a part of the
context that contains the include statement.

Again, this is easy enough to test with a quick dialplan example:

[original]
exten => a,1,NoOp(We matched in the original context)
include => first-include

[first-include]
exten => 500,1,Voicemail(1234 at default)
exten => a,1,NoOp(We matched in the first included context)
include => second-include

[second-include]
exten => a,1,NoOp(We matched in the second included context)

If you were to point your phone at the [original] context and dialed
extension 500 and then pressed the * key (to get to the 'a' extension),
you'd see that we'd match on the 'a' extension in the [original]
context.  This is because extension 500 was called as if it had been in
the [original] context.  Make sense?

-- 
Jared Smith
Community Relations Manager
Digium, Inc.




More information about the asterisk-dev mailing list