On Fri, 2003-09-05 at 01:40, John Todd wrote:
[nonpedanticexample] exten => s,1,DigitTimeout(5) exten => s,2,ResponseTimeout(20) exten => s,3,Background(type-your-selection) exten => s,4,Background(silence/3) exten => s,5,Background(type-your-selection) exten => s,6,Background(silence/3) exten => s,7,Background(if-you-need-help-press-pound-for-instructions)
exten => t,1,Goto(s,3)
This is another way. Please think about limiting your loops like I have below. It is possible to get a channel that didn't detect a hangup, and would stay busy the way you have listed above.
[anotherway] exten => s,1,SetVar(Loop=0) exten => s,2,DigitTimeout(5) exten => s,3,ResponseTimeout(20) exten => s,4,Background(type-your-selection)
exten => t,1,SetVar(Loop=[${Loop}+1]) exten => t,2,gotoif([${Loop} > 6]?t|100) exten => t,3,gotoif([${Loop} == 3]?t|200) exten => t,4,goto(s|3)
exten => t,100,Hangup
exten => t,200,Background(if-you-need-help-press-pound-for-instructions) exten => t,201,goto(s|3)
-- Steven Critchfield <[EMAIL PROTECTED]>
As usual, there is more than one way to skin a Aster-cat.
My example was intentionally incomplete as a whole dialplan, as it was an example. I normally use AbsoluteTimeout for any calls coming into the system to handle "stuck" callers, and then change the AbsoluteTimeout to a different value when I send the caller to a Dial routine. This method reduces complexity, and allows me to jump around in the dialplan without having to build a bunch of GotoIf jumps or think about where I am in a counter routine when I move between contexts. Of course, the incrementing counter may be used for other purposes, so it may be suitable in certain circumstances.
While I really like GotoIf and use it extensively, I really hate it as well, since every time I make a change in a matching group, I have to increment every number after it, and then find every single GotoIf that references priorities that have been changed.
JT _______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users