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

Kevin P. Fleming kpfleming at digium.com
Tue Feb 26 12:20:27 CST 2008


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, this is why Matt Nicholson referred to it as a 'depth-first'
search. A width-first search would check all the included contexts at
the top level first before descending.

> 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' ?

Extensions are searched for in the 'current context' of the channel, but
matches found via switches, includes and other means do *not* change the
current context of the channel. Because of this, no matter how the
extension was found that is running VoiceMail() (for example), exiting
via the 'a' or 'o' paths will search for those extensions in the
channel's current context, which will be the one it was sent into
originally.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the asterisk-dev mailing list