[Asterisk-Users] The sounds of silence: silent soundfiles
available
Steven Critchfield
critch at basesys.com
Fri Sep 5 12:52:00 MST 2003
On Fri, 2003-09-05 at 14:41, John Todd wrote:
> >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 <critch at basesys.com>
>
> 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 that is another way of doing it, it would seem odd to have a
prompt be terminated mid sentence/word. Of course if set appropriately
long enough, the pbx operator wouldn't care about the user that was cut
off as they aren't being productive.
Just a request, but if you post examples like this, please make it
complete enough to show best practices. I'm sure someone before too long
is going to scour the archive and create a book on this. Maybe even an
O'reilly book if we are lucky. It would be nice to make sure everyone
understands these concepts that are often glazed over in interest of
brevity or reduction of complexity.
> 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.
I hear you, and agree.
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-users
mailing list