Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit dba84bf

Browse files
authored
Merge branch 'master' into master
2 parents 5384ebe + b166b03 commit dba84bf

16 files changed

+287
-94
lines changed

doc/Client-Portal Protocol.md

Lines changed: 95 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Client-Portal Communication Protocol (version 1.1)
1+
# Client-Portal Communication Protocol (version 1.2)
22
<!--
33
|date | contributor | revision |
44
| :-------: | :------------: | :------------: |
@@ -16,7 +16,10 @@ Here is a table describing the detailed name and definition.
1616
|:----|:-----------|
1717
| Portal | The MCU component listening at the Socket.io server port, accepting signaling connections initiated by Clients, receive/send signaling messages from/to Clients. |
1818
| 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/). |
2023
| 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. |
2124
| 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. |
2225
| 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
6164
- **NotificationName** must be with type of string, and with value defined in this specification;
6265
- **NotificationData** must be with type of object, and with format defined in this specification, and will be absent if no notification data is present.
6366

64-
## 3.2 Connection Maintenance
67+
## 3.2 Signaling Connection Maintenance
6568
### 3.2.1 Client Connects
6669
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>
6770

@@ -144,11 +147,13 @@ This a format for client reconnects.
144147
{
145148
publish: {
146149
audio: true | false,
147-
video: true | false
150+
video: true | false,
151+
data: true | false
148152
},
149153
subscribe: {
150154
audio: true | false,
151-
video: true | false
155+
video: true | false,
156+
data: true | false
152157
}
153158
}
154159

@@ -164,7 +169,8 @@ This a format for client reconnects.
164169
{
165170
id: string(StreamID),
166171
type: "forward" | "augmented" |"mixed",
167-
media: object(MediaInfo),
172+
media: object(MediaInfo) | null,
173+
data: true | false,
168174
info: object(PublicationInfo)/*If type equals "forward"*/
169175
| object(AugmentInfo)/*If type equals "augmented"*/
170176
| object(ViewInfo)/*If type equals "mixed"*/
@@ -243,7 +249,7 @@ This a format for client reconnects.
243249
object(PublicationInfo):
244250
{
245251
owner: string(ParticipantId),
246-
type: "webrtc" | "streaming" | "sip",
252+
type: "webrtc" | "streaming" | "sip" | "quic",
247253
inViews: [String(ViewLabel)],
248254
attributes: object(ClientDefinedAttributes)
249255
}
@@ -350,38 +356,48 @@ This a format for client reconnects.
350356
message: string(Message)
351357
}
352358

353-
### 3.3.7 Participant Starts Publishing a WebRTC Stream to Room
359+
### 3.3.7 Participant Starts Publishing a Stream to Room
354360
**RequestName**: “publish”<br>
355361

356362
**RequestData**: The PublicationRequest object with following definition:
357363

364+
```
358365
object(PublicationRequest)::
359366
{
360-
media: object(WebRTCMediaOptions),
361-
attributes: object(ClientDefinedAttributes)
367+
media: object(WebRTCMediaOptions) | null,
368+
data: true | false,
369+
transport: object(TransportOptions),
370+
attributes: object(ClientDefinedAttributes) | null
362371
}
372+
```
373+
374+
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.
375+
376+
```
377+
object(WebRTCMediaOptions)::
378+
{
379+
audio: {
380+
source: "mic" | "screen-cast" | "raw-file" | "encoded-file"
381+
}
382+
| false,
383+
video: {
384+
source: "camera"| "screen-cast" | "raw-file" | "encoded-file",
385+
parameters:
386+
{
387+
resolution: object(Resolution),
388+
framerate: number(FramerateFPS)
389+
}
390+
}
391+
| false
392+
}
393+
```
363394

364-
object(WebRTCMediaOptions)::
365-
{
366-
audio: {
367-
source: "mic" | "screen-cast" | "raw-file" | "encoded-file"
368-
}
369-
| false,
370-
video: {
371-
source: "camera"| "screen-cast" | "raw-file" | "encoded-file",
372-
parameters:
373-
{
374-
resolution: object(Resolution),
375-
framerate: number(FramerateFPS)
376-
}
377-
}
378-
| false
379-
}
380395
**ResponseData**: The PublicationResult object with following definition if **ResponseStatus** is “ok”:
381396

382397
object(PublicationResult)::
383398
{
384-
id: string(SessionId) //will be used as the stream id when it gets ready.
399+
transportId: string(transportId), // Can be reused in the following publication or subscription.
400+
publicationId: string(SessionId) //will be used as the stream id when it gets ready.
385401
}
386402
### 3.3.8 Participant Stops Publishing a Stream to Room
387403
**RequestName**: “unpublish”<br>
@@ -431,7 +447,8 @@ This a format for client reconnects.
431447

432448
object(SubscriptionRequest)::
433449
{
434-
media: object(MediaSubOptions)
450+
media: object(MediaSubOptions),
451+
transport: object(TransportOptions),
435452
}
436453

437454
object(MediaSubOptions)::
@@ -464,7 +481,8 @@ This a format for client reconnects.
464481

465482
object(SubscriptionResult)::
466483
{
467-
id: string(SubscriptionId)
484+
transportId: string(transportId), // Can be reused in the following publication or subscription.
485+
subscriptionId: string(SubscriptionId)
468486
}
469487
### 3.3.12 Participant Stops a Self-Initiated Subscription
470488
**RequestName**: “unsubscribe”<br>
@@ -519,14 +537,14 @@ This a format for client reconnects.
519537

520538
object(SOACMessage)::
521539
{
522-
id: string(SessionId), /* StreamId returned in publishing or SubscriptionId returned in subscribing*/
540+
id: string(transportId), /* Transport ID returned in publishing or subscribing*/
523541
signaling: object(OfferAnswer) | object(CandidateMessage) | object(RemovedCandidatesMessage)
524542
}
525543

526544
object(OfferAnswer)::
527545
{
528546
type: "offer" | "answer",
529-
sdp: string(SDP)
547+
sdp: string(SDP) | null, // WebRTC connection
530548
}
531549

532550
object(CandidateMessage)::
@@ -547,24 +565,59 @@ This a format for client reconnects.
547565
sdpMLineIndex: number(mLineIndex), // optional in RemovedCandidatesMessage
548566
candidate: string(candidateSdp)
549567
}
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+
550575
**ResponseData**: undefined if **ResponseStatus** is “ok”.
551576
### 3.3.15 Participant Receives Session Progress
552577
**NotificationName**: “progress”<br>
553578

554-
**NotificationData**: The SessionProgress object with following definition.
579+
**NotificationData**: The SessionProgress or TransportProgress object with following definition.
555580

556-
object(SessionProgress)::
581+
object(TransportProgress)::
557582
{
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”*/
561586
| (undefined/*If status equals “ready” and session is NOT for recording*/
562-
| object(RecorderInfo)/*If status equals “ready” and session is for recording*/ )
563587
| string(Reason)/*If status equals “error”*/
564588
}
565589

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.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# QUIC Transport Payload and Message Format
2+
3+
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.
8+
9+
## Datagram
10+
11+
Each package has a 128 bit header for session ID.
12+
13+
```
14+
0 1 2 3
15+
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
16+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17+
| |
18+
| Session Identifier |
19+
| .... |
20+
| |
21+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
22+
| Datagram Data (*) ...
23+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
24+
```
25+
26+
It may increase about 2% network cost.
27+
28+
## Signaling Session
29+
30+
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.
31+
32+
```
33+
0 1 2 3
34+
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
35+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36+
| Message length |
37+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38+
| Message ...
39+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40+
```
41+
42+
## Authentication
43+
44+
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.

doc/servermd/AnalyticsGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Start up MCU in Docker container:
135135

136136
````
137137
cd Release-vxxx
138-
./bin/init-all.sh --deps
138+
./bin/init-all.sh --deps ##default password for user owt is owt
139139
./bin/start-all.sh
140140
````
141141

docker/Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,18 @@ WORKDIR /home
220220
ARG NODE_VER=v10.21.0
221221
ARG NODE_REPO=https://nodejs.org/dist/${NODE_VER}/node-${NODE_VER}-linux-x64.tar.xz
222222

223-
COPY --from=owt-build /home/owt-server/dist /home/owt
224-
COPY startowt.sh /home/
225-
226-
RUN apt-get update && apt-get install -y -q --no-install-recommends ca-certificates wget xz-utils rabbitmq-server mongodb libboost-system-dev libboost-thread-dev liblog4cxx-dev libglib2.0-0 libfreetype6-dev curl
223+
RUN apt-get update && apt-get install -y -q --no-install-recommends ca-certificates wget xz-utils rabbitmq-server mongodb libboost-system-dev libboost-thread-dev liblog4cxx-dev libglib2.0-0 libfreetype6-dev curl sudo
227224

228225
RUN wget ${NODE_REPO} && \
229226
tar xf node-${NODE_VER}-linux-x64.tar.xz && \
230227
cp node-*/* /usr/local -rf && rm -rf node-*
231228

229+
RUN useradd -m owt && echo "owt:owt" | chpasswd && adduser owt sudo
230+
231+
COPY --chown=owt:owt --from=owt-build /home/owt-server/dist /home/owt
232+
COPY --chown=owt:owt startowt.sh /home/
233+
234+
USER owt
235+
236+
CMD /bin/bash
232237
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/x86_64-linux-gnu

docker/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ Note that `externalip` and `network_interface` should be both set if there are e
4444
a) Launch a Docker container with following command to simply try OWT:
4545
4646
```shell
47-
docker run -itd --name=owt --net=host owt:run /home/startowt.sh
47+
docker run -itd --name=owt --net=host owt:run bash
48+
docker exec -it owt bash
49+
cd /home/
50+
./startowt.sh ##default password for user owt is owt
4851
```
4952
Then OWT service should be launched and you can connect to https://localhost:3004 to start your OWT journey.
5053
5154
b) Launch OWT service with Docker swarm with script ```conference/build_server.sh```
5255
53-
c) Customize different OWT module images and launch OWT service with Kubernetes.
56+
c) Customize different OWT module images and launch OWT service with Kubernetes.

0 commit comments

Comments
 (0)