login | register
Wed 19 of Nov, 2008 [15:12 UTC]

voip-info.org

Discuss [1] History

Asterisk func timeout

Created by: murf,Last modification on Mon 11 of Jun, 2007 [17:23 UTC] by Luxvero

Synopsis:

 Gets or sets timeouts on the channel.

Description:

 TIMEOUT(timeouttype)
 
Gets or sets various channel timeouts. The timeouts that can be
manipulated are:

absolute: The absolute maximum amount of time permitted for a call. A
          setting of 0 disables the timeout.

digit: The maximum amount of time permitted between digits when the
         user is typing in an extension.  When this timeout expires,
         after the user has started to type in an extension, the
         extension will be considered complete, and will be
         interpreted.  Note that if an extension typed in is valid,
         it will not have to timeout to be tested, so typically at
         the expiry of this timeout, the extension will be considered
         invalid (and thus control would be passed to the 'i'
         extension, or if it doesn't exist the call would be
         terminated).  The default timeout is 5 seconds.

response: The maximum amount of time permitted after falling through a
          series of priorities for a channel in which the user may
          begin typing an extension.  If the user does not begin typing an
          extension in this amount of time, control will pass to the
          't' extension if it exists, and if not the call would be
          terminated. Once the user begins to type an extension Asterisk
          will wait for digit timeout to be reached and response timeout has
          no effect. The default timeout is 10 seconds.

Notes

  • This function may be both read from and written to.
  • If dialplan execution runs out of priorities to execute and autofallthrough (introduced in Asterisk 1.2) is 'yes' (the default in Asterisk 1.4), then you must call WaitExten() when you want to allow the user to enter a new extension, otherwise Asterisk will terminate the call. If you set autofallthrough to 'no', then Asterisk will wait for the user to dial a new extension and the wait time will be controlled by these timeouts.


Used By


TIMEOUT(digit) and TIMEOUT(response) are consulted by the following dialplan commands (applications):

  • DISA()
  • Read() — timeout parameter will override TIMEOUT(response) and TIMEOUT(digit), if soundfile is played, only TIMEOUT(response) is used
  • WaitExten() — timeout parameter will override TIMEOUT(response)

TIMEOUT(digit) and TIMEOUT(response) are consulted by the following AGI commands:

  • get option (uses only TIMEOUT(digit) and only if the timeout parameter is 0)

Return value

Returns the length of the given timeout in seconds.

Examples


 exten => s,1,Set(foo=${TIMEOUT(digit)})

 exten => s,1,Set(TIMEOUT(absolute)=5)

See also



Comments

Comments Filter
222

333Response timeout, uncertain behavior?

by Luxvero, Monday 11 of June, 2007 [17:29:56 UTC]
I have read missmatching information about "response timeout", some say it is the TOTAL time Asterisks waits, but at least in v1.2.14 that is not the case, if digit=5 and response=2, Asterisk will timeout if you don't do anything in 2 seconds, but if you press 1 key it will wait for 5 seconds, surpassing the 2 seconds for resp. timeout.