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

setAnswerWay (Setting the Answering Mode)

Interface Description

This interface is invoked to set the answering mode (automatic hang-up, automatic answering, or do-no-disturb).

Notes

The WebSocket connection with the OpenEye is set up.

Method Definition

OpenEyeCall.prototype.setAnswerWay = function(answerWay, times, callbacks)

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

answerWay

String

Mandatory

Answering mode. The options are 1 (automatic hang-up), 2 (automatic answering), and 4 (do-no-disturb).

times

Number

Mandatory

Interval for the answering mode to take effect. (For do-not-disturb, this parameter is invalid and optional.)

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.

errMsg

String

Error information.

The following is an example of input parameters of the callback method:
{
    description: "SetAnswerWay",  
    result: 0,
    rsp: 67767,
    errMsg: ""
}

Examples

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);
    }
}