Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Alice is going to call (video/audio) to Bob.

  1. Alice create RTCPeerConnection object.
  2. Then she calls RTCPeerConnection::CreateOffer(). Create offer method discovers Alice's public API via STUN server, gather her video/audio settings, pack this information and form a SDP packet.
  3. Further Alice must transmit the sdp offer to Bob but she doesn't know Bob's IP address therefore she add pair "name=Bob" in the packet and send it ot the Signal server.
  4. Signal server unpack the packet and retransmit offer to Bob.
  5. Bob receives this packet and calls RTCPeerConnection::SetRemoteDescription(offer) on his RTCPeerConnection objects.
  6. Then he creates an answer via RTCPeerConnection::CreateAnswer, append the pair "name=Alice" and sends it to the signal server.
  7. Server handles answer from Bob and retransmit answer to Alice.
  8. Alice receives answer from Bob and calls RTCPeerConnection::SetRemoteDesription(answer)
  9. Also both Alice and Bob calls RTCPeerConnection::SetLocalDescription() with theirs offers (or in Bob's case answer).
  10. Now they can calls RTCPeerConnection::onTrack(stream) and this stream will sends directly to another peer.

This is a short description how to connect two peers.

 

Our signal server.

Our signal server uses JSON format for message and work via websocket's protocol.

Why have I used JSON and websockets? Because JSON is a main format for JS in browses and websocket is the fastest protocol for reliable connections.