Help Center> Meeting> Client SDK Reference> Windows SDK> Typical Scenarios> Scenario 3: Scheduling a Meeting
Updated on 2023-03-23 GMT+08:00

Scenario 3: Scheduling a Meeting

Description

After logging in to the system using a Huawei Cloud Meeting account, you can call the meeting scheduling API to schedule a meeting. When scheduling the meeting, you can add participants in addition to setting mandatory meeting parameters.

Service Process

Call the BookConf API to schedule a meeting and then implement the OnBookConfResult and OnConfList functions.

To schedule a meeting using a personal meeting ID or a cloud meeting room, call the GetVmrList API to query the personal meeting ID and cloud meeting room information, and then process the data returned by the OnGetVmrList function. The data can be used to schedule the meeting.

  1. Call the API.

    1. Assemble the HwmBookConfParam data structure (including HwmAttendeeInfo).
    2. Call the BookConf API to schedule a meeting. The data in the preceding step is used as input parameters.

  2. Implement the callback function.

    Implement the OnBookConfResult function.

  3. Implement the notification function.

    Implement the OnConfList function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Schedule a meeting.
*/
int CdemoBookConfDlg::OnBnClickedBookConf()
{
    hwmsdkagent::HwmBookConfParam data = {0};

    string confSubject = u8"My scheduled meeting"; // The value must be a UTF-8 character string.
    strncpy_s(data.subject, confSubject.c_str(), HWM_MAX_SUBJECT_LEN);
    data.confType = hwmsdkagent::HwmConfMediaType::HWM_VIDEO_AND_DATA;
    data.isNeedConfPwd = true;
    data.isRecordOn = false; // Recording is disabled by default.
    data.isAutoRecordOn = false; // Automatic recording is disabled by default.
    data.startTime = 1598398920; // UTC timestamp, in seconds. If the obtained time is the local time, the time needs to be converted to the UTC time.
    data.duration = 30; // Meeting duration, in minutes
    data.timeZone = 56; // Time zone. The value 56 indicates GMT+08:00.
    data.joinConfRestrictionType = hwmsdkagent::HwmJoinConfPermissionType::RESTRICTION_CALL_IN_ALL;
    
    std::vector<hwmsdkagent::HwmAttendeeInfo> attendeeList;
    // Participants to invite
    hwmsdkagent::HwmAttendeeInfo attendeeInfo = { 0 };
    string attName = "Mike";
    string attNumber = "+991116003543";
    string attEmail = "";
    string attSms = "";
    string attUserId = "";
    strncpy_s(attendeeInfo.name, attName.c_str(), HWM_MAX_USER_NAME_LEN);
    strncpy_s(attendeeInfo.number, attNumber.c_str(), HWM_MAX_NUMBER_LEN);
    strncpy_s(attendeeInfo.email, attEmail.c_str(), HWM_MAX_EMAIL_LEN);
    strncpy_s(attendeeInfo.sms, attSms.c_str(), HWM_MAX_PHONE_NUM_LEN);
    strncpy_s(attendeeInfo.thirdUserId, attUserId.c_str(), HWM_MAX_USER_ID_LEN);
    attendeeInfo.isMute = true;
    attendeeInfo.isAutoInvite = true;
    attendeeList.push_back(attendeeInfo);
 
    data.attendees = attendeeList.data();
    data.attendeeLen = attendeeList.size(); 
    data.isSmsOn = true;
    data.isMailOn = true;
    data.isEmailCalendarOn = true;
    return hwmsdkagent::BookConf(&data);
}

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Meeting list notification
*/
void demoNotifyProc::OnConfList(HwmConflistUpdateType updateType, const HwmConfListInfo* confInfoList, unsigned int confInfoLen)
{
    if (confInfoLen <= 0 || confInfoList == nullptr)
    {
        return;
    }
    // Return the meeting list after successful login.
    if (updateType == CONFLIST_UPDTAE_ALL)
    {
        // Process the meeting list.
    }
    else
    {
        if (updateType == CONFLIST_UPDATE_ADD)
        {
            // Process the new meeting or the edited meeting.
        }
        else if (updateType == CONFLIST_UPDATE_DELETE)
        {
            // Process the canceled meeting.
        }
    }
 
    CString tips = _T("OnConfList");
    for (int i = 0; i < confInfoLen; i++)
    {
        CString strConfId = CTools::UTF2UNICODE(confInfoList->confId);
        CString strConfSubject = CTools::UTF2UNICODE(confInfoList->confSubject);
        CString tip = _T(", confId:") + CString(strConfId)
            + _T(", subject:") + CString(strConfSubject);
        tips += tip;
        confInfoList++;
    }
    AfxMessageBox(tips);
}