TempTable

Draft
This page is not complete.

This page is being used to plan out an event flow chart for WebRTC signaling. It's just temporary.

Naomi's client (caller) Naomi's browser Signaling server Priya's browser Priya's client (callee)
invite() calls setupVideoCall()        

setupVideoCall()

  1. Create RTCPeerConnection
  2. Call navigator.mediaDevices.getUserMedia() to get access to webcam and microphone
  3. Promise fulfilled: add the local stream by calling RTCPeerConnection.addStream()
  4. Send "video-invite" to Priya through the signaling server
       
    on.message()  receives the "video-invite" message and forwards it to Priya    
        handleVideoInviteMsg() records the name of the caller (Naomi) and then calls setupVideoCall()
       

setupVideoCall()

  1. Create RTCPeerConnection
  2. Call navigator.mediaDevices.getUserMedia() to get access to webcam and microphone
  3. Promise fulfilled: add the local stream by calling RTCPeerConnection.addStream()
  4. Send "video-accept" to Naomi through the signaling server
    on.message() receives the "video-accept" message and forwards it to Naomi    
Signaling process begins

handleVideoAcceptMsg():

  1. Create an SDP offer by calling RTCPeerConnection.createOffer()
  2. Promise fulfilled: set the description of Naomi's end of the call by calling RTCPeerConnection.setLocalDescription()
  3. Promise fulfilled: send the offer to Priya in a message of type "sdp-offer" (through the signaling server)
       
 

Starts sending ICE candidates to Priya's browser, which will queue them up until it's ready for them

  1. Generate an ICE candidate object
  2. Send an icecandidate event to Naomi's client, asking it to forward the candidate to Priya using the signaling channel
     

handleICECandidateEvent() fires to handle the icecandidate event; the candidate is forwarded to Priya by sending a "new-ice-candidate" message which encapsulates it

 

on.message() receives "sdp-offer" and forwards it to Priya

on.message() receives "new-ice-candidate" and forwards it to Priya

   
       

handleOfferMsg() receives "sdp-offer" message and handle it:

  1. Create an RTCSessionDescription object using the received SDP offer
  2. Call RTCPeerConnection.setRemoteDescription() to tell WebRTC about Naomi's configuration
  3. Promise fulfilled: call RTCPeerConnection.createAnswer() to create an answer to send to Naomi
  4. Promise fulfilled: configure Priya's end of the connection to match the generated answer by passing it to RTCPeerConnection.setLocalDescription()
  5. Promise fulfilled: send a message of type "sdp-answer" to Naomi, which includes the SDP answer object

handleNewICECandidateMsg() receives the "new-ice-candidate" message and passes it along to the browser by calling RTCPeerConnection.addIceCandidate()

  Now accepting ICE candidates from Priya   RTCPeerConnection.addIceCandidate() adds the received ICE candidate to the list of possible ICE configurations supported by Naomi's browser  
         
      Starts sending ICE candidates to Naomi's browser  
    on.message() receives the "sdp-answer" and forwards it to Naomi    
       

handleAnswerMsg() receives "sdp-answer" mesage and handles it:

  1. Create an RTCSessionDescription object using the received SDP answer
  2. Pass it to RTCPeerConnection.setRemoteDescription() to configure Naomi's WebRTC layer to know how Priya's end of the call is configured
         

 

Document Tags and Contributors

 Contributors to this page: Sheppy
 Last updated by: Sheppy,