w3c / webrtc-pc

WebRTC 1.0 API
https://w3c.github.io/webrtc-pc/
Other
437 stars 115 forks source link

Specify when RTCIceRole is updated #2214

Closed henbos closed 4 years ago

henbos commented 5 years ago

We should introduce an internal slot and say when it is updated.

alvestrand commented 5 years ago

Determining the role is described in https://tools.ietf.org/html/rfc8445#section-6.1.1. An UA is always a full agent (it's not permitted to be ICE-lite). If it initiates ICE, it will always be "controlling"; if it responds, it will be controlling if the other ends has "a=ice-lite" in its SDP. Per https://tools.ietf.org/html/draft-ietf-mmusic-ice-sip-sdp-39#section-4.1, it will be considered as initiating ICE if it sends the initial offer, and it's a responder otherwise. ICE restart may cause roles to flip; renegotiation without ICE restart won't (8445 section 6.1.1.)

There's also a role conflict resolution process in section 7.3.1.1 that might change the roles based on an incoming ICE Binding request; normally ICE binding requests don't cause observable state changes, so this is an oddity.

More rocks. More snakes.

alvestrand commented 5 years ago

If RTCIceRole is "unknown": If we send out an offer, we can set RTCIceRole to "controlling". If we get an incoming offer, and it contains "a=ice-lite", we can set RTCIceRole to "controlling". If we get an incoming offer, and it doesn't contain "a=ice-lite", we can set RTCIceRole to "controlled".

If RTCIceRole is set: If we get an ICE Binding request, and it indicates a role conflict, follow the rules in section 7.3.1.1. For all other events, leave it unchanged.

Seems right?