<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags" xmlns:st2 =
"schemas-snapanumber-com/snap" xmlns:ns0 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1611" name=GENERATOR><o:SmartTagType
name="place"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="country-region"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="dial" namespaceuri="schemas-snapanumber-com/snap"
downloadurl="http://www.snapanumber.com"></o:SmartTagType><o:SmartTagType
name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><!--[if !mso]>
<STYLE>st1\:* {
        BEHAVIOR: url(#default#ieooui)
}
st2\:* {
        BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Courier;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=292333316-07082008>Try this:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN class=292333316-07082008>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff>[local]<o:p></o:p></FONT></SPAN></FONT></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff>exten => _<st2:dial w:st="on">0016501109</st2:dial>1[45]<SPAN
class=292333316-07082008>[</SPAN>0-9],1,NoOp(I AM
HERE)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff>exten => _<st2:dial w:st="on">0016501109</st2:dial>1[45]<SPAN
class=292333316-07082008>[</SPAN>0-9],n,Macro(setcli)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff>exten => _<st2:dial w:st="on">0016501109</st2:dial>1[45]<SPAN
class=292333316-07082008>[</SPAN>0-9],n,Dial(SIP/${EXTEN:2}@someserver.com)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff>exten => _<st2:dial w:st="on">0016501109</st2:dial>1[45]<SPAN
class=292333316-07082008>[</SPAN>0-9],n,Hangup</FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><SPAN
class=292333316-07082008><FONT color=#0000ff>The "[" before "0-9]" is
needed.</FONT></SPAN></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff><o:p></o:p></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><FONT
color=#0000ff><o:p></o:p></FONT></SPAN> </P></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV align=left><FONT face=Arial size=2></FONT></DIV>
<DIV class=MsoNormal align=left><B><I><SPAN lang=PT-BR
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"><SPAN
class=972104617-02062008>Felippe Silvestre</SPAN></SPAN></I></B></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <B>On Behalf Of </B>Adrian
Marsh<BR><B>Sent:</B> Thursday, August 07, 2008 07:46<BR><B>To:</B> Asterisk
Users Mailing List - Non-Commercial Discussion<BR><B>Subject:</B>
[asterisk-users] problem controlling dialplan order<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi
All,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">On a 1.4.15 system, I’ve a context
as below, where I need to catch some specific <st1:country-region
w:st="on"><st1:place w:st="on">US</st1:place></st1:country-region> ranges and
dial direct via SIP rather than a PSTN trunk. But the logic always goes
via the International Trunk and I cant see why…<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">[local]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten => _<st2:dial
w:st="on">0016501109</st2:dial>1[45]0-9],1,NoOp(I AM
HERE)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten => _<st2:dial
w:st="on">0016501109</st2:dial>1[45]0-9],n,Macro(setcli)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten => _<st2:dial
w:st="on">0016501109</st2:dial>1[45]0-9],n,Dial(SIP/${EXTEN:2}@someserver.com)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten => _<st2:dial
w:st="on">0016501109</st2:dial>1[45]0-9],n,Hangup<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">….. (same
context)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">Catch local (<st1:country-region
w:st="on"><st1:place w:st="on">UK</st1:place></st1:country-region>)
numbers<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_0[1-9]X.,1,NoOp(Dialling <st1:country-region w:st="on"><st1:place
w:st="on">UK</st1:place></st1:country-region>
number)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_0[1-9]X.,n,Macro(setcli)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_0[1-9]X.,n(jumpdial),Dial(SIP/+44${EXTEN:1}@brokerout)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_0[1-9]X.,jumpdial+101,Dial(${TRUNK}/${EXTEN},,Wr)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_0[1-9]X.,n+101,Busy<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">;Catch any (00xx)
numbers<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_00X.,1,NoOp(Dialling International number)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_00X.,n,Macro(setcli)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_00X.,n(jumpdial),Dial(SIP/+${EXTEN:2}@brokerout)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_00X.,jumpdial+101,Dial(${TRUNK}/${EXTEN},,Wr)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">exten =>
_00X.,n+101,Busy<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’ve tried putting the Catch codes
above into a sub-context, and then put an include into the [local], but it
still dials via the Catch international…<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The odd thing is that in either,
the show dialplan seems to suggest the correct order
:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"> '_00165011091[45]0-9]'
=> 1. NoOp(I AM
HERE)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
2.
Macro(setcli)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
3.
Dial(SIP/${EXTEN:2}@someserver.com)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
4.
Hangup()
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">…. (some
others)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier"> '_00X.'
=> 1. NoOp(Dialling International
number)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
2.
Macro(setcli)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
[jumpdial] 3.
Dial(SIP/+${EXTEN:2}@brokerout)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
104.
Dial(${TRUNK}/${EXTEN}||Wr)
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Courier size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Courier">
206.
Busy()
[pbx_config]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The page at voip-info isn’t too
clear in the differences between 1.2 and 1.4 (<A
href="http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf+sorting">http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf+sorting</A>)
so I’m not sure where I’ve gone wrong.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><st1:PersonName w:st="on"><SPAN class=style131><FONT
face=Arial color=#003366 size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: #003366; FONT-FAMILY: Arial">Adrian
Marsh</SPAN></FONT></SPAN></st1:PersonName><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>