[asterisk-users] Re: Match a Numer - then continue with dialplan

Tony Mountifield tony at softins.clara.co.uk
Wed Dec 20 15:02:14 MST 2006


In article <645FEC31A18FE54A8721500CDD55A7B60350769F at mail.oneeighty.com>,
Douglas Garstang <dgarstang at oneeighty.com> wrote:
> From: Tony Mountifield [mailto:tony at softins.clara.co.uk]
> > However, don't forget that it searches for matching 
> > extensions every time
> > the priority changes. You are not locked into a particular pattern or
> > extension number from priority 1 onwards. You can mix and 
> > match patterns
> > with literal extensions, even across includes, e.g.
> 
> Don't follow you. When asterisk matches an extension, it starts interating through the
> priorities until there's none left, or you Goto() somewhere else.

Not exactly, and this may be where you're feeling unduly restricted.

The asterisk engine always searches for the combination of extension
and priority at every step. So if you dial extension 123, it will look
in the relevant context (and then any included contexts, in order) for
a line that matches (123,1). This could be "123,1" or "_X.,1" or "_1XX,1",
and so on. When found, it executes the command (application) specified
on that line.

If the command was not any kind of goto, Asterisk then increments the
priority from 1 to 2, and then does a completely fresh search for (123,2).
This could again be matched by "123,2" or "_X.,2" or "_X2X,2" or whatever,
and DOESN'T HAVE TO BE THE SAME PATTERN, NOR IN THE SAME INCLUDE, AS THE
LINE THAT MATCHED (123,1). This is the point.

However, please try to get away from the mindset of wanting Asterisk to
do stuff while it is searching. It can only execute things that are on
lines that fulfil its search.

Many of us are trying to suggest solutions based on what Asterisk CAN do.
*WE* get frustrated when you reject such suggestions because you want
Asterisk to work in a way it doesn't.

Please start to see Asterisk as a fun challenge rather than something
that has been inflicted upon you!

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org


More information about the asterisk-users mailing list