Hi All,
 
On a 1.4.15 system, I've a context as below, where I need to catch some
specific US 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...
 
[local]
exten => _00165011091[45]0-9],1,NoOp(I AM HERE)
exten => _00165011091[45]0-9],n,Macro(setcli)
exten => _00165011091[45]0-9],n,Dial(SIP/${EXTEN:2}@someserver.com)
exten => _00165011091[45]0-9],n,Hangup
 
..... (same context)
 
Catch local (UK) numbers
exten => _0[1-9]X.,1,NoOp(Dialling UK number)
exten => _0[1-9]X.,n,Macro(setcli)
exten => _0[1-9]X.,n(jumpdial),Dial(SIP/+44${EXTEN:1}@brokerout)
exten => _0[1-9]X.,jumpdial+101,Dial(${TRUNK}/${EXTEN},,Wr)
exten => _0[1-9]X.,n+101,Busy
 
;Catch any (00xx) numbers
exten => _00X.,1,NoOp(Dialling International number)
exten => _00X.,n,Macro(setcli)
exten => _00X.,n(jumpdial),Dial(SIP/+${EXTEN:2}@brokerout)
exten => _00X.,jumpdial+101,Dial(${TRUNK}/${EXTEN},,Wr)
exten => _00X.,n+101,Busy
 
 
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...
The odd thing is that in either, the show dialplan seems to suggest the
correct order :
 
 
 
  '_00165011091[45]0-9]' => 1. NoOp(I AM HERE)
[pbx_config]
                    2. Macro(setcli)
[pbx_config]
                    3. Dial(SIP/${EXTEN:2}@someserver.com)  [pbx_config]
                    4. Hangup()
[pbx_config]
.... (some others)
  '_00X.' =>        1. NoOp(Dialling International number)
[pbx_config]
                    2. Macro(setcli)
[pbx_config]
     [jumpdial]     3. Dial(SIP/+${EXTEN:2}@brokerout)
[pbx_config]
                    104. Dial(${TRUNK}/${EXTEN}||Wr)
[pbx_config]
                    206. Busy()
[pbx_config]
 
 
The page at voip-info isn't too clear in the differences between 1.2 and
1.4
(http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf+sort
ing) so I'm not sure where I've gone wrong.
 
 
Adrian Marsh
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20080807/fc68bf30/attachment.htm
Felippe Silvestre
2008-Aug-07  16:35 UTC
[asterisk-users] problem controlling dialplan order
Try this:
[local]
exten => _00165011091[45][0-9],1,NoOp(I AM HERE)
exten => _00165011091[45][0-9],n,Macro(setcli)
exten => _00165011091[45][0-9],n,Dial(SIP/${EXTEN:2}@someserver.com)
exten => _00165011091[45][0-9],n,Hangup
 
The "[" before "0-9]" is needed.
 
 
 
Felippe Silvestre
________________________________
	From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Adrian
Marsh
	Sent: Thursday, August 07, 2008 07:46
	To: Asterisk Users Mailing List - Non-Commercial Discussion
	Subject: [asterisk-users] problem controlling dialplan order
	
	
	Hi All,
	 
	On a 1.4.15 system, I've a context as below, where I need to
catch some specific US 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...
	 
	[local]
	exten => _00165011091[45]0-9],1,NoOp(I AM HERE)
	exten => _00165011091[45]0-9],n,Macro(setcli)
	exten =>
_00165011091[45]0-9],n,Dial(SIP/${EXTEN:2}@someserver.com)
	exten => _00165011091[45]0-9],n,Hangup
	 
	..... (same context)
	 
	Catch local (UK) numbers
	exten => _0[1-9]X.,1,NoOp(Dialling UK number)
	exten => _0[1-9]X.,n,Macro(setcli)
	exten => _0[1-9]X.,n(jumpdial),Dial(SIP/+44${EXTEN:1}@brokerout)
	exten => _0[1-9]X.,jumpdial+101,Dial(${TRUNK}/${EXTEN},,Wr)
	exten => _0[1-9]X.,n+101,Busy
	 
	;Catch any (00xx) numbers
	exten => _00X.,1,NoOp(Dialling International number)
	exten => _00X.,n,Macro(setcli)
	exten => _00X.,n(jumpdial),Dial(SIP/+${EXTEN:2}@brokerout)
	exten => _00X.,jumpdial+101,Dial(${TRUNK}/${EXTEN},,Wr)
	exten => _00X.,n+101,Busy
	 
	 
	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...
	The odd thing is that in either, the show dialplan seems to
suggest the correct order :
	 
	 
	 
	  '_00165011091[45]0-9]' => 1. NoOp(I AM HERE)
[pbx_config]
	                    2. Macro(setcli)
[pbx_config]
	                    3. Dial(SIP/${EXTEN:2}@someserver.com)
[pbx_config]
	                    4. Hangup()
[pbx_config]
	.... (some others)
	  '_00X.' =>        1. NoOp(Dialling International number)
[pbx_config]
	                    2. Macro(setcli)
[pbx_config]
	     [jumpdial]     3. Dial(SIP/+${EXTEN:2}@brokerout)
[pbx_config]
	                    104. Dial(${TRUNK}/${EXTEN}||Wr)
[pbx_config]
	                    206. Busy()
[pbx_config]
	 
	 
	The page at voip-info isn't too clear in the differences between
1.2 and 1.4
(http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf+sort
ing) so I'm not sure where I've gone wrong.
	 
	 
	Adrian Marsh
	 
	 
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20080807/bce68788/attachment.htm