v0.0.X

Signal exchange with examples

S – Server
C – Client
CM – Client registered in server as potencial member of conversation


 

Connect to server via websocket:

(1) open websocket connection
(2) C became CM


 

Send command to create conversation:

(1) send signal “create” with optional conversation name
(2) receive “created” with unique conversation Id – this conversation id can be shared to allow other user to join to conversation

Sample payload is presented below:


 

Send command to join to conversation:

(1) send signal “join” with conversation name
(2) receive “joined” this signal inform client that everything want right.

Sample payload is presented below:

Signal join triggers also additional actions connected with procces of setting up WebRTC connection.


 

Whole process of create and join clients are shown below:

(1) CM1 send signal “create” with optional conversation name
(2) CM1 receive signal “created” with conversation name
(3) CM1 share conversation name to CM2
(4) CM2 send signal “join” with required conversation name (received from CM1)
(5) CM2 receive signal “joined” with conversation name
(5′) CM1 receive signal “joined” from CM2 (in this way CM1 can read CM1 unique id)
(6) CM1 receive signal “offerRequest” from CM2 this signal trigger WebRTC signal exchange protocol

Sample payload is presented below:

Signal “offerRequest” begins SPDs exchange.


 

SPDs exchange protocol is shown below:

(1) Server send signal “offerRequest” from CM2 to CM1
(x1) CM1 have to get local media and obtain SPD
(2) CM1 send signal “offerResponse” to Server in content CM1 send his SPD
(3) Server send signal “answerRequest” to CM2 in content Server provide CM1 SPD
(x3) CM2 have to get local media and obtain SPD (same action like in x1)
(4) CM2 send signal “answerResponse” to Servier in content CM2 send his SPD
(5) Server send signal “finalize” to CM1 in content Server provide CM2 SPD
(6) CM1 send signal “candidate” to in content sends SPD candidate
(7) Server propagate signal to CM2
(8) CM2 receive signal “candidate” and give response with his SPD candidate
(9) Server propagate signal to CM1
Now both clients can see each other.

Sample payload:

 

Leave a Reply

Your email address will not be published. Required fields are marked *