Help Center/ Meeting/ Client SDK Reference/ Windows SDK/ API Reference/ Meeting Control/ Configuring Automatic Answering for Incoming Calls
Updated on 2024-07-30 GMT+08:00

Configuring Automatic Answering for Incoming Calls

SetConfIncomingAnswerResult

API Description

This API is used to configure whether to automatically reject or answer incoming calls.

Precautions

  1. This API can be called (in the OnConfIncoming API) only when a meeting call is received.
  2. This API is used to set the answer type, including dialog box selection, rejection, and answer.
  3. 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.

    If the incoming call is automatically rejected, the Config API needs to be called to set isHideConfIncomingWindow to TRUE after the initialization.

    When the call needs to be rejected, SetCallIncomingAnswerResult is set to HWM_INCOMING_ANSWER_DECLINE. When the call needs to be answered in a pop-up window, SetCallIncomingAnswerResult is set to HWM_INCOMING_ANSWER_NORMAL.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode type(HWMInComingAnswerType type);

Callback Function

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

Parameter Description

Table 1 Enumerated values of HWMInComingAnswerType

Enumerated Value

Description

HWM_INCOMING_ANSWER_NORMAL

Use the default dialog box to select an answering mode.

HWM_INCOMING_ANSWER_DECLINE

Reject an incoming call.

HWM_INCOMING_ANSWER_ANSWER

Answer an incoming call.

Return Values

Table 2 Return values

Type

Description

HwmErrCode

If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
/**
* Reject a meeting call.
*/
void demoConfCtrlDlg::OnBnClickedSetConfIncomingAnswerResult()
{
    hwmsdkagent::HWMInComingAnswerType type = HWM_INCOMING_ANSWER_DECLINE;
    int ret = hwmsdkagent::SetConfIncomingAnswerResult(type);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("SetConfIncomingAnswerResult error"));
    }
}