Avaya Client SDK

< Back to Package Overview

Third party call control for video calls

Overview

Computer telephony integration (CTI, or third party call control 3PCC) is a technology that enables applications to interact with telephones. Avaya Aura Application Enablement Services (AES) implement CTI and allow third party applications to monitor and control SIP endpoints including your Client SDK based application.

Third party applications can use the Telephony Services Application Programming Interface (TSAPI) to access the full complement of the third-party call control capabilities available on Avaya Aura Communication Manager (CM). TSAPI is a public interface to the TSAPI service resident on AES acting as an access server.

Client SDK can receive and handle 3PCC requests to:

  • Place an outgoing call;
  • Answer an incoming call;
  • Put an existing call on hold;
  • Un-hold a held call;
  • Redirect an incoming call to another endpoint;
  • Transfer a call to another endpoint;
  • Make a conference call;
  • Drop user from a conference call;
  • End a call;
  • etc.

Handling 3PCC requests

Client SDK handles the most of 3PCC commands automatically without application involvement. There are only two 3PCC commands which require handling in your application: make video call and answer video call.

Video call establishment requires your application to prepare video devices and video rendering surface, and requires your application to respond to 3PCC requests to accept or start a video call.

To handle these requests your application shall subscribe the following events provided by CallService:

  • CallStartRequested occurs when your application is requested to start a video call;
  • CallAcceptRequested occurs when your application is requested to answer an incoming video call.

Requested video direction is provided as the argument of video call request. Your application may choose to not apply requested video direction due to missing resources and may change video direction according to available resources.

For example, your application receives 3PCC request to start a video call with SendReceive video mode, but the device does not have a camera plugged in. In this case your application shall update video direction of the call to ReceiveOnly, prepare video rendering surface and finally start the call.

All the other 3PCC commands including start or accept audio-only call are handled by Client SDK automatically using the user-selected (or default) microphone and playback devices.

private void OnCallServiceCallStartRequested(object sender, 
    StartCallRequestEventArgs e)
{
    Log("OnCallServiceCallStartRequested. Video mode {0}", 
        e.VideoMode.ToString());
    Call call = e.Call;
    VideoMode updatedVideoMode = 
        FilterRemotelyControlledVideoMode(e.Call, e.VideoMode);

    // Place here code to initialize video resources 
    // (e.g., video rendering surface, camera, etc.)

    call.SetVideoMode(updatedVideoMode,
        (CallFailureException error) => 
        { 
            if (error != null)
            {
                call.Start();
            }
            else
            {
                Log("SetVideoMode failed. Reason:{0}", error.Reason.ToString());
            }
        });
}

private void OnCallServiceCallAcceptRequested(object sender, 
    UccVideoCallEventArgs e)
{
    Log("OnCallServiceCallAcceptRequested. Video mode {0}", 
        e.VideoMode.ToString());
    Call call = e.Call;
    VideoMode updatedVideoMode = 
        FilterRemotelyControlledVideoMode(e.Call, e.VideoMode);

    // Place here code to initialize video resources 
    // (e.g., video rendering surface, camera, etc.)

    call.SetVideoMode(updatedVideoMode,
        (CallFailureException error) => 
        { 
            if (error != null)
            {
                call.Accept();
            }
            else
            {
                Log("SetVideoMode failed. Reason:{0}", error.Reason.ToString());
            }
        });
}

If the place or answer call request is for a bidirectional video, but the local camera device cannot be initialized, your client application should proceed with establishing a receive-only video call by first calling Call.SetVideoMode(VideoMode.ReceiveOnly), and then calling Call.Start() or Call.Accept().

If, for some reason, your client application is unable to create a receive-only video call, you should proceed with creating an audio-only call, by first calling Call.SetVideoMode(VideoMode.Disable), and then calling Call.Start() or Call.Accept().

At the final step, add the created event handlers to CallService instance.

callService.CallStartRequested += OnCallServiceCallStartRequested;
callService.CallAcceptRequested += OnCallServiceCallAcceptRequested;