Get WebRTC Configs

Last Updated on : 2023-07-12 02:45:21download

This topic describes how to get WebRTC configurations of the specified device.

API description

Get WebRTC configurations of the specified device.

API endpoint

GET: /v1.0/users/{uid}/devices/{device_id}/webrtc-configs

Request parameters

Parameter name Type Location Required Description
uid String uri true The user ID.
device_id String uri true The device ID.

Return parameters

Parameter name Type Description
result WebRTCConfigVO The returned result.

Description of result

Parameter name Type Description
audio_attributes JSONObject The audio attribute.
auth String The license.
id String The device ID.
moto_id String The ID of the signaling service.
p2p_config JSONObject The P2P configuration.
skill String The skill.
supports_webrtc Boolean Indicates whether WebRTC is supported.
vedio_clarity Integer The video definition.

Description of p2p_config

Parameter name Type Description
ices List The information about interactive connectivity establishment (ICE).

Description of audio_attributes

Parameter name Type Description
call_mode List The call mode.
hardware_capability List The hardware capabilities.

Description of ices

Parameter name Type Description
urls String The URL of the specified server.
username String The username.
credential String The password.
ttl Integer The validity period.

Sample request

GET: /v1.0/users/ay156402688xxxxvoY5W/devices/6c08578d894xxxx11afye1/webrtc-configs
{}

Sample response

{
    "result": {
        "p2p_config": {
            "ices": [
                {
                    "urls": "stun:172.81.239.63:3478"
                },
                {
                    "urls": "stun:tx1stun.wgine.com:3478"
                },
                {
                    "urls": "nat:tx1nat.wgine.com:3478"
                },
                {
                    "urls": "nat:tx1nat.tuyacn.com:3478"
                },
                {
                    "ttl": 3600,
                    "urls": "turn:172.81.239.63:3478",
                    "credential": "+eszzFb3f+KM7N5f+/3jdCHlSwQ=",
                    "username": "1615438498:6c08578d894934411afye1:kydhkuwwehqrvd8pfpv5"
                },
                {
                    "ttl": 3600,
                    "urls": "turn:tx1turn.wgine.com:3478",
                    "credential": "+eszzFb3f+KM7N5f+/3jdCHlSwQ=",
                    "username": "1615438498:6c08578d894934411afye1:kydhkuwwehqrvd8pfpv5"
                }
            ]
        },
        "auth": "U+qtvRP+Amz3YQLpcgagMxqID8aUGBUZopKJr0kWZ78=",
        "supports_webrtc": true,
        "skill": "{\"webrtc\":3,\"audios\":[{\"channels\":1,\"dataBit\":16,\"codecType\":105,\"sampleRate\":8000}],\"videos\":[{\"streamType\":2,\"profileId\":\"\",\"width\":2304,\"codecType\":4,\"sampleRate\":0,\"height\":1296},{\"streamType\":4,\"width\":640,\"codecType\":2,\"sampleRate\":0,\"height\":360}]}",
        "moto_id": "moto_cnpre002",
        "id": "6c08578d894934411afye1",
        "vedio_clarity": 4,
        "audio_attributes": {
            "call_mode": [
                1,
                2
            ],
            "hardware_capability": [
                1,
                2
            ]
        }
    },
    "t": 1615434898584,
    "success": true
}

Error codes

For more information, see Global Error Codes.