Make a call to an inbound service name.
This is the function used to place an outbound call to one of your existing inbound services. call_to must be a valid inbound service name; for example MyVoicemailRecorder.
An originating address call_from may be supplied. Setting this parameter to an empty string will result in a default value being used.
If seconds_timeout is not None, a timeout will apply for making the call. The call is abandoned if the timeout is reached and the call has not been made. The default is 120 seconds.
codecs is an optional parameter to specify a semi-colon delimited list (in priority order) of codecs to offer for the call; for example, g711a;g711u.
This function will block until the call has been answered, the timeout has been reached, or the call state has returned to IDLE.
This function should be called when the call state is IDLE; otherwise, it will raise an Error exception.
This function will return the current call state.
Usage example:
state = channel.call_inbound_service('MyVoicemailRecorder', call_from='bob@1234')
if state != channel.State.ANSWERED:
# check whether the call was rejected due to BUSY
cause = channel.cause()
if cause == channel.Cause.BUSY:
# do something here for busy calls
pass
else:
# the call has been answered, carry on
pass