On 9/5/07, <b class="gmail_sendername">Adrian Marsh</b> &lt;<a href="mailto:Adrian.Marsh@ubiquisys.com">Adrian.Marsh@ubiquisys.com</a>&gt; 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!!&nbsp;&nbsp;I didn&#39;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 &quot;include&quot; to pull them in in a specific order:
<br><br>[foo]<br><span class="q">exten =&gt; _017935201[56][0-9],1,Goto(local,${EXTEN:-3},1)<br>include =&gt; bar<br><br>[bar]<br></span><span class="q">exten =&gt; _0.,1,Set(CALLERID(num)=${PSTN_GLOBAL}${CALLERID(num):-3})
<br></span><span class="q">exten =&gt; _0.,2,Dial(${TRUNK}/${EXTEN},,W)</span><br><span class="q"><br>Dialing 01793520158 would match the longer pattern in this case.&nbsp; 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&#39;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.