Scenario 3: Scheduling a Meeting
Description
After logging in to Huawei Cloud Meeting using an account, you can 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.
- Call the API.
- Assemble the HwmBookConfParam data structure (including HwmAttendeeInfo).
- Call the BookConf API to schedule a meeting. The data in the preceding step is used as input parameters.
- Implement the callback function.
Implement the OnBookConfResult function.
- 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 |
/** * 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; // By default, automatic recording is disabled. 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 }; strncpy_s(attendeeInfo.name, GetAttName().c_str(), HWM_MAX_USER_NAME_LEN); strncpy_s(attendeeInfo.number, GetAttNumber().c_str(), HWM_MAX_NUMBER_LEN); strncpy_s(attendeeInfo.email, GetAttEmail().c_str(), HWM_MAX_EMAIL_LEN); strncpy_s(attendeeInfo.sms, GetAttSms().c_str(), HWM_MAX_PHONE_NUM_LEN); strncpy_s(attendeeInfo.thirdUserId, GetAttUserId().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 API for scheduling a meeting */ 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); } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot