You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: doc/Client-Portal Protocol.md
+95-42Lines changed: 95 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Client-Portal Communication Protocol (version 1.1)
1
+
# Client-Portal Communication Protocol (version 1.2)
2
2
<!--
3
3
|date | contributor | revision |
4
4
| :-------: | :------------: | :------------: |
@@ -16,7 +16,10 @@ Here is a table describing the detailed name and definition.
16
16
|:----|:-----------|
17
17
| Portal | The MCU component listening at the Socket.io server port, accepting signaling connections initiated by Clients, receive/send signaling messages from/to Clients. |
18
18
| Client | The program running on end-user’s device which interacts with MCU Server by messages defined in this documentation.|
19
-
| Signaling Connection | The signaling channel between Client and Portal established by Client to send, receive and fetch signaling messages. |
19
+
| Connection | A transport channel between client and server. Different kinds of connections may have different transport protocols. |
20
+
| Signaling Connection | The signaling channel between client and Portal established by Client to send, receive and fetch signaling messages. |
21
+
| WebRTC Connection | A WebRTC transport channel between client and WebRTC agent. It may carry audio and video data. Detailed information about WebRTC could be found [here](https://webrtc.org/). |
22
+
| QUIC Connection | A QUIC transport channel between client and QUIC agent. Detailed information about QUIC could be found [here](https://quicwg.org/). |
20
23
| Room | The logical entity of a conference in which all conference members (participants) exchange their video/audio streams, and where mixed streams are generated. Every room must be assigned with a unique identification **(RoomID)** in the MCU scope. |
21
24
| User | The service account defined in the third-party integration application. The user ID and user role must be specified when asking for a token. |
22
25
| Participant | The logical entity of a user when participating in a conference with a valid token. Every participant must be assigned with a unique identification **(ParticipantID)** in the room scope, and must be assigned a set of operation permissions according to its role. |
@@ -61,7 +64,7 @@ Given that Portal has accepted Clients connecting and the socket object is ready
61
64
-**NotificationName** must be with type of string, and with value defined in this specification;
62
65
-**NotificationData** must be with type of object, and with format defined in this specification, and will be absent if no notification data is present.
63
66
64
-
## 3.2 Connection Maintenance
67
+
## 3.2 Signaling Connection Maintenance
65
68
### 3.2.1 Client Connects
66
69
Portal should be able to listen at either a secure or an insecure socket.io server port to accept Clients’ connecting requests. If the secure socket.io server is enabled, the SSL certificate and private key store path must be correctly specified by configuration item portal.keystorePath in portal.toml.<br>
67
70
@@ -144,11 +147,13 @@ This a format for client reconnects.
144
147
{
145
148
publish: {
146
149
audio: true | false,
147
-
video: true | false
150
+
video: true | false,
151
+
data: true | false
148
152
},
149
153
subscribe: {
150
154
audio: true | false,
151
-
video: true | false
155
+
video: true | false,
156
+
data: true | false
152
157
}
153
158
}
154
159
@@ -164,7 +169,8 @@ This a format for client reconnects.
164
169
{
165
170
id: string(StreamID),
166
171
type: "forward" | "augmented" |"mixed",
167
-
media: object(MediaInfo),
172
+
media: object(MediaInfo) | null,
173
+
data: true | false,
168
174
info: object(PublicationInfo)/*If type equals "forward"*/
169
175
| object(AugmentInfo)/*If type equals "augmented"*/
170
176
| object(ViewInfo)/*If type equals "mixed"*/
@@ -243,7 +249,7 @@ This a format for client reconnects.
243
249
object(PublicationInfo):
244
250
{
245
251
owner: string(ParticipantId),
246
-
type: "webrtc" | "streaming" | "sip",
252
+
type: "webrtc" | "streaming" | "sip" | "quic",
247
253
inViews: [String(ViewLabel)],
248
254
attributes: object(ClientDefinedAttributes)
249
255
}
@@ -350,38 +356,48 @@ This a format for client reconnects.
350
356
message: string(Message)
351
357
}
352
358
353
-
### 3.3.7 Participant Starts Publishing a WebRTC Stream to Room
359
+
### 3.3.7 Participant Starts Publishing a Stream to Room
354
360
**RequestName**: “publish”<br>
355
361
356
362
**RequestData**: The PublicationRequest object with following definition:
A publication can send either media or data, but a QUIC *transport* channel can support multiple stream for both media and data. Setting `media:null` and `data:false` is meaningless, so it should be rejected by server. Protocol itself doesn't forbit to create WebRTC connection for data. However, SCTP data channel is not implemented at server side, so currently `data:true` is only support by QUIC transport channels.
@@ -547,24 +565,59 @@ This a format for client reconnects.
547
565
sdpMLineIndex: number(mLineIndex), // optional in RemovedCandidatesMessage
548
566
candidate: string(candidateSdp)
549
567
}
568
+
569
+
object(TransportOptions)::
570
+
{
571
+
type: "webrtc" | "quic",
572
+
id: string(transportId) | null, // null will result to create a new transport channel. Always be null if transport type is webrtc because webrtc agent doesn't support multiple transceivers on a single PeerConnection at this time.
573
+
}
574
+
550
575
**ResponseData**: undefined if **ResponseStatus** is “ok”.
551
576
### 3.3.15 Participant Receives Session Progress
552
577
**NotificationName**: “progress”<br>
553
578
554
-
**NotificationData**: The SessionProgress object with following definition.
579
+
**NotificationData**: The SessionProgress or TransportProgress object with following definition.
555
580
556
-
object(SessionProgress)::
581
+
object(TransportProgress)::
557
582
{
558
-
id: string(SessionId), /* StreamId returned in publishing or SubscriptionId returned in subscribing*/
559
-
status: "soac" | "ready" | "error",
560
-
data: object(OfferAnswer) | object(CandidateMessage)/*If status equals “soac”*/
583
+
id: string(transportId),
584
+
status: "soac" | "ready" | "error",
585
+
data: object(OfferAnswer) | object(CandidateMessage)/*If status equals “soac”*/
561
586
| (undefined/*If status equals “ready” and session is NOT for recording*/
562
-
| object(RecorderInfo)/*If status equals “ready” and session is for recording*/ )
563
587
| string(Reason)/*If status equals “error”*/
564
588
}
565
589
566
-
object(RecorderInfo)::
567
-
{
568
-
host: string(HostnameOrIPOfRecorder),
569
-
file: string(FullPathNameOfRecordedFile)
570
-
}
590
+
object(SessionProgress)::
591
+
{
592
+
id: string(SessionId), /* StreamId returned in publishing or SubscriptionId returned in subscribing*/
593
+
status: "ready" | "error"
594
+
}
595
+
596
+
# 4. Examples
597
+
598
+
This section provides a few examples of signaling messages for specific purposes.
599
+
600
+
## 4.1 Forward data through data channel over QUIC
601
+
602
+
An endpoint is joined the meeting, and it wants to publish a data stream over a QUIC transport channel.
603
+
604
+
Step 1: Client sends a "publish" request.
605
+
606
+
```
607
+
{
608
+
media: null,
609
+
data: true,
610
+
transport: {type: 'quic'}
611
+
}
612
+
```
613
+
614
+
Step 2: Receive a response from server.
615
+
616
+
```
617
+
{
618
+
transportId: undefined,
619
+
publicationId: '91e247051d494cddbd4ad461445637c4'
620
+
}
621
+
```
622
+
623
+
Step 3: Create a new WebTransport or get an existing WebTransport, then create a new BidirectionalStream or SendStream. Write data to stream. The URL of WebTransport should be included in token. WebTransport is shared by all media streams, data streams and signaling which belong to the same client.
This post defines the payload and message format for data transmitted over [WebTransport](https://w3c.github.io/webtransport/#web-transport).
4
+
5
+
## Streams
6
+
7
+
Both server and client can initialize a stream. When a stream is created, initial side sends a session ID, which is a 128 bit length message to the remote side. Session ID could be a publication ID or subscription ID as defined in [Client-Portal Protocol](https://github.com/open-webrtc-toolkit/owt-server/blob/master/doc/Client-Portal%20Protocol.md). As the session ID issued by server may less than 128 bit right now, fill it with 0 in most significant bits. Session ID 0 is reserved for signaling. When remote side receives the session ID, it should check whether session ID is valid. Terminate the stream if session ID is invalid, or send the same session ID to client if it is valid. Depends on the type of stream it created, one side or both sides are ready to send data.
After creating a WebTransport, a stream with session 0 should be created for authentication and signaling. Every signaling message is followed by a 32 bit length integer that indicates the body's length.
If signaling messages are transmitted over WebTransport, authentication follows the regular process defined by [Client-Portal Protocol](https://github.com/open-webrtc-toolkit/owt-server/blob/master/doc/Client-Portal%20Protocol.md). Otherwise, client sends a token for WebTransport as a signaling message. WebTransport token is issued during joining a conference. If token is valid, server sends a 128 bit length transport ID to client. The transport ID should be same as the one included in token.
0 commit comments