Synopsis
Waits for specified timeDescription
Wait(seconds)The Wait command takes one argument, the number of seconds to wait. During the time waited, all sound input received on the channel, including DTMF tones, are silently ignored. The Wait command is typically used before answering a channel.
If the argument is zero or a negative number, Wait does nothing.
If Wait() is run on a channel which has been hung up (i.e. from the 'h' extension), the Wait() application returns 0 immediately and no further processing of the 'h' extension priorities takes place. You can get around this with 'System(path/to/sleep Xs)', where 'X' is the number of seconds to wait. Nasty, but it works.
How to Accept DTMF Keypresses While Waiting
The Wait command will ignore any DTMF input from buttons pressed by callers on the line. If you want to accept DTMF input while waiting, set the wait time by calling ResponseTimeout and do not define a step at the next highest priority. Asterisk will silently wait up to ResponseTimeout seconds for the user to dial an extension number valid in the current context.Return Code
Wait normally returns 0, or -1 if interrupted.Example
This example will wait 30 seconds (typically about 6-7 rings) before answering the channel.exten => s,1,Wait(30)
exten => s,2,Answer
See also
- WaitExten
- ResponseTimeout
- DigitTimeout
- AbsoluteTimeout
- Wait and Timeouts.pdf Waits and Timeouts explained
- Asterisk cmd WaitForSilence
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Comments
333Re: Wait() not waiting?
333Wait() not waiting?
[default]
exten => s,1,Set(LANGUAGE()=fr)
include => zone1
exten => s,n,Noop
[zone1]
;exten => s,1,Set(TIMEOUT(digit)=2)
exten => s,1,Wait(30)
exten => s,n,Answer
exten => s,n,BackgroundDetect(custom/welcome)
; continuing ...
I want the phone to ring around 4 times before Asterisk Answer()s, but the Wait() command doesn't seem to wait 30 seconds at all. No matter how many seconds I specify, Asterisk answers during the second ring, always. Is there something I overlook? Thanks!