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

startCall (Initiating a Call)

Interface Description

This interface is invoked to initiate a VoIP call.

Notes

  • An account has been registered.
  • Basic call events are configured.

Method Definition

OpenEyeCall.prototype.startCall = function(callee_num, is_video_call, callbacks)

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

callee_num

String

Mandatory

Called number. The value can contain a maximum of 255 characters.

is_video_call

Boolean

Mandatory

Call type. Set this parameter to false.

callbacks

Callback

Mandatory

Callback method.

Table 2 Callback

Parameter

Type

Mandatory/Optional

Description

response

function

Mandatory

For details about the input parameters of the callback method, see Table 3.

Table 3 Input parameters of the callback method

Parameter

Type

Description

description

String

Description of the current request.

result

Number

Query result. The value 0 indicates success and other values indicate failure.

rsp

Number

Internal message ID.

param

Param

Call information.

Table 4 Param parameter description

Parameter

Type

Description

call_id

Number

Call ID. The OpenEye automatically fills the call ID in the parameters of the callback function.

The following is an example of input parameters of the callback method:

{
   "description" : "tsdk_start_call",
   "param" : {
      "callId" : 1541472256
   },
   "result" : 0,
   "rsp" : 67537
}

Examples

var tupCurrentCallId;
function startCall() {
    global_openEye_SDK.openEyeCall.openEyeCall("70943", false, {
        response: startCallResponse
    });
}

function startCallResponse(data) {
    if (data.result == 0) {
        console.info("StartCall success. ");
        tupCurrentCallId = data.param.call_id;
    } else {
        console.error("StartCall failed. The ErrorCode is " + data.result);
        console.info(data);
    }
}