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

Scenario 4: Editing a Meeting

Description

After a meeting is scheduled, you can use the meeting modification API to edit the meeting details and add participants.

Service Process

To edit a meeting after obtaining the meeting list, call the GetConfDetail API to query the meeting details, implement the OnGetConfDetail callback function, call the EditConf API to modify the meeting details, and implement the OnEditConfResult and OnConfList functions.

  1. Obtain meeting details.

    1. Call the GetConfDetail API.

  2. Implement the callback function.

    Implement the OnGetConfDetail function to obtain the meeting details.

  3. Call the API for editing the meeting.

    1. Use the data obtained in 2 to assemble the HwmEditConfParam data structure (including HwmAttendeeInfo).
    2. Call the EditConf API. The data in 1 is used as input parameters.

  4. Implement the callback function.

    Implement the OnEditConfResult function.

  5. Implement the notification function.

    Implement the OnConfList function.

Sample Code

1
2
3
4
5
6
7
8
/**
* Obtain meeting details.
*/
int demoEditConfDlg::GetConfDetail()
{
    int ret =hwmsdkagent::GetConfDetail(GetConfID()); // Use the meeting ID to query meeting details.
    return ret;
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
/**
* Implement the meeting details callback function.
*/
void demoCallbackProc::OnGetConfDetail(hwmsdk::HwmErrCode ret, const char* reason, const HwmConfDetail* confDetail)
{
    if (confDetail == nullptr)
    {
        return;
    }
    // The code for caching meeting details is omitted here.
    CString codeStr;
    codeStr.Format(_T("%d"), ret);
    string msgStr = CTools::UTF82MultiByte(msg);
    CString tips = _T("OnGetConfDetail 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
/**
* Edit a meeting.
*/
int demoEditConfDlg::EditConf()
{
    hwmsdkagent::HwmConfDetail confDetail{0}; // Obtain meeting details from the cache and assign them to confDetail.
    hwmsdkagent::HwmEditConfParam editConfParam{ 0 };
    // Copy the confDetail data as required.
    strncpy_s(editConfParam.confId, confDetail.confListInfo.confId, HWM_MAX_CONF_ID_LEN);
    editConfParam.vmrFlag = confDetail.vmrFlag;
    strncpy_s(editConfParam.vmrId, confInfo.vmrId, HWM_MAX_VMR_CONF_ID_LEN);
    // Part of the value assignment code is omitted here.
    editConfParam.timeZone = 56; // Local time zone. The value 56 indicates GMT+08:00.
    editConfParam.isRecordOn = false; // Recording is disabled by default.
    editConfParam.isAutoRecordOn = false; // Automatic recording is disabled by default.
    editConfParam.startTime = 1598398920; // UTC timestamp
    editConfParam.duration = 0 * 60 + 30;// Meeting duration
    editConfParam.joinConfRestrictionType = hwmsdkagent::HwmJoinConfPermissionType::RESTRICTION_CALL_IN_ALL; // Obtain types of users who are allowed to join the meeting.
    return hwmsdkagent::EditConf(&editConfParam);
}

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

The OnConfList event notification scenario is the same as the meeting scheduling scenario. For details, see Sample Code.