Updated on 2023-10-12 GMT+08:00

Making a Call

Application Scenario

After successful login, the agent invokes the call interface to initiate a voice or video call.

Prerequisites

  • An agent has signed in to the CTI platform.
  • The phone account login and registration are successful.

Process Description

Invoke the startCall interface of OpenEyeCall to answer a call.
/**
* Outbound call
 */
function startCall() {
	//Distinguish anonymous calls from non-anonymous calls
	var ischecked = document.getElementById("toggle-button-anonymous").checked;
	if(ischecked){
		this.global_openEye_SDK.openEyeCall.startAnonymousCall(document.getElementById("calloutNumber").value, false, {
			response: startCallResponse
		});
	}else{
		this.global_openEye_SDK.openEyeCall.startCall(document.getElementById("calloutNumber").value, false, {
			response: startCallResponse
		});
	}
}

/**
* Response to the outbound call
 */
function startCallResponse(data) {
    if (data.result == 0) {
        console.info("StartCall success. callid="+JSON.stringify(data));
        tupCurrentCallId = data.param.callId;
    } else {
        console.error("StartCall failed. The ErrorCode is " + data.result);
        console.info(data);
        alert("StartCall failed.  The ErrorCode is " + data.result);
    }
}