disconnectΒΆ

class UASCallChannel
disconnect()

Disconnect two call channels which were previously connected using connect()

An existing connection between the two call channels will be broken.

If the local call channel state is IDLE, this function will raise a Hangup exception (the connection will have been automatically broken).

If there is no connection to break because the remote call has gone to IDLE, this function will simply return True. But, if there is no connection to break because no connection was ever made, or disconnect has already been called, an Error exception will be raised.

This function will block until confirmation has been received that the call channels are disconnected, or that the disconnect has failed, or a timeout has expired.

This function will return True if successful, otherwise False.

Usage example:

if channel.disconnect() is False:
    print("could not disconnect the calls")