call termination causeΒΆ

class UASCallChannel
UASCallChannel.cause()

Return the latest call cause.

Usage example:

# place a call. If it does not return ANSWERED try again if the
# cause is BUSY
state = channel.call('sip:3301@127.0.0.1:5060;user=phone')
if state != channel.State.ANSWERED:
    if channel.cause() == channel.Cause.BUSY:
        # call is busy, wait a minute then try again
        time.sleep(60)
        state = channel.call('sip:3301@127.0.0.1:5060;user=phone')

Previous topic

state

Next topic

connect