Recently in the making of a video software based on WEBRTC, here is a basic understanding of the process of establishing a call connection on the upper level, as recorded here.
Suppose A and B want to establish a video call, A is the room creation end, B is added to the room side:
1, a through HTTP login, get other server address (do some save user information operation, get signaling, stun, turn server address, etc., not necessary)
2, A and signaling server establish websocket long connection
3, a through the websocket to the signaling server registration (create room, record room number, waiting for B to join the room)
4. A Create local video to get SDP information for a
5, b Create a local video, get the SDP information of B
6, B send local SDP information to signaling server Sendoffer
6.1, B also in the stun (traversal), turn (delay forwarding) server to obtain ice information
6.2, B Send ice information to the signaling server (follow-up and a Exchange 3 kinds of information, no longer repeat)
7. Signaling server forwards SDP, ice information to a (through room number identification)
8. A set the SDP information of B to the underlying setremotedescription
8.1, a add ice information for B
8.2, a also in the stun (traversal), turn (delay forwarding) server to obtain ice information
8.3, a send ice information to the signaling server (follow-up and B Exchange 3 kinds of information, no longer repeat)
9. A Send local SDP information to the signaling server Sendanswer
10. Signaling server forwards SDP information to B
11, B set the SDP information for a to the underlying setremotedescription
While exchanging the SDP information, the ice information is also exchanged, and by exchanging ice information, it will eventually choose a suitable way to establish the connection (peer-to/turn server-based delay forwarding path)
WEBRTC Learning Note 1 (establishing a connection basic process)