wait for idle¶
- class UASCallChannel¶
- wait_for_idle(seconds_timeout=120)¶
Wait until the call has returned to IDLE.
- Optional arguments:
- seconds_timeout
time allocated to wait for the call to go to IDLE. Default is 120 seconds.
This function will block until the call state has returned to
IDLE
, or the timeout has expired.This function will not raise a
Hangup
exception.This function will return the call state. If the returned value is not
IDLE
, the timeout has occurred.Setting
seconds_timeout
to None will allow an infinite wait.Usage example:
# reject the call with BUSY and then wait for IDLE if channel.reject(cause=channel.Cause.BUSY) != channel.State.IDLE: # wait for channel to go to idle channel.wait_for_idle()