Home / Docs Center / Device API Reference / SDP Exchange
SDP Exchange
Project: Device Interface Document (New Version) | page_id: 1006
Brief Description:
- Exchange sdp: provide the offer sdp in exchange for the answer sdp
Request URL:
- /xsw/api/p2p/sdp
Request Method:
- POST
- Content-Type: application/json; charset=utf-8
For cross-origin requests the Content-Type: text/plain
URL Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| sessionId | Yes | string | The sessionId obtained in the first step |
| channelId | No | number | Channel Id (defaults to channel 1, starting from 1) |
| connectType | No | number | Connection type: 1 relay, 2 hole punching, 3 LAN playback |
Body Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| sdp | Yes | string | offer sdp |
| type | Yes | string | Fixed value offer |
{
"sdp": 0,
"type": "offer",
}
Return Example
{
"code": 0,
"msg": "",
"type": "answer",
"sdp": "",
"relay": 1,
}
Return Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| code | number | >0 means failure |
| msg | string | Error message |
| sdp | string | answer sdp |
| type | string | Fixed value answer |
| relay | bool | Whether to relay: true means relay, false means no relay |
Notes
- None
Didn't find what you need?Contact us,Talk to our engineers directly.