English
English
简体中文
Contact Us
Register
Log In

Get WebRTC Configs

Last Updated on : 2022-09-07 09:19:09download

Get the WebRTC configurations of devices.

API address

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

Request parameter

Parameter name Type IN Required Description
uid String uri true User ID
device_id String uri true Device ID

Return parameter

Parameter name Type Description
result WebRTCConfigVO

Description of result

Parameter name Type Description
audio_attributes JSONObject Audio attributes
auth String Auth code
id String Device ID
moto_id String Signal server ID
p2p_config JSONObject P2P configs
skill String Skill
supports_webrtc Boolean Whether support WebRTC
vedio_clarity Integer Video clarity

Description of p2p_config

Parameter name Type Description
ices List ICE info

Description of audio_attributes

Parameter name Type Description
call_mode List Call mode
hardware_capability List Hardware capability

Description of ices

Parameter name Type Description
urls String ICE Server Url
username String ICE username
credential String ICE credential
ttl Integer TTL

Request example

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

Return example

{
    "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 code

For more information, see error code.