Setting the Network Mode
SetNetworkMode
API Description
This API is used to set the network mode to enterprise intranet access if the media nodes of Huawei Cloud Meeting are deployed in an enterprise and management nodes are accessed through the proxy of the enterprise.
This API needs to be called only when the app cannot directly access the public network (that is, when the media nodes and management nodes are deployed in the enterprise).
Precautions
- This API is optional. If it is not called, the default mode is used.
- 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 SetNetworkMode(const HwmNetWorkModeInfo* networkInfo); |
Callback Function
1
|
virtual void OnSetNetworkModeResult(hwmsdk::HwmErrCode ret, const char* reason) {}; |
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
networkInfo |
Yes |
HwmNetWorkModeInfo |
Network mode information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
accessType |
Yes |
HwmNetworkAccessType |
Network access type. |
netConnectType |
Yes |
HwmNetConnectType |
Network connection type. |
Enumerated Value |
Description |
---|---|
ACCESS_TYPE_AUTO |
Default value. Currently, the value is the same as the extranet access mode. |
ACCESS_TYPE_INNER |
Intranet access, which is used when the media and signaling nodes are deployed in the enterprise. The app uses the intranet for access. Signaling and media messages access the Huawei Cloud Meeting server through the proxy server. |
ACCESS_TYPE_OUTER |
External network access, which is used when the media and signaling nodes are not deployed in the enterprise. The app uses the Internet for access. Signaling and media messages access the Huawei Cloud Meeting server through the proxy server. |
Enumerated Value |
Description |
---|---|
NET_CONNECT_AUTO |
Automatic mode. Default value. |
NET_CONNECT_FORCE_VPN |
Forcible VPN. |
NET_CONNECT_FORCE_DIRECT |
Forcible direct connection. |
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 |
/** * Set the network mode. */ void demoSetNetworkModeDlg::SetNetworkMode() { hwmsdkagent::HwmNetWorkModeInfo networkMode{}; networkMode.accessType = hwmsdkagent::HwmNetworkAccessType::ACCESS_TYPE_AUTO; int ret = hwmsdkagent::SetNetworkMode(&networkMode); if (hwmsdk::HWM_COMMON_SUCCESS != ret) { AfxMessageBox(_T("Set network mode failed")); } } |
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