This topic discusses attended, supervised, and unattended call transfers for a two-party audio/video conversation.
Note: |
---|
Only the AudioVideoCallclass supports call transfer functionality. |
The process of a call transfer involves three participants:
- The Transferor is the participant who initiates the transfer.
- The Transferee is the participant who is transferred from the
primary call to the transferred call.
- The Transfer Target is the participant to whom the Transferee
is transferred.
After the primary call is established, either participant can transfer the call. To accomplish a transfer, the Transferor sends a REFER message to the Transferee, causing the Transferee to send an INVITE to the Transfer Target participant.
Attended Transfer
The platform monitors the progress of an attended transfer and completes the transfer only after receiving a successful REFER notification. The following code demonstrates an attended call transfer (also known as a basic transfer).
Copy Code | |
---|---|
CallTransferOptions basicTransferOptions = new CallTransferOptions(CallTransferType.Attended); m_call.BeginTransfer(target, basicTransferOptions, userCallback, state); |
Supervised Transfer
For a supervised transfer, the REFER message contains a Replacesheader that specifies the call to be replaced. The following code demonstrates a supervised call transfer.
Note: |
---|
Because the default CallTransferTypeis Attended, call transfers of this type can pass nullas the second parameter of the BeginTransfercall. |
Copy Code | |
---|---|
CallTransferOptions supervisedTransferOptions = new CallTransferOptions(CallTransferType.Attended); m_call.BeginTransfer(callToReplace, supervisedTransferOptions, userCallback, state); |
Unattended Transfer
For an unattended transfer, the platform completes the transfer and terminates the primary call immediately after receiving a “REFER Accepted” message from the Transferee. At this time, the Transferee has already sent an INVITE to the Transfer Target specified by the REFER message, and must independently go through the process of establishing a new call with the Transfer Target. The platform terminates the primary call without waiting for an INVITE success or failure notification from the Transfer Target. The following code demonstrates the unattended transfer (also known as a blind transfer).
Copy Code | |
---|---|
CallTransferOptions blindTransferOptions = new CallTransferOptions(CallTransferType.UnAttended); m_call.BeginTransfer(target, blindTransferOptions, userCallback, state); |
Call Base Class Transfer Methods
The Callbase class exposes protected methods to handle the incoming transfer and monitor the progress of the transfer. Derived classes can support transfer functionality by overriding the methods and exposing the event handler to the application.
Copy Code | |
---|---|
//Transfer-related methods exposed on the Call base class public abstract class Call { protected abstract void HandleTransferReceived(CallTransferReceivedData e); protected abstract void HandleTransferNotification(ReferStateChangedEventArgs e); protected IAsyncResult BeginTransfer( Call callToReplace, CallTransferOptions callTransferOptions, AsyncCallback userCallback, object state); protected IAsyncResult BeginTransfer( string targetUri, CallTransferOptions callTransferOptions, AsyncCallback userCallback, object state) ; … } |