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

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

  1. This API is optional. If it is not called, the default mode is used.
  2. 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
IHwmNetwork.getInstance().setNetworkMode(networkInfo) 

Parameter Description

Table 1 NetWorkModeInfo description

Parameter

Mandatory

Type

Description

networkInfo

Yes

NetWorkModeInfo

Network mode information.

Table 2 NetWorkModeInfo parameter description

Parameter

Mandatory

Type

Description

accessType

Yes

NetWorkAccessType

Network access type.

Table 3 Enumerated values of NetworkAccessType

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.

Table 4 Return value

Value

Description

int

If 0 is returned, the operation is successful. If other values are returned, the operation fails.

Sample Code

1
2
3
NetWorkModeInfo netWorkModeInfo = new NetWorkModeInfo();
netWorkModeInfo.setAccessType(NetworkAccessType.enumOf(NetworkAccessType.ACCESS_TYPE_AUTO));
NativeSDK.getNetworkApi().setNetworkMode(netWorkModeInfo);