[asterisk-users] Dialplan regexp

James FitzGibbon james.fitzgibbon at gmail.com
Wed Sep 5 11:57:46 CDT 2007


On 9/5/07, Adrian Marsh <Adrian.Marsh at ubiquisys.com> wrote:
>
> Many thanks for that!!  I didn't know that the order worked quite like
> that but I see it now... Better go check the other contexts...
> (the [56][0-9] worked fine).


You can also impose a finer level of control over the order extensions are
searched in by putting them in different contexts and using "include" to
pull them in in a specific order:

[foo]
exten => _017935201[56][0-9],1,Goto(local,${EXTEN:-3},1)
include => bar

[bar]
exten => _0.,1,Set(CALLERID(num)=${PSTN_GLOBAL}${CALLERID(num):-3})
exten => _0.,2,Dial(${TRUNK}/${EXTEN},,W)

Dialing 01793520158 would match the longer pattern in this case.  The search
is done in the initial context, then in each included context in the order
they were included.

There's more info here:

http://www.voip-info.org/wiki/index.php?page=Asterisk+config+extensions.conf+sorting

-- 
j.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070905/5ae67106/attachment.htm 


More information about the asterisk-users mailing list