Wait for an outbound call to be answered.
This is the function used to wait for an outbound call, which was started using the start_call function, to go to the ANSWERED or RING_OUTGOING (if return_on_ringing is True) state.
This function will block until the call has been connected, the timeout has been reached, or the call state has returned to IDLE. If seconds_timeout is None, this function will not time out.
This function should be called when the call state is CALL_OUTGOING, however, it is also safe to call it if the state is ANSWERED or RING_OUTGOING; if the state is IDLE this function will raise a Hangup exception; any other state will cause this function to raise an Error exception.
This function will return the current call state.
Usage example:
if channel.start_call('sip:3301@127.0.0.1:5060;user=phone') is True:
# do some other processing
if channel.wait_for_outgoing_call() != channel.State.ANSWERED:
# not answered, could be timeout or IDLE
pass