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

Alex Samad alex at samad.com.au
Wed May 20 16:35:26 CDT 2009


On Wed, May 20, 2009 at 03:16:34PM -0400, M Hulber wrote:
> 
> 
> Alex Samad wrote:
> > On Tue, May 19, 2009 at 02:05:47PM -0400, M Hulber wrote:
> >   

[snip]

> >   
> 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)
> 

Wow thats a neet way to dial multiple providers, can you make it into a
macro and passin an array of numbers ? and maybe another param to
specify how many elements in the array ?

[snip]

> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20090521/ecfe0455/attachment.pgp 


More information about the asterisk-users mailing list