answerΒΆ
- class UASCallChannel
- answer(codecs=None)
Answer a call.
- Optional arguments:
- codecs
the codecs to offer on this call. Default is None (use the default).
The list of codecs offered by the incoming call can be retrieved by looking at
Detailsafter an incoming call has been detected. One or more of these codecs can be chosen and offered here in a semi-colon delimited list (in priority order) of codec names; for example,g711a;g711u.This function should be called when the call state is
CALL_INCOMINGorRING_INCOMING. If, when the function is called, the call state isIDLE, it will raise aHangupexception; otherwise, if called whilst in an inappropriate state, this function will raise anErrorexception.This function will block until the call is in the
ANSWEREDstate (which is normally only an extremely short delay), a timeout has been reached, or the call state has returned toIDLE. If the call does timeout, the call will be abandoned. If the call state returns toIDLE, aHangupexception will be raised.This function will return the current call state.
Usage example:
state = channel.answer() # answer the call if state != channel.State.ANSWERED: raise Hangup('state is {0}'.format(state))