--- 1/draft-ietf-rtcweb-jsep-13.txt 2016-03-21 17:19:09.655253886 -0700 +++ 2/draft-ietf-rtcweb-jsep-14.txt 2016-03-21 17:19:10.119265392 -0700 @@ -1,21 +1,21 @@ Network Working Group J. Uberti Internet-Draft Google Intended status: Standards Track C. Jennings -Expires: September 10, 2016 Cisco +Expires: September 22, 2016 Cisco E. Rescorla, Ed. Mozilla - March 9, 2016 + March 21, 2016 Javascript Session Establishment Protocol - draft-ietf-rtcweb-jsep-13 + draft-ietf-rtcweb-jsep-14 Abstract This document describes the mechanisms for allowing a Javascript application to control the signaling plane of a multimedia session via the interface specified in the W3C RTCPeerConnection API, and discusses how this relates to existing signaling protocols. Status of This Memo @@ -25,115 +25,119 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on September 10, 2016. + This Internet-Draft will expire on September 22, 2016. Copyright Notice Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 - 1.1. General Design of JSEP . . . . . . . . . . . . . . . . . 3 + 1.1. General Design of JSEP . . . . . . . . . . . . . . . . . 4 1.2. Other Approaches Considered . . . . . . . . . . . . . . . 5 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 3. Semantics and Syntax . . . . . . . . . . . . . . . . . . . . 6 3.1. Signaling Model . . . . . . . . . . . . . . . . . . . . . 6 3.2. Session Descriptions and State Machine . . . . . . . . . 7 3.3. Session Description Format . . . . . . . . . . . . . . . 10 - 3.4. ICE . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 3.4.1. ICE Gathering Overview . . . . . . . . . . . . . . . 10 - 3.4.2. ICE Candidate Trickling . . . . . . . . . . . . . . . 11 - 3.4.2.1. ICE Candidate Format . . . . . . . . . . . . . . 12 - 3.4.3. ICE Candidate Policy . . . . . . . . . . . . . . . . 12 - 3.4.4. ICE Candidate Pool . . . . . . . . . . . . . . . . . 13 - 3.5. Video Size Negotiation . . . . . . . . . . . . . . . . . 14 - 3.5.1. Creating an imageattr Attribute . . . . . . . . . . . 14 - 3.5.2. Interpreting an imageattr Attribute . . . . . . . . . 15 - 3.6. Interactions With Forking . . . . . . . . . . . . . . . . 16 - 3.6.1. Sequential Forking . . . . . . . . . . . . . . . . . 16 - 3.6.2. Parallel Forking . . . . . . . . . . . . . . . . . . 17 + 3.4. Session Description Control . . . . . . . . . . . . . . . 10 + 3.4.1. RtpTransceivers . . . . . . . . . . . . . . . . . . . 10 + 3.4.2. RtpSenders . . . . . . . . . . . . . . . . . . . . . 11 + 3.4.3. RtpReceivers . . . . . . . . . . . . . . . . . . . . 11 + 3.5. ICE . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 + 3.5.1. ICE Gathering Overview . . . . . . . . . . . . . . . 11 + 3.5.2. ICE Candidate Trickling . . . . . . . . . . . . . . . 12 + 3.5.2.1. ICE Candidate Format . . . . . . . . . . . . . . 12 + 3.5.3. ICE Candidate Policy . . . . . . . . . . . . . . . . 13 + 3.5.4. ICE Candidate Pool . . . . . . . . . . . . . . . . . 14 + 3.6. Video Size Negotiation . . . . . . . . . . . . . . . . . 14 + 3.6.1. Creating an imageattr Attribute . . . . . . . . . . . 14 + 3.6.2. Interpreting an imageattr Attribute . . . . . . . . . 15 + 3.7. Interactions With Forking . . . . . . . . . . . . . . . . 17 + 3.7.1. Sequential Forking . . . . . . . . . . . . . . . . . 17 + 3.7.2. Parallel Forking . . . . . . . . . . . . . . . . . . 18 4. Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 18 - 4.1. Methods . . . . . . . . . . . . . . . . . . . . . . . . . 18 - 4.1.1. Constructor . . . . . . . . . . . . . . . . . . . . . 18 - 4.1.2. createOffer . . . . . . . . . . . . . . . . . . . . . 20 - 4.1.3. createAnswer . . . . . . . . . . . . . . . . . . . . 21 + 4.1. Methods . . . . . . . . . . . . . . . . . . . . . . . . . 19 + 4.1.1. Constructor . . . . . . . . . . . . . . . . . . . . . 19 + 4.1.2. createOffer . . . . . . . . . . . . . . . . . . . . . 21 + 4.1.3. createAnswer . . . . . . . . . . . . . . . . . . . . 22 4.1.4. SessionDescriptionType . . . . . . . . . . . . . . . 22 - 4.1.4.1. Use of Provisional Answers . . . . . . . . . . . 22 - 4.1.4.2. Rollback . . . . . . . . . . . . . . . . . . . . 23 - 4.1.5. setLocalDescription . . . . . . . . . . . . . . . . . 24 - 4.1.6. setRemoteDescription . . . . . . . . . . . . . . . . 24 - 4.1.7. currentLocalDescription . . . . . . . . . . . . . . . 25 - 4.1.8. pendingLocalDescription . . . . . . . . . . . . . . . 25 - 4.1.9. currentRemoteDescription . . . . . . . . . . . . . . 25 - 4.1.10. pendingRemoteDescription . . . . . . . . . . . . . . 25 - 4.1.11. canTrickleIceCandidates . . . . . . . . . . . . . . . 26 - 4.1.12. setConfiguration . . . . . . . . . . . . . . . . . . 26 - 4.1.13. addIceCandidate . . . . . . . . . . . . . . . . . . . 27 - 5. SDP Interaction Procedures . . . . . . . . . . . . . . . . . 27 - 5.1. Requirements Overview . . . . . . . . . . . . . . . . . . 27 - 5.1.1. Implementation Requirements . . . . . . . . . . . . . 28 - 5.1.2. Usage Requirements . . . . . . . . . . . . . . . . . 29 - 5.1.3. Profile Names and Interoperability . . . . . . . . . 29 - 5.2. Constructing an Offer . . . . . . . . . . . . . . . . . . 30 - 5.2.1. Initial Offers . . . . . . . . . . . . . . . . . . . 30 - 5.2.2. Subsequent Offers . . . . . . . . . . . . . . . . . . 35 - 5.2.3. Options Handling . . . . . . . . . . . . . . . . . . 38 - 5.2.3.1. OfferToReceiveAudio . . . . . . . . . . . . . . . 38 - 5.2.3.2. OfferToReceiveVideo . . . . . . . . . . . . . . . 39 - 5.2.3.3. IceRestart . . . . . . . . . . . . . . . . . . . 39 - 5.2.3.4. VoiceActivityDetection . . . . . . . . . . . . . 39 - 5.3. Generating an Answer . . . . . . . . . . . . . . . . . . 40 - 5.3.1. Initial Answers . . . . . . . . . . . . . . . . . . . 40 - 5.3.2. Subsequent Answers . . . . . . . . . . . . . . . . . 45 - 5.3.3. Options Handling . . . . . . . . . . . . . . . . . . 46 - 5.3.3.1. VoiceActivityDetection . . . . . . . . . . . . . 46 - 5.4. Processing a Local Description . . . . . . . . . . . . . 46 - 5.5. Processing a Remote Description . . . . . . . . . . . . . 47 - 5.6. Parsing a Session Description . . . . . . . . . . . . . . 47 - 5.6.1. Session-Level Parsing . . . . . . . . . . . . . . . . 48 - 5.6.2. Media Section Parsing . . . . . . . . . . . . . . . . 50 - 5.6.3. Semantics Verification . . . . . . . . . . . . . . . 52 - 5.7. Applying a Local Description . . . . . . . . . . . . . . 53 - 5.8. Applying a Remote Description . . . . . . . . . . . . . . 54 - 5.9. Applying an Answer . . . . . . . . . . . . . . . . . . . 56 - 6. Configurable SDP Parameters . . . . . . . . . . . . . . . . . 57 - 7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 59 - 7.1. Simple Example . . . . . . . . . . . . . . . . . . . . . 59 - 7.2. Normal Examples . . . . . . . . . . . . . . . . . . . . . 63 - 8. Security Considerations . . . . . . . . . . . . . . . . . . . 72 - 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 72 - 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 72 - 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 73 - 11.1. Normative References . . . . . . . . . . . . . . . . . . 73 - 11.2. Informative References . . . . . . . . . . . . . . . . . 75 - Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 77 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 81 + 4.1.4.1. Use of Provisional Answers . . . . . . . . . . . 23 + 4.1.4.2. Rollback . . . . . . . . . . . . . . . . . . . . 24 + 4.1.5. setLocalDescription . . . . . . . . . . . . . . . . . 25 + 4.1.6. setRemoteDescription . . . . . . . . . . . . . . . . 25 + 4.1.7. currentLocalDescription . . . . . . . . . . . . . . . 26 + 4.1.8. pendingLocalDescription . . . . . . . . . . . . . . . 26 + 4.1.9. currentRemoteDescription . . . . . . . . . . . . . . 26 + 4.1.10. pendingRemoteDescription . . . . . . . . . . . . . . 26 + 4.1.11. canTrickleIceCandidates . . . . . . . . . . . . . . . 27 + 4.1.12. setConfiguration . . . . . . . . . . . . . . . . . . 27 + 4.1.13. addIceCandidate . . . . . . . . . . . . . . . . . . . 28 + 5. SDP Interaction Procedures . . . . . . . . . . . . . . . . . 28 + 5.1. Requirements Overview . . . . . . . . . . . . . . . . . . 28 + 5.1.1. Implementation Requirements . . . . . . . . . . . . . 29 + 5.1.2. Usage Requirements . . . . . . . . . . . . . . . . . 30 + 5.1.3. Profile Names and Interoperability . . . . . . . . . 30 + 5.2. Constructing an Offer . . . . . . . . . . . . . . . . . . 31 + 5.2.1. Initial Offers . . . . . . . . . . . . . . . . . . . 31 + 5.2.2. Subsequent Offers . . . . . . . . . . . . . . . . . . 37 + 5.2.3. Options Handling . . . . . . . . . . . . . . . . . . 40 + 5.2.3.1. IceRestart . . . . . . . . . . . . . . . . . . . 40 + 5.2.3.2. VoiceActivityDetection . . . . . . . . . . . . . 40 + 5.2.4. Direction Attribute in Offers . . . . . . . . . . . . 41 + 5.3. Generating an Answer . . . . . . . . . . . . . . . . . . 41 + 5.3.1. Initial Answers . . . . . . . . . . . . . . . . . . . 42 + 5.3.2. Subsequent Answers . . . . . . . . . . . . . . . . . 46 + 5.3.3. Options Handling . . . . . . . . . . . . . . . . . . 47 + 5.3.3.1. VoiceActivityDetection . . . . . . . . . . . . . 47 + 5.3.4. Direction Attribute in Answers . . . . . . . . . . . 47 + 5.4. Processing a Local Description . . . . . . . . . . . . . 48 + 5.5. Processing a Remote Description . . . . . . . . . . . . . 48 + 5.6. Parsing a Session Description . . . . . . . . . . . . . . 49 + 5.6.1. Session-Level Parsing . . . . . . . . . . . . . . . . 50 + 5.6.2. Media Section Parsing . . . . . . . . . . . . . . . . 52 + 5.6.3. Semantics Verification . . . . . . . . . . . . . . . 54 + 5.7. Applying a Local Description . . . . . . . . . . . . . . 55 + 5.8. Applying a Remote Description . . . . . . . . . . . . . . 57 + 5.9. Applying an Answer . . . . . . . . . . . . . . . . . . . 59 + 6. Configurable SDP Parameters . . . . . . . . . . . . . . . . . 60 + 7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 62 + 7.1. Simple Example . . . . . . . . . . . . . . . . . . . . . 62 + 7.2. Normal Examples . . . . . . . . . . . . . . . . . . . . . 66 + 8. Security Considerations . . . . . . . . . . . . . . . . . . . 75 + 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 75 + 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 75 + 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 76 + 11.1. Normative References . . . . . . . . . . . . . . . . . . 76 + 11.2. Informative References . . . . . . . . . . . . . . . . . 78 + Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 80 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 85 1. Introduction This document describes how the W3C WEBRTC RTCPeerConnection interface[W3C.WD-webrtc-20140617] is used to control the setup, management and teardown of a multimedia session. 1.1. General Design of JSEP The thinking behind WebRTC call setup has been to fully specify and @@ -426,28 +430,69 @@ to generate and consume that JSON. Other methods may be added to SessionDescription in the future to simplify handling of SessionDescriptions from Javascript. In the meantime, Javascript libraries can be used to perform these manipulations. Note that most applications should be able to treat the SessionDescriptions produced and consumed by these various API calls as opaque blobs; that is, the application will not need to read or - change them. The W3C WebRTC API specification will provide - appropriate APIs to allow the application to control various session - parameters, which will provide the necessary information to the - browser about what sort of SessionDescription to produce. + change them. -3.4. ICE +3.4. Session Description Control -3.4.1. ICE Gathering Overview + In order to give the application control over various common session + parameters, JSEP provides control surfaces which tell the browser how + to generate session descriptions. This avoids the need for + Javascript to modify session descriptions in most cases. + + Changes to these objects result in changes to the session + descriptions generated by subsequent createOffer/Answer calls. + +3.4.1. RtpTransceivers + + RtpTransceivers allow the application to control the RTP media + associated with one m= section. Each RtpTransceiver has an RtpSender + and an RtpReceiver, which an application can use to control the + sending and receiving of RTP media. The application may also modify + the RtpTransceiver directly, for instance, by stopping it. + + RtpTransceivers generally have a 1:1 mapping with m= sections, + although there may be more RtpTransceivers than m= sections when + RtpTransceivers are created but not yet associated with a m= section, + or if RtpTransceivers have been stopped and disassociated from m= + sections. An RtpTransceiver is never associated with more than one + m= section, and once a session description is applied, a m= section + is always associated with exactly one RtpTransceiver. + + RtpTransceivers can be created explicitly by the application or + implicitly by calling setRemoteDescription with an offer that adds + new m= sections. + +3.4.2. RtpSenders + + RtpSenders allow the application to control how RTP media is sent. + In particular, the application can control whether an RtpSender is + active or not, which affects the directionality attribute of the + associated m= section. + +3.4.3. RtpReceivers + + RtpReceivers allows the application to control how RTP media is + received. In particular, the application can control whether an + RtpReceiver is active or not, which affects the directionality + attribute of the associated m= section. + +3.5. ICE + +3.5.1. ICE Gathering Overview JSEP gathers ICE candidates as needed by the application. Collection of ICE candidates is referred to as a gathering phase, and this is triggered either by the addition of a new or recycled m= line to the local session description, or new ICE credentials in the description, indicating an ICE restart. Use of new ICE credentials can be triggered explicitly by the application, or implicitly by the browser in response to changes in the ICE configuration. When the ICE configuration changes in a way that requires a new @@ -466,21 +511,21 @@ gathered, an event will be dispatched to signal that the gathering process is complete. Note that gathering phases only gather the candidates needed by new/recycled/restarting m= lines; other m= lines continue to use their existing candidates. Also, when bundling is active, candidates are only gathered (and exchanged) for the m= lines referenced in BUNDLE-tags, as described in [I-D.ietf-mmusic-sdp-bundle-negotiation]. -3.4.2. ICE Candidate Trickling +3.5.2. ICE Candidate Trickling Candidate trickling is a technique through which a caller may incrementally provide candidates to the callee after the initial offer has been dispatched; the semantics of "Trickle ICE" are defined in [I-D.ietf-ice-trickle]. This process allows the callee to begin acting upon the call and setting up the ICE (and perhaps DTLS) connections immediately, without having to wait for the caller to gather all possible candidates. This results in faster media setup in cases where gathering is not performed prior to initiating the call. @@ -491,21 +536,21 @@ trickling can send the initial offer immediately and send individual candidates when they get the notified of a new candidate; applications that do not support this feature can simply wait for the indication that gathering is complete, and then create and send their offer, with all the candidates, at this time. Upon receipt of trickled candidates, the receiving application will supply them to its ICE Agent. This triggers the ICE Agent to start using the new remote candidates for connectivity checks. -3.4.2.1. ICE Candidate Format +3.5.2.1. ICE Candidate Format As with session descriptions, the syntax of the IceCandidate object provides some abstraction, but can be easily converted to and from the SDP candidate lines. The candidate lines are the only SDP information that is contained within IceCandidate, as they represent the only information needed that is not present in the initial offer (i.e., for trickle candidates). This information is carried with the same syntax as the "candidate-attribute" field defined for ICE. For example: @@ -517,21 +562,21 @@ one of two ways; either by a m= line index, or a MID. The m= line index is a zero-based index, with index N referring to the N+1th m= line in the SDP sent by the entity which sent the IceCandidate. The MID uses the "media stream identification" attribute, as defined in [RFC5888], Section 4, to identify the m= line. JSEP implementations creating an ICE Candidate object MUST populate both of these fields. Implementations receiving an ICE Candidate object MUST use the MID if present, or the m= line index, if not (as it could have come from a non-JSEP endpoint). -3.4.3. ICE Candidate Policy +3.5.3. ICE Candidate Policy Typically, when gathering ICE candidates, the browser will gather all possible forms of initial candidates - host, server reflexive, and relay. However, in certain cases, applications may want to have more specific control over the gathering process, due to privacy or related concerns. For example, one may want to suppress the use of host candidates, to avoid exposing information about the local network, or go as far as only using relay candidates, to leak as little location information as possible (note that these choices come with corresponding operational costs). To accomplish this, the @@ -554,21 +599,21 @@ To administer the ICE candidate policy, the browser will determine the current setting at the start of each gathering phase. Then, during the gathering phase, the browser MUST NOT expose candidates disallowed by the current policy to the application, use them as the source of connectivity checks, or indirectly expose them via other fields, such as the raddr/rport attributes for other ICE candidates. Later, if a different policy is specified by the application, the application can apply it by kicking off a new gathering phase via an ICE restart. -3.4.4. ICE Candidate Pool +3.5.4. ICE Candidate Pool JSEP applications typically inform the browser to begin ICE gathering via the information supplied to setLocalDescription, as this is where the app specifies the number of media streams, and thereby ICE components, for which to gather candidates. However, to accelerate cases where the application knows the number of ICE components to use ahead of time, it may ask the browser to gather a pool of potential ICE candidates to help ensure rapid media setup. When setLocalDescription is eventually called, and the browser goes @@ -583,30 +628,30 @@ One example of where this concept is useful is an application that expects an incoming call at some point in the future, and wants to minimize the time it takes to establish connectivity, to avoid clipping of initial media. By pre-gathering candidates into the pool, it can exchange and start sending connectivity checks from these candidates almost immediately upon receipt of a call. Note though that by holding on to these pre-gathered candidates, which will be kept alive as long as they may be needed, the application will consume resources on the STUN/TURN servers it is using. -3.5. Video Size Negotiation +3.6. Video Size Negotiation Video size negotiation is the process through which a receiver can use the "a=imageattr" SDP attribute [RFC6236] to indicate what video frame sizes it is capable of receiving. A receiver may have hard limits on what its video decoder can process, or it may wish to constrain what it receives due to application preferences, e.g. a specific size for the window in which the video will be displayed. -3.5.1. Creating an imageattr Attribute +3.6.1. Creating an imageattr Attribute In order to determine the limits on what video resolution a receiver wants to receive, it will intersect its decoder hard limits with any mandatory constraints that have been applied to the associated MediaStreamTrack. If the decoder limits are unknown, e.g. when using a software decoder, the mandatory constraints are used directly. For the answerer, these mandatory constraints can be applied to the remote MediaStreamTracks that are created by a setRemoteDescription call, and will affect the output of the ensuing createAnswer call. Any constraints set after setLocalDescription is used to set the @@ -642,21 +687,21 @@ As an example, consider a system with a HD-capable, multiformat video decoder, where the application has constrained the received track to at most 360p. In this case, the implemention would generate this attribute: a=imageattr:* recv [x=[16:640],y=[16:360],q=1.0] This declaration indicates that the receiver is capable of decoding any image resolution from 16x16 up to 640x360 pixels. -3.5.2. Interpreting an imageattr Attribute +3.6.2. Interpreting an imageattr Attribute [RFC6236] defines "a=imageattr" to be an advisory field. This means that it does not absolutely constrain the video formats that the sender can use, but gives an indication of the preferred values. This specification prescribes more specific behavior. When a sender of a given MediaStreamTrack, which is producing video of a certain resolution, receives an "a=imageattr recv" attribute, it MUST check to see if the original resolution meets the size criteria specified in the attribute, and adapt the resolution accordingly by scaling (if @@ -695,21 +740,21 @@ upscaling. The sender SHOULD NOT upscale in other cases, even if the policy permits it. Upscaling MUST NOT change the track aspect ratio. If there is no appropriate and permitted scaling mechanism that allows the received size limits to be satisfied, the sender MUST NOT transmit the track. In the special case of receiving a maximum resolution of [0, 0], as described above, the sender MUST NOT transmit the track. -3.6. Interactions With Forking +3.7. Interactions With Forking Some call signaling systems allow various types of forking where an SDP Offer may be provided to more than one device. For example, SIP [RFC3261] defines both a "Parallel Search" and "Sequential Search". Although these are primarily signaling level issues that are outside the scope of JSEP, they do have some impact on the configuration of the media plane that is relevant. When forking happens at the signaling layer, the Javascript application responsible for the signaling needs to make the decisions about what media should be sent or received at any point of time, as well as which remote endpoint it @@ -717,21 +762,21 @@ can make the RTP and media perform as required by the application. The basic operations that the applications can have the media engine do are: o Start exchanging media with a given remote peer, but keep all the resources reserved in the offer. o Start exchanging media with a given remote peer, and free any resources in the offer that are not being used. -3.6.1. Sequential Forking +3.7.1. Sequential Forking Sequential forking involves a call being dispatched to multiple remote callees, where each callee can accept the call, but only one active session ever exists at a time; no mixing of received media is performed. JSEP handles sequential forking well, allowing the application to easily control the policy for selecting the desired remote endpoint. When an answer arrives from one of the callees, the application can choose to apply it either as a provisional answer, leaving open the @@ -741,21 +786,21 @@ In a "first-one-wins" situation, the first answer will be applied as a final answer, and the application will reject any subsequent answers. In SIP parlance, this would be ACK + BYE. In a "last-one-wins" situation, all answers would be applied as provisional answers, and any previous call leg will be terminated. At some point, the application will end the setup process, perhaps with a timer; at this point, the application could reapply the pending remote description as a final answer. -3.6.2. Parallel Forking +3.7.2. Parallel Forking Parallel forking involves a call being dispatched to multiple remote callees, where each callee can accept the call, and multiple simultaneous active signaling sessions can be established as a result. If multiple callees send media at the same time, the possibilities for handling this are described in Section 3.1 of [RFC3960]. Most SIP devices today only support exchanging media with a single device at a time, and do not try to mix multiple early media audio sources, as that could result in a confusing situation. For example, consider having a European ringback tone mixed together with @@ -797,21 +842,21 @@ 4.1.1. Constructor The PeerConnection constructor allows the application to specify global parameters for the media session, such as the STUN/TURN servers and credentials to use when gathering candidates, as well as the initial ICE candidate policy and pool size, and also the bundle policy to use. If an ICE candidate policy is specified, it functions as described in - Section 3.4.3, causing the browser to only surface the permitted + Section 3.5.3, causing the browser to only surface the permitted candidates (including any internal browser filtering) to the application, and only use those candidates for connectivity checks. The set of available policies is as follows: all: All candidates permitted by browser policy will be gathered and used. relay: All candidates except relay candidates will be filtered out. This obfuscates the location information that might be ascertained by the remote peer from the received candidates. Depending on how @@ -881,46 +926,40 @@ does not provide an "a=rtcp-mux" attribute. The default multiplexing policy MUST be set to "require". Implementations MAY choose to reject attempts by the application to set the multiplexing policy to "negotiate". 4.1.2. createOffer The createOffer method generates a blob of SDP that contains a [RFC3264] offer with the supported configurations for the session, - including descriptions of the local MediaStreams attached to this - PeerConnection, the codec/RTP/RTCP options supported by this - implementation, and any candidates that have been gathered by the ICE - Agent. An options parameter may be supplied to provide additional - control over the generated offer. This options parameter should - allow for the following manipulations to be performed: - - o To indicate support for a media type even if no MediaStreamTracks - of that type have been added to the session (e.g., an audio call - that wants to receive video.) - - o To trigger an ICE restart, for the purpose of reestablishing + including descriptions of the media added to this PeerConnection, the + codec/RTP/RTCP options supported by this implementation, and any + candidates that have been gathered by the ICE Agent. An options + parameter may be supplied to provide additional control over the + generated offer. This options parameter allows an application to + trigger an ICE restart, for the purpose of reestablishing connectivity. In the initial offer, the generated SDP will contain all desired functionality for the session (functionality that is supported but not desired by default may be omitted); for each SDP line, the generation of the SDP will follow the process defined for generating an initial offer from the document that specifies the given SDP line. The exact handling of initial offer generation is detailed in Section 5.2.1 below. In the event createOffer is called after the session is established, createOffer will generate an offer to modify the current session - based on any changes that have been made to the session, e.g. adding - or removing MediaStreams, or requesting an ICE restart. For each + based on any changes that have been made to the session, e.g., adding + or stopping RtpTransceivers, or requesting an ICE restart. For each existing stream, the generation of each SDP line must follow the process defined for generating an updated offer from the RFC that specifies the given SDP line. For each new stream, the generation of the SDP must follow the process of generating an initial offer, as mentioned above. If no changes have been made, or for SDP lines that are unaffected by the requested changes, the offer will only contain the parameters negotiated by the last offer-answer exchange. The exact handling of subsequent offer generation is detailed in Section 5.2.2. below. @@ -937,25 +976,25 @@ credentials, but does not result in candidate gathering, or cause media to start or stop flowing. 4.1.3. createAnswer The createAnswer method generates a blob of SDP that contains a [RFC3264] SDP answer with the supported configuration for the session that is compatible with the parameters supplied in the most recent call to setRemoteDescription, which MUST have been called prior to calling createAnswer. Like createOffer, the returned blob contains - descriptions of the local MediaStreams attached to this - PeerConnection, the codec/RTP/RTCP options negotiated for this - session, and any candidates that have been gathered by the ICE Agent. - An options parameter may be supplied to provide additional control - over the generated answer. + descriptions of the media added to this PeerConnection, the + codec/RTP/RTCP options negotiated for this session, and any + candidates that have been gathered by the ICE Agent. An options + parameter may be supplied to provide additional control over the + generated answer. As an answer, the generated SDP will contain a specific configuration that specifies how the media plane should be established; for each SDP line, the generation of the SDP must follow the process defined for generating an answer from the document that specifies the given SDP line. The exact handling of answer generation is detailed in Section 5.3. below. Session descriptions generated by createAnswer must be immediately usable by setLocalDescription; like createOffer, the returned @@ -1059,20 +1098,34 @@ the state machine to the stable state, and setting the pending local and/or remote description back to null. Any resources or candidates that were allocated by the abandoned local description are discarded; any media that is received will be processed according to the previous local and remote descriptions. Rollback can only be used to cancel proposed changes; there is no support for rolling back from a stable state to a previous stable state. Note that this implies that once the answerer has performed setLocalDescription with his answer, this cannot be rolled back. + A rollback will disassociate any RtpTransceivers that were associated + with m= sections by the application of the rolled-back session + description (see Section 5.8 and Section 5.7). This means that some + RtpTransceivers that were previously associated will no longer be + associated with any m= section; in such cases, the value of the + RtpTransceiver's mid attribute MUST be set to null. RtpTransceivers + that were created by applying a remote offer that was subsequently + rolled back MUST be removed. However, a RtpTransceiver MUST NOT be + removed if the RtpTransceiver's RtpSender was activated by the + addTrack method. This is so that an application may call addTrack, + then call setRemoteDescription with an offer, then roll back that + offer, then call createOffer and have a m= section for the added + track appear in the generated offer. + A rollback is performed by supplying a session description of type "rollback" with empty contents to either setLocalDescription or setRemoteDescription, depending on which was most recently used (i.e. if the new offer was supplied to setLocalDescription, the rollback should be done using setLocalDescription as well). 4.1.5. setLocalDescription The setLocalDescription method instructs the PeerConnection to apply the supplied session description as its local configuration. The @@ -1171,21 +1224,21 @@ null: No SDP has been received from the other side, so it is not known if it can handle trickle. This is the initial value before setRemoteDescription() is called. true: SDP has been received from the other side indicating that it can support trickle. false: SDP has been received from the other side indicating that it cannot support trickle. - As described in Section 3.4.2, JSEP implementations always provide + As described in Section 3.5.2, JSEP implementations always provide candidates to the application individually, consistent with what is needed for Trickle ICE. However, applications can use the canTrickleIceCandidates property to determine whether their peer can actually do Trickle ICE, i.e., whether it is safe to send an initial offer or answer followed later by candidates as they are gathered. As "true" is the only value that definitively indicates remote Trickle ICE support, an application which compares canTrickleIceCandidates against "true" will by default attempt Half Trickle on initial offers and Full Trickle on subsequent interactions with a Trickle ICE-compatible agent. @@ -1193,21 +1246,21 @@ 4.1.12. setConfiguration The setConfiguration method allows the global configuration of the PeerConnection, which was initially set by constructor parameters, to be changed during the session. The effects of this method call depend on when it is invoked, and differ depending on which specific parameters are changed: o Any changes to the STUN/TURN servers to use affect the next gathering phase. If an ICE gathering phase has already started or - completed, the 'needs-ice-restart' bit mentioned in Section 3.4.1 + completed, the 'needs-ice-restart' bit mentioned in Section 3.5.1 will be set. This will cause the next call to createOffer to generate new ICE credentials, for the purpose of forcing an ICE restart and kicking off a new gathering phase, in which the new servers will be used. If the ICE candidate pool has a nonzero size, any existing candidates will be discarded, and new candidates will be gathered from the new servers. o Any change to the ICE candidate policy affects the next gathering phase. If an ICE gathering phase has already started or completed, the 'needs-ice-restart' bit will be set. Either way, @@ -1227,20 +1280,24 @@ may result in a change to media state if it results in connectivity being established. 4.1.13. addIceCandidate The addIceCandidate method provides a remote candidate to the ICE Agent, which, if parsed successfully, will be added to the current and/or pending remote description according to the rules defined for Trickle ICE. Connectivity checks will be sent to the new candidate. + This method can also be used to provide an end-of-candidates + indication (as defined in [I-D.ietf-ice-trickle]) to the ICE Agent + for all media descriptions in the last remote description. + This call will result in a change to the state of the ICE Agent, and may result in a change to media state if it results in connectivity being established. 5. SDP Interaction Procedures This section describes the specific procedures to be followed when creating and parsing SDP objects. 5.1. Requirements Overview @@ -1430,32 +1487,29 @@ and MUST NOT be included. o A "t=" line MUST be added, as specified in [RFC4566], Section 5.9; both and SHOULD be set to zero, e.g. "t=0 0". o An "a=ice-options" line with the "trickle" option MUST be added, as specified in [I-D.ietf-ice-trickle], Section 4. The next step is to generate m= sections, as specified in [RFC4566] - Section 5.14, for each MediaStreamTrack that has been added to the - PeerConnection via the addStream method. (Note that this method - takes a MediaStream, which can contain multiple MediaStreamTracks, - and therefore multiple m= sections can be generated even if addStream - is only called once.) m=sections MUST be sorted first by the order in - which the MediaStreams were added to the PeerConnection, and then by - the alphabetical ordering of the media type for the MediaStreamTrack. - For example, if a MediaStream containing both an audio and a video - MediaStreamTrack is added to a PeerConnection, the resultant m=audio - section will precede the m=video section. If a second MediaStream - containing an audio MediaStreamTrack was added, it would follow the - m=video section. + Section 5.14. An m= section is generated for each RtpTransceiver + that has been added to the PeerConnection via the addTrack, + addTransceiver, and setRemoteDescription methods. [[OPEN ISSUE: move + discussion of setRemoteDescription to the subsequent-offer section.]] + This is done in the order that their associated RtpTransceivers were + added to the PeerConnection and excludes RtpTranscievers that are + stopped and not associated with an m= section (either due to an m= + section being recycled or an RtpTransceiver having been stopped + before being associated with an m= section) . Each m= section, provided it is not marked as bundle-only, MUST generate a unique set of ICE credentials and gather its own unique set of ICE candidates. Bundle-only m= sections MUST NOT contain any ICE credentials and MUST NOT gather any candidates. For DTLS, all m= sections MUST use the certificate for the identity that has been specified for the PeerConnection; as a result, they MUST all have the same [RFC4572] fingerprint value, or this value MUST be a session-level attribute. @@ -1485,38 +1539,36 @@ o An "a=mid" line, as specified in [RFC5888], Section 4. When generating mid values, it is RECOMMENDED that the values be 3 bytes or less, to allow them to efficiently fit into the RTP header extension defined in [I-D.ietf-mmusic-sdp-bundle-negotiation], Section 11. o An "a=rtcp" line, as specified in [RFC3605], Section 2.1, containing the dummy value "9 IN IP4 0.0.0.0", because no candidates have yet been gathered. - o An "a=msid" line, as specified in [I-D.ietf-mmusic-msid], - Section 2. - - o An "a=sendrecv" line, as specified in [RFC3264], Section 5.1. + o A direction attribute for the associated RtpTransceiver as + described by Section 5.2.4. o For each supported codec, "a=rtpmap" and "a=fmtp" lines, as specified in [RFC4566], Section 6. The audio and video codecs that MUST be supported are specified in [I-D.ietf-rtcweb-audio] (see Section 3) and [I-D.ietf-rtcweb-video] (see Section 5). o If this m= section is for media with configurable frame sizes, e.g. audio, an "a=maxptime" line, indicating the smallest of the maximum supported frame sizes out of all codecs included above, as specified in [RFC4566], Section 6. o If this m= section is for video media, and there are known limitations on the size of images which can be decoded, an - "a=imageattr" line, as specified in Section 3.5. + "a=imageattr" line, as specified in Section 3.6. o For each primary codec where RTP retransmission should be used, a corresponding "a=rtpmap" line indicating "rtx" with the clock rate of the primary codec and an "a=fmtp" line that references the payload type of the primary codec, as specified in [RFC4588], Section 8.1. o For each supported FEC mechanism, "a=rtpmap" and "a=fmtp" lines, as specified in [RFC4566], Section 6. The FEC mechanisms that MUST be supported are specified in [I-D.ietf-rtcweb-fec], @@ -1566,20 +1618,65 @@ with the FEC SSRC, and an "a=ssrc-group" line with semantics set to "FEC-FR" and including the primary and FEC SSRCs, as specified in [RFC5956], section 4.3. For simplicity, if both RTX and FEC are supported, the FEC SSRC MUST be the same as the RTX SSRC. o If the bundle policy for this PeerConnection is set to "max- bundle", and this is not the first m= section, or the bundle policy is set to "balanced", and this is not the first m= section for this media type, an "a=bundle-only" line. + o If the RtpSender of the RtpTransceiver associated with this + m=section is active: + + * An "a=msid" line, as specified in [I-D.ietf-mmusic-msid], + Section 2. + + * An "a=ssrc" line, as specified in [RFC5576], Section 4.1, + indicating the SSRC to be used for sending media, along with + the mandatory "cname" source attribute, as specified in + Section 6.1, indicating the CNAME for the source. The CNAME + MUST be generated in accordance with Section 4.9 of + [I-D.ietf-rtcweb-rtp-usage]. + + * If RTX is supported for this media type, another "a=ssrc" line + with the RTX SSRC, and an "a=ssrc-group" line, as specified in + [RFC5576], section 4.2, with semantics set to "FID" and + including the primary and RTX SSRCs. + + * If FEC is supported for this media type, another "a=ssrc" line + with the FEC SSRC, and an "a=ssrc-group" line with semantics + set to "FEC-FR" and including the primary and FEC SSRCs, as + specified in [RFC5956], section 4.3. For simplicity, if both + RTX and FEC are supported, the FEC SSRC MUST be the same as the + RTX SSRC. + + o If the RtpTransceiver's RtpSender is active, and the application + has specified RID values or has specified more than one encoding + in the RtpSenders's parameters, an "a=rid" line for each encoding + specified. The "a=rid" line is specified in + [I-D.ietf-mmusic-rid], and its direction MUST be "send". If the + application has chosen a RID value, it MUST be used as the rid- + identifier; otherwise a RID value MUST be generated by the + implementation. When generating RID values, it is RECOMMENDED + that the values be 3 bytes or less, to allow them to efficiently + fit into the RTP header extension defined in + [I-D.ietf-avtext-rid], Section 11. If no encodings have been + specified, or only one encoding is specified but without a RID + value, then no "a=rid" lines are generated. + + o If the RtpTransceiver's RtpSender is active and more than one + "a=rid" line has been generated, an "a=simulcast" line, with + direction "send", as defined in [I-D.ietf-mmusic-sdp-simulcast], + Section 6.2. The list of RIDs MUST include all of the RID + identifiers used in the "a=rid" lines for this m= section. + Lastly, if a data channel has been created, a m= section MUST be generated for data. The field MUST be set to "application" and the field MUST be set to "UDP/DTLS/SCTP" if the default candidate uses UDP transport, or "TCP/DTLS/SCTP" if the default candidate uses TCP transport [I-D.ietf-mmusic-sctp-sdp]. The "fmt" value MUST be set to "webrtc-datachannel" as specified in [I-D.ietf-mmusic-sctp-sdp], Section 4.1. Within the data m= section, the "a=mid", "a=ice-ufrag", "a=ice-pwd", "a=fingerprint", and "a=setup" lines MUST be included as mentioned @@ -1588,23 +1685,24 @@ [I-D.ietf-mmusic-sctp-sdp], Section 4.1. Once all m= sections have been generated, a session-level "a=group" attribute MUST be added as specified in [RFC5888]. This attribute MUST have semantics "bundle", and MUST include the mid identifiers of each m= section. The effect of this is that the browser offers all m= sections as one bundle group. However, whether the m= sections are bundle-only or not depends on the bundle policy. The next step is to generate session-level lip sync groups as defined - in [RFC5888], Section 7. For each MediaStream with more than one - MediaStreamTrack, a group of type "LS" MUST be added that contains - the mid values for each MediaStreamTrack in that MediaStream. + in [RFC5888], Section 7. For each MediaStream referenced by more + than one RtpTransceiver (by passing those MediaStreams as arguments + to the addTrack and addTransceiver methods), a group of type "LS" + MUST be added that contains the mid values for each RtpTransceiver. Attributes which SDP permits to either be at the session level or the media level SHOULD generally be at the media level even if they are identical. This promotes readability, especially if one of a set of initially identical attributes is subsequently changed. Attributes other than the ones specified above MAY be included, except for the following attributes which are specifically incompatible with the requirements of [I-D.ietf-rtcweb-rtp-usage], and MUST NOT be included: @@ -1641,20 +1739,42 @@ candidates. If the initial offer was applied using setLocalDescription, but an answer from the remote side has not yet been applied, meaning the PeerConnection is still in the "local-offer" state, an offer is generated by following the steps in the "stable" state above, along with these exceptions: o The "s=" and "t=" lines MUST stay the same. + o If any RtpTransceiver has been added, and there exists an m= + section with a zero port in the current local description or the + current remote description, that m= section MUST be recycled by + generating an m= section for the added RtpTransceiver as if the m= + section were being added to the session description, placed at the + same index as the m= section with a zero port. + + o If an RtpTransceiver is stopped and is not associated with an m= + section, an m= section MUST NOT be generated for it. This + prevents adding back RtpTransceivers whose m= sections were + recycled and used for a new RtpTransceiver in a previous offer/ + answer exchange, as described above. + + o If an RtpTransceiver has been stopped and is associated with an m= + section, and the m= section is not being recycled as described + above, an m= section MUST be generated for it with the port set to + zero and the "a=msid", "a=ssrc", and "a=ssrc-group" lines removed. + + o For RtpTransceivers that are not stopped, the "a=msid", "a=ssrc", + and "a=ssrc-group" lines MUST stay the same if they are present in + the current description. + o Each "m=" and c=" line MUST be filled in with the port, protocol, and address of the default candidate for the m= section, as described in [RFC5245], Section 4.3. If ICE checking has already completed for one or more candidate pairs and a candidate pair is in active use, then that pair MUST be used, even if ICE has not yet completed. Note that this differs from the guidance in [RFC5245], Section 9.1.2.2, which only refers to offers created when ICE has completed. Each "a=rtcp" attribute line MUST also be filled in with the port and address of the appropriate default candidate, either the default RTP or RTCP candidate, depending on @@ -1663,79 +1783,61 @@ default RTCP candidate MUST be used, as indicated in [RFC5761], section 5.1.3. In each case, if no candidates of the desired type have yet been gathered, dummy values MUST be used, as described above. o Each "a=mid" line MUST stay the same. o Each "a=ice-ufrag" and "a=ice-pwd" line MUST stay the same, unless the ICE configuration has changed (either changes to the supported STUN/TURN servers, or the ICE candidate policy), or the - "IceRestart" option (Section 5.2.3.3 was specified. If the m= + "IceRestart" option (Section 5.2.3.1 was specified. If the m= section is bundled into another m= section, it still MUST NOT contain any ICE credentials. o If the m= section is not bundled into another m= section, for each candidate that has been gathered during the most recent gathering - phase (see Section 3.4.1), an "a=candidate" line MUST be added, as + phase (see Section 3.5.1), an "a=candidate" line MUST be added, as defined in [RFC5245], Section 4.3., paragraph 3. If candidate gathering for the section has completed, an "a=end-of-candidates" attribute MUST be added, as described in [I-D.ietf-ice-trickle], Section 9.3. If the m= section is bundled into another m= section, both "a=candidate" and "a=end-of-candidates" MUST be omitted. - o For MediaStreamTracks that are still present, the "a=msid", + o For RtpTransceivers that are still present, the "a=msid", "a=ssrc", and "a=ssrc-group" lines MUST stay the same. - o If any MediaStreamTracks have been removed, either through the - removeStream method or by removing them from an added MediaStream, - their m= sections MUST be marked as recvonly by changing the value - of the [RFC3264] directional attribute to "a=recvonly". The - "a=msid", "a=ssrc", and "a=ssrc-group" lines MUST be removed from - the associated m= sections. + o For RtpTransceivers that are still present, the "a=rid" lines MUST + stay the same. - o If any MediaStreamTracks have been added, and there exist m= - sections of the appropriate media type with no associated - MediaStreamTracks (i.e. as described in the preceding paragraph), - those m= sections MUST be recycled by adding the new - MediaStreamTrack to the m= section. This is done by adding the - necessary "a=msid", "a=ssrc", and "a=ssrc-group" lines to the - recycled m= section, and removing the "a=recvonly" attribute. + o For RtpTransceivers that are still present, any "a=simulcast" line + MUST stay the same. + + o If any RtpTransceiver has been stopped, the port MUST be set to + zero and the "a=msid", "a=ssrc", and "a=ssrc-group" lines MUST be + removed. + + o If any RtpTransceiver has been added, and there exists a m= + section with a zero port in the current local description or the + current remote description, that m= section MUST be recycled by + generating a m= section for the added RtpTransceiver as if the m= + section were being added to session description, except that + instead of adding it, the generated m= section replaces the m= + section with a zero port. If the initial offer was applied using setLocalDescription, and an answer from the remote side has been applied using setRemoteDescription, meaning the PeerConnection is in the "remote- pranswer" or "stable" states, an offer is generated based on the negotiated session descriptions by following the steps mentioned for - the "local-offer" state above, along with these exceptions: - - o If a m= section exists in the current local description, but does - not have an associated local MediaStreamTrack (possibly because - said MediaStreamTrack was removed since the last exchange), a m= - section MUST still be generated in the new offer, as indicated in - [RFC3264], Section 8. The disposition of this section will depend - on the state of the remote MediaStreamTrack associated with this - m= section. If one exists, and it is still in the "live" state, - the new m= section MUST be marked as "a=recvonly", with no - "a=msid" or related attributes present. If no remote - MediaStreamTrack exists, or it is in the "ended" state, the m= - section MUST be marked as rejected, by setting the port to zero, - as indicated in [RFC3264], Section 8.2. - - o If any MediaStreamTracks have been added, and there exist recvonly - m= sections of the appropriate media type with no associated - MediaStreamTracks, or rejected m= sections of any media type, - those m= sections MUST be recycled, and a local MediaStreamTrack - associated with these recycled m= sections until all such existing - m= sections have been used. This includes any recvonly or - rejected m= sections created by the preceding paragraph. + the "local-offer" state above. In addition, for each non-recycled, non-rejected m= section in the new offer, the following adjustments are made based on the contents of the corresponding m= section in the current remote description: o The m= line and corresponding "a=rtpmap" and "a=fmtp" lines MUST only include codecs present in the remote description. o The RTP header extensions MUST only include those that are present in the remote description. @@ -1757,78 +1859,33 @@ are still alive, as well as any new m= sections. The "LS" groups are generated in the same way as with initial offers. 5.2.3. Options Handling The createOffer method takes as a parameter an RTCOfferOptions object. Special processing is performed when generating a SDP description if the following options are present. -5.2.3.1. OfferToReceiveAudio - - If the "OfferToReceiveAudio" option is specified, with an integer - value of N, and M audio MediaStreamTracks have been added to the - PeerConnection, the offer MUST include N non-rejected m= sections - with media type "audio", even if N is greater than M. This allows - the offerer to receive audio, including multiple independent streams, - even when not sending it; accordingly, the directional attribute on - the N-M audio m= sections without associated MediaStreamTracks MUST - be set to recvonly. - - If N is set to a value less than M, the offer MUST mark the m= - sections associated with the M-N most recently added (since the last - setLocalDescription) MediaStreamTracks as sendonly. This allows the - offerer to indicate that it does not want to receive audio on some or - all of its newly created streams. For m= sections that have - previously been negotiated, this setting has no effect. [TODO: refer - to RTCRtpSender in the future] - For backwards compatibility with pre-standard versions of this - specification, a value of "true" is interpreted as equivalent to N=1, - and "false" as N=0. - -5.2.3.2. OfferToReceiveVideo - - If the "OfferToReceiveVideo" option is specified, with an integer - value of N, and M video MediaStreamTracks have been added to the - PeerConnection, the offer MUST include N non-rejected m= sections - with media type "video", even if N is greater than M. This allows - the offerer to receive video, including multiple independent streams, - even when not sending it; accordingly, the directional attribute on - the N-M video m= sections without associated MediaStreamTracks MUST - be set to recvonly. - - If N is set to a value less than M, the offer MUST mark the m= - sections associated with the M-N most recently added (since the last - setLocalDescription) MediaStreamTracks as sendonly. This allows the - offerer to indicate that it does not want to receive video on some or - all of its newly created streams. For m= sections that have - previously been negotiated, this setting has no effect. [TODO: refer - to RTCRtpSender in the future] - - For backwards compatibility with pre-standard versions of this - specification, a value of "true" is interpreted as equivalent to N=1, - and "false" as N=0. - -5.2.3.3. IceRestart +5.2.3.1. IceRestart If the "IceRestart" option is specified, with a value of "true", the offer MUST indicate an ICE restart by generating new ICE ufrag and pwd attributes, as specified in [RFC5245], Section 9.1.1.1. If this option is specified on an initial offer, it has no effect (since a new ICE ufrag and pwd are already generated). Similarly, if the ICE configuration has changed, this option has no effect, since new ufrag and pwd attributes will be generated automatically. This option is primarily useful for reestablishing connectivity in cases where failures are detected by the application. -5.2.3.4. VoiceActivityDetection +5.2.3.2. VoiceActivityDetection If the "VoiceActivityDetection" option is specified, with a value of "true", the offer MUST indicate support for silence suppression in the audio it receives by including comfort noise ("CN") codecs for each offered audio codec, as specified in [RFC3389], Section 5.1, except for codecs that have their own internal silence suppression support. For codecs that have their own internal silence suppression support, the appropriate fmtp parameters for that codec MUST be specified to indicate that silence suppression for received audio is desired. For example, when using the Opus codec, the "usedtx=1" @@ -1847,20 +1904,35 @@ Note that setting the "VoiceActivityDetection" parameter when generating an offer is a request to receive audio with silence suppression. It has no impact on whether the local endpoint does silence suppression for the audio it sends. The "VoiceActivityDetection" option does not have any impact on the setting of the "vad" value in the signaling of the client to mixer audio level header extension described in [RFC6464], Section 4. +5.2.4. Direction Attribute in Offers + + [RFC3264] direction attributes (defined in Section 6.1) in offers are + chosen according to the states of the RtpSender and RtpReceiver of a + given RtpTransceiver, as follows: + + +-----------+-------------+-----------------+ + | RtpSender | RtpReceiver | offer direction | + +-----------+-------------+-----------------+ + | active | active | sendrecv | + | active | inactive | sendonly | + | inactive | active | recvonly | + | inactive | inactive | inactive | + +-----------+-------------+-----------------+ + 5.3. Generating an Answer When createAnswer is called, a new SDP description must be created that is compatible with the supplied remote description as well as the requirements specified in [I-D.ietf-rtcweb-rtp-usage]. The exact details of this process are explained below. 5.3.1. Initial Answers When createAnswer is called for the first time after a remote @@ -1877,55 +1949,46 @@ rejected. The first step in generating an initial answer is to generate session-level attributes. The process here is identical to that indicated in the Initial Offers section above, except that the "a=ice-options" line, with the "trickle" option as specified in [I-D.ietf-ice-trickle], Section 4, is only included if such an option was present in the offer. The next step is to generate lip sync groups as defined in [RFC5888], - Section 7. For each MediaStream with more than one MediaStreamTrack, - a group of type "LS" MUST be added that contains the mid values for - each MediaStreamTrack in that MediaStream. In some cases this may - result in adding a mid to a given LS group that was not in that LS - group in the associated offer. Although this is not allowed by - [RFC5888], it is allowed when implementing this specification. - [[OPEN ISSUE: This is still under discussion. See: + Section 7. For each MediaStream with more than one referenced + RtpTransceiver, a group of type "LS" MUST be added that contains the + mid values for each RtpTransceiver added with that MediaStream. In + some cases this may result in adding a mid to a given LS group that + was not in that LS group in the associated offer. Although this is + not allowed by [RFC5888], it is allowed when implementing this + specification. [[OPEN ISSUE: This is still under discussion. See: https://github.com/rtcweb-wg/jsep/issues/162.]] The next step is to generate m= sections for each m= section that is present in the remote offer, as specified in [RFC3264], Section 6. For the purposes of this discussion, any session-level attributes in the offer that are also valid as media-level attributes SHALL be considered to be present in each m= section. - The next step is to go through each offered m= section. If there is - a local MediaStreamTrack of the same type which has been added to the - PeerConnection via addStream and not yet associated with a m= - section, and the specific m= section is either sendrecv or recvonly, - the MediaStreamTrack will be associated with the m= section at this - time. MediaStreamTracks are assigned to m= sections using the - canonical order described in Section 5.2.1. If there are more m= - sections of a certain type than MediaStreamTracks, some m= sections - will not have an associated MediaStreamTrack. If there are more - MediaStreamTracks of a certain type than compatible m= sections, only - the first N MediaStreamTracks will be able to be associated in the - constructed answer. The remainder will need to be associated in a - subsequent offer. + The next step is to go through each offered m= section. Each offered + m= section will have an associated RtpTransceiver, as described in + Section 5.8. If there are more RtpTransceivers than there are m= + sections, the unmatched RtpTransceivers will need to be associated in + a subsequent offer. - For each offered m= section, if the associated remote - MediaStreamTrack has been stopped, and is therefore in state "ended", - and no local MediaStreamTrack has been associated, the corresponding - m= section in the answer MUST be marked as rejected by setting the - port in the m= line to zero, as indicated in [RFC3264], Section 6., - and further processing for this m= section can be skipped. + For each offered m= section, if the associated RtpTransceiver has + been stopped, the corresponding m= section in the answer MUST be + marked as rejected by setting the port in the m= line to zero, as + indicated in [RFC3264], Section 6., and further processing for this + m= section can be skipped. Provided that is not the case, each m= section in the answer should then be generated as specified in [RFC3264], Section 6.1. For the m= line itself, the following rules must be followed: o The port value would normally be set to the port of the default ICE candidate for this m= section, but given that no candidates have yet been gathered, the "dummy" port value of 9 (Discard) MUST be used, as indicated in [I-D.ietf-ice-trickle], Section 5.1. @@ -1943,50 +2006,37 @@ section MUST include the following: o If and only if present in the offer, an "a=mid" line, as specified in [RFC5888], Section 9.1. The "mid" value MUST match that specified in the offer. o An "a=rtcp" line, as specified in [RFC3605], Section 2.1, containing the dummy value "9 IN IP4 0.0.0.0", because no candidates have yet been gathered. - o If a local MediaStreamTrack has been associated, an "a=msid" line, - as specified in [I-D.ietf-mmusic-msid], Section 2. - - o Depending on the directionality of the offer, the disposition of - any associated remote MediaStreamTrack, and the presence of an - associated local MediaStreamTrack, the appropriate directionality - attribute, as specified in [RFC3264], Section 6.1. If the offer - was sendrecv, and the remote MediaStreamTrack is still "live", and - there is a local MediaStreamTrack that has been associated, the - directionality MUST be set as sendrecv. If the offer was - sendonly, and the remote MediaStreamTrack is still "live", the - directionality MUST be set as recvonly. If the offer was - recvonly, and a local MediaStreamTrack has been associated, the - directionality MUST be set as sendonly. If the offer was - inactive, the directionality MUST be set as inactive. + o A direction attribute for the associated RtpTransceiver described + by Section 5.3.4. o For each supported codec that is present in the offer, "a=rtpmap" and "a=fmtp" lines, as specified in [RFC4566], Section 6, and [RFC3264], Section 6.1. The audio and video codecs that MUST be supported are specified in [I-D.ietf-rtcweb-audio] (see Section 3) and [I-D.ietf-rtcweb-video] (see Section 5). o If this m= section is for media with configurable frame sizes, e.g. audio, an "a=maxptime" line, indicating the smallest of the maximum supported frame sizes out of all codecs included above, as specified in [RFC4566], Section 6. o If this m= section is for video media, and there are known limitations on the size of images which can be decoded, an - "a=imageattr" line, as specified in Section 3.5. + "a=imageattr" line, as specified in Section 3.6. o If "rtx" is present in the offer, for each primary codec where RTP retransmission should be used, a corresponding "a=rtpmap" line indicating "rtx" with the clock rate of the primary codec and an "a=fmtp" line that references the payload type of the primary codec, as specified in [RFC4588], Section 8.1. o For each supported FEC mechanism, "a=rtpmap" and "a=fmtp" lines, as specified in [RFC4566], Section 6. The FEC mechanisms that MUST be supported are specified in [I-D.ietf-rtcweb-fec], @@ -2021,39 +2071,44 @@ specified in [I-D.ietf-rtcweb-rtp-usage], Section 5.2. Any header extensions that require encryption MUST be specified as indicated in [RFC6904], Section 4. o For each supported RTCP feedback mechanism that is present in the offer, an "a=rtcp-fb" mechanism, as specified in [RFC4585], Section 4.2. The list of RTCP feedback mechanisms that SHOULD/ MUST be supported is specified in [I-D.ietf-rtcweb-rtp-usage], Section 5.1. - o If a local MediaStreamTrack has been associated, an "a=ssrc" line, - as specified in [RFC5576], Section 4.1, indicating the SSRC to be - used for sending media, along with the mandatory "cname" source - attribute, as specified in Section 6.1, indicating the CNAME for - the source. The CNAME MUST be generated in accordance with - Section 4.9 of [I-D.ietf-rtcweb-rtp-usage]. + o If the RtpSender of the RtpTransceiver associated with this + m=section is active: - o If a local MediaStreamTrack has been associated, and RTX has been - negotiated for this m= section, another "a=ssrc" line with the RTX - SSRC, and an "a=ssrc-group" line, as specified in [RFC5576], - section 4.2, with semantics set to "FID" and including the primary - and RTX SSRCs. + * An "a=msid" line, as specified in [I-D.ietf-mmusic-msid], + Section 2. - o If a local MediaStreamTrack has been associated, and FEC has been - negotiated for this m= section, another "a=ssrc" line with the FEC - SSRC, and an "a=ssrc-group" line with semantics set to "FEC-FR" - and including the primary and FEC SSRCs, as specified in - [RFC5956], section 4.3. For simplicity, if both RTX and FEC are - supported, the FEC SSRC MUST be the same as the RTX SSRC. + * An "a=ssrc" line, as specified in [RFC5576], Section 4.1, + indicating the SSRC to be used for sending media, along with + the mandatory "cname" source attribute, as specified in + Section 6.1, indicating the CNAME for the source. The CNAME + MUST be generated in accordance with Section 4.9 of + [I-D.ietf-rtcweb-rtp-usage]. + + * If RTX has been negotiated for this m= section, another + "a=ssrc" line with the RTX SSRC, and an "a=ssrc-group" line, as + specified in [RFC5576], section 4.2, with semantics set to + "FID" and including the primary and RTX SSRCs. + + * If FEC has been negotiated for this m= section, another + "a=ssrc" line with the FEC SSRC, and an "a=ssrc-group" line + with semantics set to "FEC-FR" and including the primary and + FEC SSRCs, as specified in [RFC5956], section 4.3. For + simplicity, if both RTX and FEC are supported, the FEC SSRC + MUST be the same as the RTX SSRC. If a data channel m= section has been offered, a m= section MUST also be generated for data. The field MUST be set to "application" and the and "fmt" fields MUST be set to exactly match the fields in the offer. Within the data m= section, the "a=mid", "a=ice-ufrag", "a=ice-pwd", "a=candidate", "a=fingerprint", and "a=setup" lines MUST be included as mentioned above, along with an "a=fmtp:webrtc-datachannel" line and an "a=sctp-port" line referencing the SCTP port number as defined @@ -2109,56 +2164,74 @@ above. o Each "a=ice-ufrag" and "a=ice-pwd" line MUST stay the same, unless the m= section is restarting, in which case new ICE credentials must be created as specified in [RFC5245], Section 9.2.1.1. If the m= section is bundled into another m= section, it still MUST NOT contain any ICE credentials. o If the m= section is not bundled into another m= section, for each candidate that has been gathered during the most recent gathering - phase (see Section 3.4.1), an "a=candidate" line MUST be added, as + phase (see Section 3.5.1), an "a=candidate" line MUST be added, as defined in [RFC5245], Section 4.3., paragraph 3. If candidate gathering for the section has completed, an "a=end-of-candidates" attribute MUST be added, as described in [I-D.ietf-ice-trickle], Section 9.3. If the m= section is bundled into another m= section, both "a=candidate" and "a=end-of-candidates" MUST be omitted. - o For MediaStreamTracks that are still present, the "a=msid", - "a=ssrc", and "a=ssrc-group" lines MUST stay the same. + o For RtpTransceivers that are not stopped, the "a=msid", "a=ssrc", + and "a=ssrc-group" lines MUST stay the same. 5.3.3. Options Handling The createAnswer method takes as a parameter an RTCAnswerOptions object. The set of parameters for RTCAnswerOptions is different than - those supported in RTCOfferOptions; the OfferToReceiveAudio, - OfferToReceiveVideo, and IceRestart options mentioned in - Section 5.2.3 are meaningless in the context of generating an answer, - as there is no need to generate extra m= lines in an answer, and ICE - credentials will automatically be changed for all m= lines where the - offerer chose to perform ICE restart. + those supported in RTCOfferOptions; the IceRestart option is + unnecessary, as ICE credentials will automatically be changed for all + m= lines where the offerer chose to perform ICE restart. The following options are supported in RTCAnswerOptions. 5.3.3.1. VoiceActivityDetection Silence suppression in the answer is handled as described in - Section 5.2.3.4, with one exception: if support for silence + Section 5.2.3.2, with one exception: if support for silence suppression was not indicated in the offer, the VoiceActivityDetection parameter has no effect, and the answer should be generated as if VoiceActivityDetection was set to false. This is done on a per-codec basis (e.g., if the offerer somehow offered support for CN but set "usedtx=0" for Opus, setting VoiceActivityDetection to true would result in an answer with CN codecs and "usedtx=0"). +5.3.4. Direction Attribute in Answers + + [RFC3264] direction attributes (defined in Section 6.1) in answers + are chosen according to the direction attribute in the remote offer + and the states of the RtpSender and RtpReceiver of the corresponding + RtpTransceiver, as follows: + + +-----------------+-----------+-------------+------------------+ + | offer direction | RtpSender | RtpReceiver | answer direction | + +-----------------+-----------+-------------+------------------+ + | sendrecv | active | active | sendrecv | + | sendrecv | active | inactive | sendonly | + | sendrecv | inactive | active | recvonly | + | sendrecv | inactive | inactive | inactive | + | sendonly | * | active | recvonly | + | sendonly | * | inactive | inactive | + | recvonly | active | * | sendonly | + | recvonly | inactive | * | inactive | + | inactive | * | * | inactive | + +-----------------+-----------+-------------+------------------+ + 5.4. Processing a Local Description When a SessionDescription is supplied to setLocalDescription, the following steps MUST be performed: o First, the type of the SessionDescription is checked against the current state of the PeerConnection: * If the type is "offer", the PeerConnection state MUST be either "stable" or "have-local-offer". @@ -2417,20 +2490,27 @@ o Any "a=remote-candidates" attributes MUST be parsed as specified in [RFC5245], Section 4.3, but their values are ignored. o If present, a single "a=end-of-candidates" attribute MUST be parsed as specified in [I-D.ietf-ice-trickle], Section 8.2, and its presence or absence flagged and stored. o Any "a=imageattr" attributes MUST be parsed as specified in [RFC6236], Section 3, and their values stored. + o Any "a=rid" lines MUST be parsed as specified in + [I-D.ietf-mmusic-rid], Section 10, and their values stored. + + o If present, a single "a=simulcast" line MUST be parsed as + specified in [I-D.ietf-mmusic-sdp-simulcast], and its values + stored. + Otherwise, if the "m=" proto value indicates use of SCTP, the following attribute lines MUST be processed: o The "m=" fmt value MUST be parsed as specified in [I-D.ietf-mmusic-sctp-sdp], Section 4.3, and the application protocol value stored. o An "a=sctp-port" attribute MUST be present, and it MUST be parsed as specified in [I-D.ietf-mmusic-sctp-sdp], Section 5.2, and the value stored. @@ -2455,20 +2535,23 @@ limits specified in [RFC5245], Section 15.4. * DTLS setup value, which MUST be set according to the rules specified in [RFC5763], Section 5, and MUST be consistent with the selected role of the current DTLS connection, if one exists.[TODO: may need revision, i.e., use of actpass * DTLS fingerprint values, where at least one fingerprint MUST be present. + o All RID values referenced in an "a=simulcast" line MUST exist as + "a=rid" lines. + o Each m= section is also checked to ensure prohibited features are not used. If this is a local description, the "ice-lite" attribute MUST NOT be specified. If this session description is of type "pranswer" or "answer", the following additional checks are applied: o The session description must follow the rules defined in [RFC3264], Section 6, including the requirement that the number of m= sections MUST exactly match the number of m= sections in the @@ -2497,20 +2580,31 @@ as defined in [RFC5245], Section 4.1.1, unless it has been marked as bundle-only. o Or, if the ICE ufrag and password values have changed, trigger the ICE Agent to start an ICE restart and begin gathering new candidates for the media section, as defined in [RFC5245], Section 9.1.1.1, unless it has been marked as bundle-only. o If the media section proto value indicates use of RTP: + * If there is no RtpTransceiver associated with this m= section + (which should only happen when applying an offer), find one and + associate it with this m= section according to the following + steps: + + + Find the RtpTransceiver that corresponds to the m= section + with the same MID in the created offer. + + + Set the value of the RtpTransceiver's mid attribute to the + MID of the m= section. + * If RTCP mux is indicated, prepare to demux RTP and RTCP from the RTP ICE component, as specified in [RFC5761], Section 5.1.1. If RTCP mux is not indicated, but was indicated in a previous description, this MUST result in an error. * For each specified RTP header extension, establish a mapping between the extension ID and URI, as described in section 6 of [RFC5285]. If any indicated RTP header extension is unknown, this MUST result in an error. @@ -2571,24 +2665,51 @@ restart is needed. o Configure the ICE components associated with this media section to use the supplied ICE remote ufrag and password for their connectivity checks. o Pair any supplied ICE candidates with any gathered local candidates, as described in Section 5.7 of [RFC5245] and start connectivity checks with the appropriate credentials. + o If an "a=end-of-candidates" attribute is present, process the end- + of-candidates indication as described in [I-D.ietf-ice-trickle] + Section 11. + o If the media section proto value indicates use of RTP: * [TODO: header extensions] + * If the m= section is being recycled (see Section 5.2.2), + dissociate the currently associated RtpTransceiver by setting + its mid attribute to null. + + * If the m= section is not associated with any RtpTransceiver + (possibly because it was dissociated in the previous step), + either find an RtpTransceiver or create one according to the + following steps: + + + If the m= section is sendrecv or recvonly, and there are + RtpTransceivers of the same type that were added to the + PeerConnection by addTrack and are not associated with any + m= section and are not stopped, find the first (according to + the canonical order described in Section 5.2.1) such + RtpTransceiver. + + + If no RtpTransceiver was found in the previous step, create + one with an inactive RtpSender and active RtpReceiver. + + + Associate the found or created RtpTransceiver with the m= + section by setting the value of the RtpTransceiver's mid + attribute to the MID of the m= section. + * For each specified payload type that is also supported by the local implementation, establish a mapping between the payload type ID and the actual media format. [TODO - Justin to add more to explain mapping.] If any indicated payload type is unknown, it MUST be ignored. [TODO: should fail on answers] * For each specified "rtx" media format, establish a mapping between the RTX payload type and its associated primary payload type, as described in [RFC4588]. If any referenced primary payload types are not present, this MUST result in an error. @@ -2663,23 +2784,28 @@ MUST result in an error. * If the media section has reduced-size RTCP enabled, configure the RTCP transmission for this media section to use reduced- size RTCP, as specified in [RFC5506]. * If the directional attribute in the answer is of type "sendrecv" or "sendonly", prepare to start transmitting media using the specified primary SSRC and one of the selected payload types, once the underlying transport layers have been - established. Otherwise, stop transmitting RTP media, although - RTCP should still be sent, as described in [RFC3264], - Section 5.1. + established. If RID values are specified, include the RID + header extension in the RTP streams, as indicated in + [I-D.ietf-mmusic-rid], Section 4). If simulcast is negotiated, + send the number of Source RTP Streams as specified in + [I-D.ietf-mmusic-sdp-simulcast], Section 6.2.2. If the + directional attribute is of type "recvonly" or "inactive", stop + transmitting RTP media, although RTCP should still be sent, as + described in [RFC3264], Section 5.1. o If the media section proto value indicates use of SCTP: * If no SCTP association yet exists, prepare to initiate a SCTP association over the associated ICE component and DTLS connection, using the local SCTP port value from the local description, and the remote SCTP port value from the remote description, as described in [I-D.ietf-mmusic-sctp-sdp], Section 10.2. @@ -2702,20 +2828,22 @@ Changes MUST NOT be silently ignored. The following elements of the session description MUST NOT be changed between the createOffer and the setLocalDescription (or between the createAnswer and the setLocalDescription), since they reflect transport attributes that are solely under browser control, and the browser MUST NOT honor an attempt to change them: o The number, type and port number of m= lines. + o The generated MID attributes (a=mid). + o The generated ICE credentials (a=ice-ufrag and a=ice-pwd). o The set of ICE candidates and their parameters (a=candidate). o The DTLS fingerprint(s) (a=fingerprint). o The contents of bundle groups, bundle-only parameters, or "a=rtcp- mux" parameters. The following modifications, if done by the browser to a description @@ -2779,40 +2907,40 @@ The flow shows Alice's browser initiating the session to Bob's browser. The messages from Alice's JS to Bob's JS are assumed to flow over some signaling protocol via a web server. The JS on both Alice's side and Bob's side waits for all candidates before sending the offer or answer, so the offers and answers are complete. Trickle ICE is not used. Both Alice and Bob are using the default policy of balanced. // set up local media state AliceJS->AliceUA: create new PeerConnection -AliceJS->AliceUA: addStream with stream containing audio and video +AliceJS->AliceUA: addTrack with two tracks: one for audio and one for video AliceJS->AliceUA: createOffer to get offer AliceJS->AliceUA: setLocalDescription with offer AliceUA->AliceJS: multiple onicecandidate events with candidates // wait for ICE gathering to complete AliceUA->AliceJS: onicecandidate event with null candidate AliceJS->AliceUA: get |offer-A1| from pendingLocalDescription // |offer-A1| is sent over signaling protocol to Bob AliceJS->WebServer: signaling with |offer-A1| WebServer->BobJS: signaling with |offer-A1| // |offer-A1| arrives at Bob BobJS->BobUA: create a PeerConnection BobJS->BobUA: setRemoteDescription with |offer-A1| BobUA->BobJS: onaddstream event with remoteStream // Bob accepts call -BobJS->BobUA: addStream with local media +BobJS->BobUA: addTrack with local tracks BobJS->BobUA: createAnswer BobJS->BobUA: setLocalDescription with answer BobUA->BobJS: multiple onicecandidate events with candidates // wait for ICE gathering to complete BobUA->BobJS: onicecandidate event with null candidate BobJS->BobUA: get |answer-A1| from currentLocalDescription // |answer-A1| is sent over signaling protocol to Alice BobJS->WebServer: signaling with |answer-A1| @@ -2955,21 +3083,21 @@ browsers setting up an audio channel and a data channel. Trickle ICE is used in full trickle mode with a bundle policy of max-bundle, an RTCP mux policy of require, and a single TURN server. Later, two video flows, one for the presenter and one for screen sharing, are added to the session. This example shows Alice's browser initiating the session to Bob's browser. The messages from Alice's JS to Bob's JS are assumed to flow over some signaling protocol via a web server. // set up local media state AliceJS->AliceUA: create new PeerConnection - AliceJS->AliceUA: addStream that contains audio track + AliceJS->AliceUA: addTrack with an audio track AliceJS->AliceUA: createDataChannel to get data channel AliceJS->AliceUA: createOffer to get |offer-B1| AliceJS->AliceUA: setLocalDescription with |offer-B1| // |offer-B1| is sent over signaling protocol to Bob AliceJS->WebServer: signaling with |offer-B1| WebServer->BobJS: signaling with |offer-B1| // |offer-B1| arrives at Bob BobJS->BobUA: create a PeerConnection @@ -2980,21 +3108,21 @@ AliceJS->WebServer: signaling with |candidate-B1| AliceUA->AliceJS: onicecandidate event with |candidate-B2| (srflx) AliceJS->WebServer: signaling with |candidate-B2| WebServer->BobJS: signaling with |candidate-B1| BobJS->BobUA: addIceCandidate with |candidate-B1| WebServer->BobJS: signaling with |candidate-B2| BobJS->BobUA: addIceCandidate with |candidate-B2| // Bob accepts call - BobJS->BobUA: addStream with local audio stream + BobJS->BobUA: addTrack with local audio BobJS->BobUA: createDataChannel to get data channel BobJS->BobUA: createAnswer to get |answer-B1| BobJS->BobUA: setLocalDescription with |answer-B1| // |answer-B1| is sent to Alice BobJS->WebServer: signaling with |answer-B1| WebServer->AliceJS: signaling with |answer-B1| AliceJS->AliceUA: setRemoteDescription with |answer-B1| AliceUA->AliceJS: onaddstream event with audio track from Bob @@ -3014,22 +3142,22 @@ AliceUA->AliceJS: ondatachannel event BobUA->BobJS: onopen AliceUA->AliceJS: onopen // media is flowing between browsers BobUA->AliceUA: audio+data sent from Bob to Alice AliceUA->BobUA: audio+data sent from Alice to Bob // some time later Bob adds two video streams // note, no candidates exchanged, because of bundle - BobJS->BobUA: addStream with first video stream - BobJS->BobUA: addStream with second video stream + BobJS->BobUA: addTrack with first video stream + BobJS->BobUA: addTrack with second video stream BobJS->BobUA: createOffer to get |offer-B2| BobJS->BobUA: setLocalDescription with |offer-B2| // |offer-B2| is sent to Alice BobJS->WebServer: signaling with |offer-B2| WebServer->AliceJS: signaling with |offer-B2| AliceJS->AliceUA: setRemoteDescription with |offer-B2| AliceUA->AliceJS: onaddstream event with first video stream AliceUA->AliceJS: onaddstream event with second video stream AliceJS->AliceUA: createAnswer to get |answer-B2| @@ -3510,20 +3638,36 @@ [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security Version 1.2", RFC 6347, January 2012. [RFC6904] Lennox, J., "Encryption of Header Extensions in the Secure Real-time Transport Protocol (SRTP)", RFC 6904, April 2013. 11.2. Informative References + [I-D.ietf-avtext-rid] + Roach, A., Nandakumar, S., and P. Thatcher, "RTP Stream + Identifier (RID) Source Description (SDES)", draft-ietf- + avtext-rid-00 (work in progress), February 2016. + + [I-D.ietf-mmusic-rid] + Thatcher, P., Zanaty, M., Nandakumar, S., Burman, B., + Roach, A., and B. Campen, "RTP Payload Format + Constraints", draft-ietf-mmusic-rid-04 (work in progress), + February 2016. + + [I-D.ietf-mmusic-sdp-simulcast] + Burman, B., Westerlund, M., Nandakumar, S., and M. Zanaty, + "Using Simulcast in SDP and RTP Sessions", draft-ietf- + mmusic-sdp-simulcast-04 (work in progress), February 2016. + [I-D.nandakumar-rtcweb-sdp] Nandakumar, S. and C. Jennings, "SDP for the WebRTC", draft-nandakumar-rtcweb-sdp-02 (work in progress), July 2013. [I-D.shieh-rtcweb-ip-handling] Shieh, G. and J. Uberti, "WebRTC IP Address Handling Recommendations", draft-shieh-rtcweb-ip-handling-00 (work in progress), October 2015. @@ -3577,20 +3721,29 @@ Bergkvist, A., Burnett, D., Narayanan, A., and C. Jennings, "WebRTC 1.0: Real-time Communication Between Browsers", World Wide Web Consortium WD WD-webrtc- 20140617, June 2014, . Appendix A. Change log Note: This section will be removed by RFC Editor before publication. + Changes in draft-14: + + o Added discussion of RtpTransceivers + RtpSenders + RtpReceivers, + and how they interact with createOffer/createAnswer. + + o Removed obsolete OfferToReceiveX options. + + o Explained how addIceCandidate can be used for end-of-candidates. + Changes in draft-13: o Clarified which SDP lines can be ignored. o Clarified how to handle various received attributes. o Revised how atttributes should be generated for bundled m= lines. o Remove unused references. @@ -3784,21 +3938,21 @@ o Suggested API and examples have been moved to an appendix. Changes in draft -00: o Migrated from draft-uberti-rtcweb-jsep-02. Authors' Addresses Justin Uberti Google - 747 6th Ave S + 747 6th St S Kirkland, WA 98033 USA Email: justin@uberti.name Cullen Jennings Cisco 170 West Tasman Drive San Jose, CA 95134 USA