retrievable transfer¶
- class UASCallChannel
- retrievable_transfer(other_call, call_to=None, call_from='', ringback_tone=None, seconds_timeout=120)
- Perform a retrievable transfer to a new outbound call. - Required argument:
- other_call
- the call channel instance to be used for the outbound leg. 
 
- call_to
- the target for the transfer. 
 
 
- Optional arguments:
- ringback_tone
- the ringback tone to play when the outbound leg is ringing. Default is RINGBACK. 
 
- seconds_timeout
- the amount of time to allow for the transfer to be accomplished. Default is 120 seconds. None means no timeout. 
 
- call_from
- The remote address of the call being transferred. 
 
 
 - This function is used to transfer a connected call channel to another destination. This function will allow the application to retain control over the call channel and retrieve it when the transfer is no longer required - for example, when the far end hangs up. - The argument - other_callis the call channel instance used for the transfer’s outbound leg. This call channel must be in the- IDLEstate.- An originating address - call_frommay be supplied. Setting this parameter to an empty string will result in a default value being used.- The primary channel must be in - ANSWEREDstate. If it is- IDLE, this function will raise a- Hangupexception; otherwise, if it is not- ANSWEREDit will raise an- Errorexception.- The argument - ringback_toneis the ringback tone to play when the outbound call channel is in the- RING_OUTGOINGstate. Valid options for- ringback_toneare listed in the server’s ToneManager resource. If- ringback_toneis- Nonea default tone will be used. For the channel to play a tone it must have a tone player object. It is essential that a tone player is created on the channel before a transfer is attempted.- The argument - seconds_timeoutis the amount of time allowed for the transfer to be completed. If the timeout is None, no time limit will be imposed.- When successfully transferred in this manner, this call channel will be in the - TRANSFERREDstate.- If unsuccessful, the cause of the failure can be retrieved from transfer_cause() function. - After the transfer has completed successfully, this channel cannot be used to play or record audio (the audio path is no longer available, it has been transferred), it can be used only to hang up the call or to call either the retrieve_transferred_call function or the wait_for_transferred_call_retrieval function. - This function will block until confirmation has been received that the channel has been transferred, or that the transfer request has failed, or a timeout has expired. - This function will return the channel state. - Usage example: - state = channel.retrievable_transfer(other_call, 'sip:3301@127.0.0.1:5060;user=phone') if state != channel.State.TRANSFERRED: cause = channel.transfer_cause() print("could not transfer the call, reason is {0}".format(cause))