Updated on 2023-03-23 GMT+08:00

Scenario 8: Joining a Meeting

Description

You can call this API to join a meeting using a meeting ID and password regardless of whether you have logged in to Huawei Cloud Meeting or not.

Service Process

When using the SDK to join a meeting, call the JoinConfById API, and implement the OnJoinConfByIdResult, OnConfState, and OnConfInfo functions.

  1. Call the API.

    1. Assemble the HwmConfAttendee data structure.
    2. Call the JoinConfById API to join a meeting. The data in preceding steps is used as input parameters.

  2. Implement the callback function.

    Implement the OnJoinConfByIdResult function.

  3. Implement the notification function.

    Implement the OnConfState function.

  4. Implement the notification function.

    Implement the OnConfInfo function.

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.
    string meetingID = CTools::UNICODE2UTF(CString("989156631"));
    string accessCode = CTools::UNICODE2UTF(CString("807766"));
    string participantName = CTools::UNICODE2UTF(CString("Hangzhou site"));
 
    hwmsdkagent::HwmJoinConfByIdInfo data;
    memset(&data, 0, sizeof(hwmsdkagent::HwmJoinConfByIdInfo));
 
    strncpy_s(data.confId, meetingID.c_str(), HWM_MAX_CONF_ID_LEN);
    strncpy_s(data.password, accessCode.c_str(), HWM_MAX_PASSWORD_LEN);
    strncpy_s(data.name, participantName.c_str(), HWM_MAX_DISPLAY_NAME_LEN);
    
    int ret = hwmsdkagent::JoinConfById(&data);
    return ret;
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/**
* Callback of the API for joining a meeting using the meeting ID
*/
void demoCallbackProc::OnJoinConfByIdResult(hwmsdk::HwmErrCode ret, const char* msg)
{
    CString codeStr;
    codeStr.Format(_T("%d"), ret);
    string msgStr = CTools::UTF82MultiByte(msg);
    CString tips = _T("OnJoinConfByIdResult code:") + codeStr + _T(", msg:") + CString(msgStr.c_str());
    AfxMessageBox(tips);
}

The OnConfState and OnConfInfo event notification scenarios are the same as the meeting creation scenario. For details, see Scenario 6: Creating a Meeting.