[asterisk-users] Loop Break

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Jan 21 09:32:08 CST 2008


On Mon, Jan 21, 2008 at 08:58:53AM -0500, Doug Lytle wrote:
> Mian M Asif wrote:
> > Hi All,
> >
> > please see my below dialplan, i want to break this loop after three
> > attempts without AGI script.
> >
> > exten => s,1,Background(Balance-Inquiries)
> > exten => s,n,Background(commanOptions)
> > exten => s,n,WaitExten(2)
> > exten => s,n,Goto(,s,1)
> >
> >
> > Please Help me how can i break this loop in Asterisk.
> >
> >   
> 
> exten => s,1,Set(COUNT=$[${COUNT} + 1])
> exten => s,n,NoOP(${COUNT})
> exten => s,n,GotoIf($[ ${COUNT} > 3 ]?103)

Style nitpicking:

exten => s,1,Set(COUNT=$[${COUNT} + 1])
exten => s,n,NoOP(${COUNT})
exten => s,n,GotoIf($[ ${COUNT} > 3 ]?endloop)
exten => s,n,Goto(1)
exten => s,n(endloop),NoOp(Loop ended)

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list