[asterisk-users] Dialplan Priorities and Sort Order...

M Hulber asterisk-admin at hulber.com
Wed May 20 14:16:34 CDT 2009



Alex Samad wrote:
> On Tue, May 19, 2009 at 02:05:47PM -0400, M Hulber wrote:
>   
>> What you have here should work just fine except:
>>
>> exten => _1866NXXXXXX,1,Dial(ZAP/g1/${EXTEN}) -- note the change from n to 1.
>>
>> I also don't understand why you have an "Answer" after your Dial statements.
>>
>> I would do this:
>>     
>
> Hi 
>
> I am new to asterisk and still trying to get head around dialplan.  can
> I clarify what is happening in this plan
>
> in context general-outbound, you are including pri_outbound (all its
> rules are placed at the bottom because its an include this its rules are
>   
In my modification I did not put the pri_outbound inclusion at the 
bottom because it's not necessary.  The general-outbound rules will get 
matched before the pri_outbound rules.
> sorted bellow the rules in the context, similarly the order of include
> is important)
>
> Why do you use busy after the dial ?
>
>
>   
I left the busy after dial because this is what the original poster 
had.  In this case, if the channel does not get hungup then the next 
execution will be a busy, letting the caller know the call was not 
completed.  In the dialplan macro I normally use it checks for the call 
status and acts accordingly as seen below.  If you are new to Asterisk 
syntax this is probably confusing.  If you are following it, I don't 
exit on a BUSY because I frequently get a BUSY when there is actually a 
congestion or channel problem.  Anyhow, how often is a line actually 
busy these days?

exten => s,n,Set(DIALS1="IAX2/xxxxxxxx at carrier1-out/${ARG1},90,T")
exten => s,n,Set(DIALS2="IAX2/xxxxxxxx at carrier2-out/${ARG1},90,T")
exten => s,n,Set(DIALS3="SIP/${ARG1}@carrier3-out,90,T")

exten => s,n,Set(DialNum=3)
exten => s,n,Set(DialCount=0)

exten => s,n(dial),Set(DialCount=$[1 + ${DialCount}])
exten => s,n,GotoIf($[${DialCount} > ${DialNum}]?h,1)
exten => s,n,Dial(${DIALS${DialCount}})
exten => s,n,Goto(dial)

exten => s-CONGESTION,1,Congestion(5)
exten => s-CONGESTION,n,Macro(rhangup)

exten => s-BUSY,1,Playtones(busy)
exten => s-BUSY,n,Busy(5)
exten => s-BUSY,n,Macro(rhangup)

exten => h,1,GotoIf($[${DIALSTATUS} = BUSY]?s-BUSY,1)
exten => h,n,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?s-CONGESTION,1)
exten => h,n,GotoIf($[${DIALSTATUS} = CONGESTION]?s-CONGESTION,1)
exten => h,n,Macro(rhangup)

exten => t,1,Macro(rhangup)



>> ; Outbound via POTS
>> [general-outbound]
>>
>> include => pri_outbound
>>
>> exten => _1800NXXXXXX,1,Dial(ZAP/g1/${EXTEN})
>> exten => _1800NXXXXXX,n,Busy
>> exten => _1800NXXXXXX,n,Hangup
>>
>> exten => _1866NXXXXXX,1,Dial(ZAP/g1/${EXTEN})
>> exten => _1866NXXXXXX,n,Busy
>> exten => _1866NXXXXXX,n,Hangup
>>
>> exten => h,1,Hangup
>>
>> ; Outbound via PRI
>> [pri_outbound]
>> exten => _X.,1,Dial(ZAP/g0/${EXTEN})
>> exten => _X.,n,Busy
>> exten => _X.,n,Hangup
>>
>> exten => h,1,Hangup
>>
>> Tim Nelson wrote:
>>     
>
> [snip]
>
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

-- 

MARK.

Hulber Technologies
asterisk-admin at hulber.com

Read my blog             :  http://mark.hulber.com
Follow @hulber on Twitter:  http://twitter.com/hulber




More information about the asterisk-users mailing list