setAnswerWay(设置接听方式)
接口描述
设置接听方式(自动挂断、自动接听、免打扰)。
注意事项
已经建立与OpenEye的WebSocket连接。
方法定义
OpenEyeCall.prototype.setAnswerWay = function(answerWay, times, callbacks)
参数描述
|
参数名 |
类型 |
可选/必选 |
描述 |
|---|---|---|---|
|
answerWay |
string |
必选 |
1:自动挂断,2:自动接听,4:免打扰 |
|
times |
Number |
必选 |
对应接听方式作用的时间间隔(免打扰设置无效,可选) |
|
callbacks |
必选 |
回调方法。 |
{
description: "SetAnswerWay",
result: 0,
rsp: 67767,
errMsg: ""
}
使用示例
function setAnswerWay(answerWay, times){
this.global_openEye_SDK.openEyeCall.setAnswerWay(answerWay, times, { response: onSetAnswerWayResponse });
}
function onSetAnswerWayResponse(data){
console.log(data);
if (data.result == 0) {
console.info("SetAnswerWay Success");
} else {
console.error("SetAnswerWay failed. The ErrorCode is " + data.result + ";errMsg:" + data.errMsg);
alert("SetAnswerWay failed. The ErrorCode is " + data.result + ";errMsg:" + data.errMsg);
}
}