Manage network services
Это содержимое пока не доступно на вашем языке.
A network service is a protocol and transport the switch accepts traffic on, such as SIP over UDP or HTTPS, with its list of listeners. These methods do the same as the Network Services screen under System Parameters.
The methods support trusted mode with i_customer set to 1.
Listener structure
Section titled “Listener structure”A listener is one address the service listens on.
| Name | Type | Description |
|---|---|---|
ip_address |
string | IP address of the switch, for example 192.0.2.10 |
port |
int | Port, for example 5060 |
i_proto_transport identifies the service. The values the panel manages are below; the full list is the proto_transports dictionary.
i_proto_transport |
Service |
|---|---|
1 |
SIP over UDP |
4 |
SIP over TCP |
5 |
SIP over TLS |
7 |
HTTPS |
updateNetworkService
Section titled “updateNetworkService”Replaces the listeners of a network service.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_proto_transport |
int | yes | The service to change |
listeners |
array | yes | The new listeners in order, each a listener structure. The list replaces the current one |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
i_proto_transport |
int | The service changed |
Example
Section titled “Example”call("updateNetworkService", { "i_proto_transport": 1, "listeners": [ {"ip_address": "192.0.2.10", "port": 5060}, {"ip_address": "198.51.100.10", "port": 5060}, ],}){"result": "OK", "i_proto_transport": 1}getNetworkServiceInfo
Section titled “getNetworkServiceInfo”Returns one network service.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_proto_transport |
int | yes | The service to read |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
i_proto_transport |
int | The service |
listeners |
array | Its listeners in order, each a listener structure |
Example
Section titled “Example”call("getNetworkServiceInfo", {"i_proto_transport": 7}){ "result": "OK", "i_proto_transport": 7, "listeners": [{"ip_address": "192.0.2.10", "port": 443}],}getNetworkServicesList
Section titled “getNetworkServicesList”Returns all network services.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
limit |
int | no | Maximum number of services to return |
offset |
int | no | Number of services to skip |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
network_services |
array | One struct per service, as getNetworkServiceInfo returns it |
Example
Section titled “Example”call("getNetworkServicesList", {}){ "result": "OK", "network_services": [ {"i_proto_transport": 1, "listeners": [{"ip_address": "192.0.2.10", "port": 5060}]}, {"i_proto_transport": 7, "listeners": [{"ip_address": "192.0.2.10", "port": 443}]}, # … one struct per service ],}