Updated on 2024-07-30 GMT+08:00

Joining a Meeting

JoinConfById

API Description

This API is used to join an existing meeting by using the meeting ID and password.

Precautions

  1. This API can be called regardless of whether you have logged in.
  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

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode JoinConfById(HwmJoinConfByIdInfo *joinConfByIdInfo);

Callback Function

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

Parameter Description

Table 1 HwmJoinConfByIdInfo description

Parameter

Mandatory

Type

Description

confId

Yes

char[]

Meeting ID.

password

No

char[]

Meeting password. To join a meeting as a host, pass the host password. To join a meeting as a guest, pass the guest password or leave it empty if the meeting is password-free.

name

No

char[]

Display name in the meeting. If you have logged in, this parameter can be left blank. In such a case, the login username is used as the display name in the meeting. To join a meeting anonymously, you must enter this name or set the participant name in advance.

isCloseSpk

No

bool

Whether to disable the speaker. Enter true to disable the speaker or false to enable it.

isStopConflictConf

No

bool

Used to forcibly end a meeting that conflicts with the current cloud meeting room. (Only the owner of the cloud meeting room resource has the permission.)

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
13
14
15
16
17
18
// Join a meeting using the meeting ID.
int demoJoinConfByIdDlg::clickJoinConfById()
{
    // Enter the meeting ID and meeting password. You can specify your display name in the meeting regardless of whether you have logged in or not.
    hwmsdkagent::HwmJoinConfByIdInfo data;
    memset(&data, 0, sizeof(hwmsdkagent::HwmJoinConfByIdInfo));
 
    strncpy_s(data.confId, GetMeetingID().c_str(), HWM_MAX_CONF_ID_LEN);
    strncpy_s(data.password, GetAccessCode().c_str(), HWM_MAX_PASSWORD_LEN);
    strncpy_s(data.name, GetParticipantName().c_str(), HWM_MAX_DISPLAY_NAME_LEN);
    data.isCloseSpk = false;
    
    // Enable or disable the microphone and camera.
    int ret = EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_MIC_SWITCH, true);
    ret = EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_CAM_SWITCH, false);
    ret = hwmsdkagent::JoinConfById(&data);
    return ret;
}

Before joining a meeting, you can call EnableFeature to change the microphone and camera status.