I am not an expert at webrtc, but I will try to explain some of your questions.
Servers 1.ICE. NAT and firewalls pose a significant problem when configuring IP endpoints. therefore, IETF STUN, TURN, and ICE standards were developed to solve the NAT bypass problem. STUN helps connect IP endpoints:
- find out if they are behind a NAT / firewall, and if so,
- to determine the public IP address and type of firewall. STUN then uses this information to help establish peer-to-peer IP connectivity.
TURN, which Traversal stands for, using Relay NAT, provides a NAT round-back rollback method using a media relay server to facilitate media transport between endpoints.
ICE is a platform that uses both STUN and TURN to securely configure IP and multimedia transport using the SIP offer / response model for endpoints to exchange multiple IP addresses and candidate ports (such as private addresses and TURN server addresses) .
2. Alarm is a process of coordinating communication. This signaling part should be implemented by you according to your needs (for example, if you have a sip structure in place, then you will have to implement signaling). In order for the WebRTC application to create a “call”, its clients need to exchange information:
for advertiser:
first create a peer-to-peer connection and pass ice candidates to it as parameters.
set event handlers for three events:
- onicecandidate-- onicecandidate returns locally generated ICE candidates so you can pass them on to other users (for example), namely the list of ice candidates returned by STUN / TURN servers; these ice candidates contain your public ipv4 / ipv6 addresses as well as random UDP addresses.
- onaddstream - onaddstream returns a remote stream (your friend’s microphone and camera!).
- addStream` attaches your local microphone and camera to another partner.
Now create the SDP clause by calling the setLocalDescription function and configure the remote SDP by calling setRemoteDescription.
For the user:
- setRemoteDescription
- createAnswer
- setLocalDescription
- oniceCandidate - Upon receipt of a locally created ICE
- addiceCandidate - When receiving an ICE sent by another partner
- onaddstream - for remote stream to add
I hope this makes some of your doubts clear.
Alex morrison
source share