Updated on 2025-04-18 GMT+08:00

Setting the Call Answer Mode

SetAnswerType

API Description

This API is used to set the call answer mode, including original pop-up, automatic rejection, and automatic answer.

Precautions

  1. This API is optional. By default, incoming meetings are notified.
  2. This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.

Method Definition

HWM_SDK_AGENT_API hwmsdk::HwmErrCode SetAnswerType(const HwmInComingAnswerTypeInfo* inComingAnswerTypeInfo);

Callback Function

virtual void OnSetAnswerTypeResult(hwmsdk::HwmErrCode ret, const char* reason) {};

Parameter Description

Table 1 HwmInComingAnswerTypeInfo description

Parameter

Mandatory

Type

Description

type

No

HwmInComingAnswerType

Incoming call answer type.

Table 2 Enumerated values of HwmInComingAnswerType

Enumerated Value

Description

INCOMING_ANSWER_NORMAL

Use the default incoming call dialog box.

INCOMING_ANSWER_DECLINE

Reject the incoming call.

INCOMING_ANSWER_ANSWER

Answer the incoming call.

INCOMING_ANSWER_CUSTOM

Use the custom incoming call dialog box.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
/**
* Set the call answer mode.
*/
void demoSetAnswerTypeDlg::SetAnswerType()
{
    hwmsdkagent::HwmInComingAnswerTypeInfo info{};
    info.type = hwmsdkagent::HwmInComingAnswerTypeInfo::INCOMING_ANSWER_NORMAL;
    int ret = hwmsdkagent::SetAnswerType(&info);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("set answer type error"));
        return;
    }
    CDialogEx::OnOK();
}