<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 5, 2016 at 9:06 AM, D'Arcy J.M. Cain <span dir="ltr"><<a href="mailto:darcy@vex.net" target="_blank">darcy@vex.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have this in my config:<br>
<br>
exten => _800XXXXXXX,1,Verbose(0,${<wbr>CHANNEL(peername)} Calling ${EXTEN})<br>
  same => n,Dial(SIP/tollfree/1${EXTEN})<br>
exten => _1800XXXXXXX,1,Verbose(0,${<wbr>CHANNEL(peername)} Calling ${EXTEN})<br>
  same => n,Dial(SIP/tollfree/${EXTEN})<br>
exten => _NXXNXXXXXX,1,Verbose(0,${<wbr>CHANNEL(peername)} Calling ${EXTEN})<br>
  same => n,Dial(SIP/trunk/1${EXTEN})<br>
exten => _1NXXNXXXXXX,1,Verbose(0,${<wbr>CHANNEL(peername)} Calling ${EXTEN})<br>
  same => n,Dial(SIP/trunk/${EXTEN})<br>
<br>
I came across<br>
<a href="http://stackoverflow.com/questions/7235291/asterisk-priorities-that-have-a-possibility-of-matching" rel="noreferrer" target="_blank">http://stackoverflow.com/<wbr>questions/7235291/asterisk-<wbr>priorities-that-have-a-<wbr>possibility-of-matching</a><br>
which seems to imply that the above won't work and that all the calls<br>
would go to the trunk.  However, this is working as expected for me.<br>
Did the behaviour change in the last four years or could I run into<br>
problems with this setup?  Perhaps I am misunderstanding the poster's<br>
issue.<br></blockquote><div><br></div><div>Dialplan will stay on the current series of extensions until it runs out.  If there isn't an explicit hangup<br></div><div>to stop execution it will look for the next priority match.  You can easily test this yourself by creating<br></div><div>some test dialplan to match your situation.<br></div><div><br></div><div>Given the below dialplan:<br></div><div><br></div><div>exten = _800XXXXXX,1,NoOp(Start of 800 series)<br></div><div>same = n,NoOp(Next in 800 series)<br><br></div><div>exten = _NXXNXXXX,1,NoOp(Generic series)<br></div><div>same = n,NoOp(next in generic series)<br></div><div>same = n,NoOp(third in generic series)<br><br></div><div>If you have an 800 number starting in dialplan then these are the priorities<br></div><div>executed:<br></div><div>1, Start of 800 series<br></div><div>2, Next in 800 series<br></div><div>Since we have run out of the 800 series Asterisk looks for a priority 3 that matches the extension<br></div><div>and finds priority 3 of the generic series.<br></div><div>3, third in generic series<br></div><div>There is no priority 4 so the call is hung up.<br><br></div><div>Richard<br></div><div><br></div><br><div>[1] <a href="https://wiki.asterisk.org/wiki/display/AST/Contexts%2C+Extensions%2C+and+Priorities">https://wiki.asterisk.org/wiki/display/AST/Contexts%2C+Extensions%2C+and+Priorities</a><br>[2] <a href="https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching">https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching</a><br></div></div><br></div></div>