Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
8b62d40c
Commit
8b62d40c
authored
Oct 18, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改rtc文档
parent
84190ade
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
254 additions
and
0 deletions
+254
-0
docs/md/wecloud-RTC对接文档的.md
+254
-0
开发记录.md
+0
-0
No files found.
docs/md/wecloud-RTC对接文档的.md
0 → 100644
View file @
8b62d40c
# wecloud-RTC音视频客户端信令对接文档
# wecloud-RTC音视频客户端信令对接文档
## 文档描述
此文档为单人RTC音视频通讯技术对接文档
由于RTC基于wecloud-im即时通讯服务,
**对接RTC前,需要先对接wecloud-im服务**
## 核心概念说明
### 频道与会话
频道与会话的概念不一样
```
1. 引入"频道RtcChannel"概念, 可以不基于会话发起音视频通话
2. 目前频道只支持两个client,进行通话的两端必须先加入到同一个"频道",所有的指令都在频道内进行转发
3. 允许不在同个会话中的两个client加入到同个频道进行通话 (可配置是否两个client必须在同一个会话才能发起音视频通话)
4. 一个频道可以由通话发起者绑定到会话ID,"挂断","未接听"等状态会同步到会话, 未绑定将不同步到会话(可选)
5. 连接websocket时带上client类型, 如web,安卓,ios
client需要监听频道内 状态更新(房间断开,挂断)、用户状态更新(用户加入, 用户退出)、流状态更新(切换音频 切换视频)
```
## 流程图
### 不绑定到会话 示例一

## 指令码说明
#### **subCmd**子类型指令码
##### 客户端**请求**指令列表:
**create**
:创建频道
**join**
: 加入频道
**SDP**
:SDP数据转发
**reject**
:拒绝加入频道
**leave**
:主动挂断(离开频道)
##### 服务端**响应**指令列表:
**rtcCall**
:接收到RTC邀请
**clientEvent**
: 用户状态更新事件(用户加入,用户退出,用户拒接邀请)
**typeEvent**
:流状态更新(切换音频 切换视频)
**statusEvent**
:状态更新(网络断开,挂断)
**SDP**
:SDP数据转发
**busy**
:忙线
## 创建频道 发起RTC音视频通话 (http)
见http接口文档
## 接收方收到RTC音视频通话邀请(ws)
服务端向client接收方下发数据:
```
json
{
"cmd"
:
4
,
"data"
:{
"subCmd"
:
"rtcCall"
,
"subData"
:{
"type"
:
"video"
,
"toConversation"
:
null
,
"channelId"
:
1234263457652
,
"sender"
:
"client_1010"
},
"diyParam自定义字段"
:
"aaaa自已定义字段的值"
,
"attrs"
:{
"a"
:
"示例: 用户自定义的一些键值对"
,
"b"
:
"存储用户自定义的一些键值对"
}
}
}
```
**参数描述**
| 字段名 | 字段类型 | 是否可空 | 说明 |
| ---- | -------- | -- | ------ |
| cmd | String | 否 | 指令码 |
| attrs | Object | 是 | 自定义拓展字段 |
| toConversation | Long | 否 | 绑定的会话id |
| diyParam自定义字段 | Object | 是 | 自定义拓展字段 |
| subCmd | String | 否 | 子类型指令 |
| sender | String | 否 | 发起通话的客户端ID |
| channelId | Long | 否 | 由服务端创建的频道id |
| type | String | 否 | 类型: "video" 或 "voice" |
## 同意加入频道(http)
见http接口文档
## 有client加入频道(ws下发)
服务端向频道内其他client响应数据:
```
json
{
"cmd"
:
4
,
"data"
:{
"subCmd"
:
"clientEvent"
,
"subData"
:{
"channelId"
:
1234263457652
,
"type"
:
"join"
,
"clientId"
:
7657567
,
}
}
}
```
## 拒绝加入频道 http
client接收方向服务端请求数据:
```
json
{
"reqId"
:
"123"
,
"cmd"
:
3
,
"data"
:{
"subCmd"
:
"reject"
,
"diyParam自定义字段"
:
"aaaa自已定义字段的值"
,
"channelId"
:
1234263457652
,
"attrs"
:{}
}
}
```
**说明:**
**参数描述**
| 字段名 | 字段类型 | 是否可空 | 说明 |
| ---- | -------- | -- | ------ |
| cmd | String | 否 | 指令码 |
| attrs | Object | 是 | 自定义拓展字段 |
| toConversation | Long | 否 | 会话id |
| diyParam自定义字段 | Object | 是 | 自定义拓展字段 |
| subCmd | String | 否 | 子类型 |
## 有Client拒绝加入频道(ws下发)
服务端向频道内其他client响应数据:
```
json
{
"cmd"
:
4
,
"data"
:{
"subCmd"
:
"clientEvent"
,
"subData"
:{
"channelId"
:
1234263457652
,
"type"
:
"reject"
,
"clientId"
:
7657567
,
}
}
}
```
## 流媒体描述信息SDP转发
(服务端仅负责转发)(candidate,anser,offer)
### client上传SDP (http接口)
见http接口文档
### client接收SDP (ws下发)
```
json
{
"cmd"
:
4
,
"data"
:{
"subCmd"
:
"sdp"
,
"subData"
:{
"channelId"
:
1234263457652
,
"clientId"
:
7657567
,
"sdpData"
:
"xxxxxxxxxxxxxxxx"
,
"diyParam自定义字段"
:
"aaaa自已定义字段的值"
,
"attrs"
:{}
}
}
}
```
## 主动挂断(离开频道) http
client主动离开频道
见http接口文档
## 有client离开频道(ws下发)
服务端向频道内其他client响应数据:
```
json
{
"cmd"
:
4
,
"data"
:{
"subCmd"
:
"clientEvent"
,
"subData"
:{
"channelId"
:
1234263457652
,
"type"
:
"leave"
,
"clientId"
:
7657567
,
}
}
}
```
## 查询忙线状态(对方正在通话中) http
服务端响应给发起方
```
json
{
"reqId"
:
"555111-ad-afd12"
,
"cmd"
:
5
,
"data"
:{
"subCmd"
:
"busy"
,
"subData"
:{
"channelId"
:
1234263457652
,
"clientId"
:
7657567
}
}
}
```
## 断线重连
重新join进频道即可重连
## 对方是否还挂起
## 查询频道信息及在线人员 http
## 视频/音频切换
## 查询对方是否离开
开发记录.md
View file @
8b62d40c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment