Get WebSocket Audio Streaming Setting
Query the WebSocket audio streaming settings, including WebSocket server URL, sample rate of transmission, subscription objects, and so on.
Request URL
GET {base_url}/{api_path}/websocketaudiostream/get?access_token={access_token}
Request parameters
No request parameters. Send the request URL directly to get WebSocket audio streaming setting.
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| config | Object<Audiostream_Setting> | The transmit setting of the WebSocket audio stream. |
| subscribe_list | Array<Subscribed_Object> | The information of subscribed objects. |
- Audiostream_Setting
-
Parameter Type Description enable Integer Whether the WebSocket Audio Streaming feature is enabled. 0: Disabled1: Enabled
websocket_url String WebSocket server address for receiving audio streams. auth_key String The name of the authentication field required by the third-party platform. auth_value String Authentication value. sample_rate Integer Sample rate. 0: 8000Hz1: 16000Hz
enable_ext Integer Whether extensions are subscribed. 0: Disabled1: Enabled
enable_trunk Integer Whether trunks are subscribed. 0: Disabled1: Enabled
enable_did Integer Whether DID numbers are subscribed. 0: Disabled1: Enabled
- Subscribed_Object
-
Parameter Type Description id Integer The sequence number of the subscription object. subscribe_type String The type of the subscription object. extensionext_grouporganizationtrunkdid
subscribe_id Integer The ID of the subscribed object.
Examples
Request example
GET /openapi/v1.0/websocketaudiostream/get?access_token=HaRtYPeUXp2otAUzEqUQ4KvISuDOCYBl HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"config": {
"enable": 1,
"websocket_url": "wss://docs.example.cloud.com",
"auth_key": "Secret",
"auth_value": "Standardpassword111",
"sample_rate": 0,
"enable_ext": 1,
"enable_trunk": 0,
"enable_did": 0
},
"subscribe_list": [
{
"id": 3,
"subscribe_type": "organization",
"subscribe_id": 2
},
{
"id": 4,
"subscribe_type": "organization",
"subscribe_id": 3
}
]
}