Edit WebSocket Audio Streaming Setting
Edit the WebSocket audio streaming settings, including WebSocket server URL, sample rate of transmission, subscription objects, and so on.
Request URL
POST {base_url}/{api_path}/websocketaudiostream/update?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| enable | No | Integer | Whether to enable WebSocket Audio Streaming feature. Valid value:
|
| websocket_url | No | String | WebSocket server address for receiving audio streams. For example, ws://docs.example.cloud.com:8080. Note:The maximum character length is 255. |
| auth_key | No | String | The name of the authentication field required by the third-party platform. Note: The maximum character length is 63. |
| auth_value | No | String | Authentication value. Note: The maximum character length is 255. |
| sample_rate | No | Integer | Sample rate. Valid value:
|
| enable_ext | No | Integer | Whether to subscribe to specific extensions to obtain their associated call audio streams. Valid value:
|
| enable_trunk | No | Integer | Whether to subscribe to specific trunks to obtain their associated call audio streams. Valid value:
|
| enable_did | No | Integer | Whether to subscribe to specific DID numbers to obtain their associated call audio streams. Valid value:
|
| subscribe_list | No | Array <Subscribe_List> | The information of subscribed objects. Note: To successfully add subscription objects, you need to set the corresponding value of enable_ext, enable_trunk or enable_did to 1. |
Subscribe_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| subscribe_id | Yes | Integer | The ID of the subscription object. Tip: You can call Get Menu Options to get IDs of extensions, extension groups, organization, trunks or DID numbers. |
| subscribe_type | Yes | Integer | The type of the subscription object. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
Examples
Request example
POST /openapi/v1.0/websocketaudiostream/update?access_token=iioRRjGzPoYGGJLjh7zkYfYxj3Xe4oqW HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"auth_key": "yyyy",
"auth_value": "chasnCjhsbvkslMCWJIEOFKCJKABHCOACLNHCSHJBCssss",
"enable": 1,
"enable_did": 0,
"enable_ext": 1,
"enable_trunk": 0,
"sample_rate": 1,
"subscribe_list": [
{
"subscribe_id": 50,
"subscribe_type": "extension"
}
],
"websocket_url": "wss://docs.example.cloud.com"
}Response example
HTTP 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS"
}