On 9/5/07, <b class="gmail_sendername">Adrian Marsh</b> <<a href="mailto:Adrian.Marsh@ubiquisys.com">Adrian.Marsh@ubiquisys.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Many thanks for that!! I didn't know that the order worked quite like<br>that but I see it now... Better go check the other contexts...<br>(the [56][0-9] worked fine).</blockquote><div><br>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:
<br><br>[foo]<br><span class="q">exten => _017935201[56][0-9],1,Goto(local,${EXTEN:-3},1)<br>include => bar<br><br>[bar]<br></span><span class="q">exten => _0.,1,Set(CALLERID(num)=${PSTN_GLOBAL}${CALLERID(num):-3})
<br></span><span class="q">exten => _0.,2,Dial(${TRUNK}/${EXTEN},,W)</span><br><span class="q"><br>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.
<br></span><span class="q"><br>There's more info here:<br><br><a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+config+extensions.conf+sorting">http://www.voip-info.org/wiki/index.php?page=Asterisk+config+extensions.conf+sorting
</a><br><br></span></div></div>-- <br>j.