更新时间:2024-03-01 GMT+08:00
分享

acceptCall(接听呼叫)

接口描述

收到呼入事件后,可使用该接口接听呼叫 。

注意事项

收到呼入事件

方法定义

OpenEyeCall.prototype.acceptCall = function(callid, is_video_call, callbacks) 

参数描述

表1 参数说明

参数名

类型

可选/必选

描述

callid

Number

必选

呼叫ID,由上onCallIncoming上报。

is_video_call

Number

必选

是否为视频呼叫,由onCallIncoming上报。

callbacks

Callback

必选

回调方法。

表2 Callback

参数名

类型

可选/必选

描述

response

function

必选

回调方法的入参请参考表3

表3 回调方法的入参

参数名

类型

描述

description

String

当前请求描述。

result

Number

查询结果。0表示成功,其他表示失败。

rsp

Number

内部消息编号。

回调方法的入参示例:

{
   "description" : "tsdk_accept_call",
   "result" : 0,
   "rsp" : 67538
}

使用示例

function acceptCall() {
    global_openEye_SDK.openEyeCall.acceptCall(1917517824, 0, { response: onAcceptCallReponse });
}

function onAcceptCallReponse(data) {
    if (data.result == 0) {
        console.error("AcceptCall success. ");
    } else {
        console.error("AcceptCall failed. The ErrorCode is " + data.result);
        console.info(data);
    }
}
分享:

    相关文档

    相关产品