login | register
Wed 01 of Aug, 2007 [09:19 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.

Web www.voip-info.org
Shoutbox
  • Aykut, Wed 01 of Aug, 2007 [07:53 UTC]: Hi all, does anybody know about Thomson ST2030 SIP phone. I have upgraded it to latest version (1.56) but "Hold" and "Conf" features are not working after the upgrade ?? Do you know any solution or do you have Ver. 1.52 ?? Where can I find it?
  • Edward J Brown, Tue 31 of Jul, 2007 [23:33 UTC]: Has anybody experienced Choppy voice quality when using a Linksys SPA942 in an Asterisk Conference bridge? It works fine with my polycom and Cisco, but sucks with my Linksys.
  • www.astawerks.com, Fri 27 of Jul, 2007 [18:00 UTC]: does anyone use asterisk on top of clark connect? does it work good?
  • simon, Fri 27 of Jul, 2007 [14:16 UTC]: Hi All, Has anyone here managed to get the Cisco79x1 to successfully fail over to the backup proxy. I have 2 asterisk servers , handsets all register and function, except that backup proxy function doesn't work. Any working example would be very apprecia
  • Matthew Richmond, Thu 26 of Jul, 2007 [03:40 UTC]: using the page() application to page across our building...often the meetme conferences don't disconnect after the caller hangs up. Anyone else having this problem. (using Polycom phones)
  • Matthew Richmond, Wed 25 of Jul, 2007 [02:58 UTC]: thanks Nicholas Blasgen! I haven't worked with AGI before, but there's always a first! Thanks again!
  • Nicholas Blasgen, Tue 24 of Jul, 2007 [19:18 UTC]: Matthew Richmond, AGI will handle all that for you.
  • sam, Mon 23 of Jul, 2007 [16:39 UTC]: need help - certain voicemail extension will stop working and recording voicemail on asterisk - anyone know why and how to fix it? Thanks
  • john haji, Mon 23 of Jul, 2007 [14:55 UTC]: free calls to pakistan
  • bong, Sat 21 of Jul, 2007 [19:09 UTC]: hi good day to all can anyone help me how to configured the nortel sip to the signaling server and how to activate in mobile w/ sip compatible without mcs
Server Stats
  • Execution time: 0.17s
  • Memory usage: 2.20MB
  • Database queries: 29
  • GZIP: Disabled
  • Server load: 3.08

Asterisk cmd WaitExten

Synopsis:

Waits for an extension to be entered; gives the caller the opportunity to push a new extension onto the stack

Description:

  WaitExten(seconds)
  WaitExten([seconds][|options])

Waits for the user to enter a new extension for the specified number of seconds, then returns 0. Seconds can be passed with fractions of a second. (eg: 1.5 = 1.5 seconds).

Options:

   m[(x)] - Provide music on hold to the caller while waiting for an extension.
          Optionally, specify the class for music on hold within parenthesis.

Example

This command is particularly interesting as it pushes the received extension back on to the stack and then restarts the current context. Consider:

[waitexten_example]
exten => s,1,NoOp(${TIMESTAMP} waitexten_example begins)
exten => s,2,DigitTimeout,1                             ; Initially a 1 second pause during dialing will be treated as 'finished dialing'
exten => s,3,ResponseTimeout,10                    ; 10 seconds without any digits at all is a problem...

exten => _X,1,NoOp( only got one digit. It was ${EXTEN})
exten => _X,2,SetVar(Predigits=${EXTEN})         ; Put that digit aside for use later...
exten => _X,3,Goto(s-gathermoredigits,1)

exten => s-gathermoredigits,1,NoOp( users have slow fingers - lets increase the DigitTimeout and try again)
exten => s-gathermoredigits,2,DigitTimeout,5    ; Increase the 'finished dialing' timeout to 5 seconds
exten => s-gathermoredigits,3,WaitExten(8)      ; and give the caller 8 seconds overall to do their thing

exten => _X.,1,NoOp(${TIMESTAMP} ok, now we're going to dial ${Predigits}${EXTEN})
exten => _X.,2,Dial(facility/${Predigits}${EXTEN})

With a little work we could give various DigitTimeouts to different uses of inband DTMF, such as _9 for PSTN targets.


I was not able to get the above example to work properly (it seems to be missing a Background or a WaitExten() command??)
I am not really sure why you would want to do this with WaitExten() (Unless you have a specific application for waiting for *optional*
digits to be pressed (IVR menus etc.) If you just want to prompt the user to enter some digit(s) (i.e, an extension number) it would be easier to use the Read() command for this situation.


Notes

  • The autofallthrough setting introduced in Asterisk 1.2 now defaults to 'yes' in Asterisk 1.4; if your dialplan relies on the ability to 'run off the end' of an extension and wait for a new extension without using WaitExten() to accomplish that, you will need set autofallthrough to 'no' in your extensions.conf file. If you want to set autofallthrough to 'no', you must go through your dialplan and added WaitExten() at every place where execute would run off the end of an extension and wait for another one to be dialed.
  • An examination of the source code seems to suggest that TIMEOUT(response) and TIMEOUT(digit) do not have any effect on WaitExten.


A user experience

"autofallthrough=yes" causes the ResponseTimeout() to be ignored (as far as I can tell). After running out of extensions in a context, instead of waiting the amount of time specified in ResponseTimeout() and proceeding to t, the hangup extension (h) is reached. So: In order to obtain the behavior described above, make sure that autofallthrough is not set.

Compared to the old Asterisk 1.0 way...

... there is a new option in Asterisk 1.2 called "autofallthrough" in extensions.conf that is set to yes. Asterisk 1.0 (and earlier) behavior was to wait for an extension to be dialed after there were no more extensions to execute. "autofallthrough" changes this behavior so that the call will immediately be terminated with BUSY, CONGESTION, or HANGUP based on Asterisk's best guess. If you are writing an extension for IVR, you must use the WaitExten application if "autofallthrough" is set to yes.

See also:

Asterisk | Asterisk - documentation of application commands
Asterisk cmd DISA
Created by oej, Last modification by David Chappell on Sun 29 of Apr, 2007 [15:02 UTC]

Comments Filter

consistency??

by robertm on Tuesday 05 of June, 2007 [23:32:01 UTC]
Just a comment about 'autofallthrough' & 'WaitExten'. In the notes above/below,
it says

"If you want to set autofallthrough to 'no', you must go through your dialplan and
added WaitExten() at every place where execute would run off the end of an extension
and wait for another one to be dialed."

but also in 'Compared to the old Asterisk 1.0 way...' it says

"If you are writing an extension for IVR, you must use the WaitExten application
if "autofallthrough" is set to yes."

Surely one of these statements is incorrect.

regards
rob.
Edit

Workaround

by Anonymous on Tuesday 12 of October, 2004 [03:33:57 UTC]
This example is a tone generator.
It can generate up to 4 simultaneous tones from 0 to 9999

dtmfgen_ctx
exten => s,1,Answer()
exten => s,2,SetVar(tone-no=1)
exten => *,1,Playtones(${tone1}+${tone2}+${tone3}+${tone4})
exten => #,1,SetVar(tone-no=$${tone-no} + 1)
exten => #,2,GotoIf($${tone-no} = 5?dtmfgen_ctx,*,1)
exten => i,1,SetVar(tone${tone-no}=${tone${tone-no}}${INVALID_EXTEN})
exten => i,2,NoOp(${LEN(${tone${tone-no}})})
exten => i,3,GotoIf($${LEN(${tone${tone-no}})} = 4?dtmfgen_ctx,#,1)

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2007 Arte Marketing, Inc.

Powered by bitweaver