draft-ietf-rtcweb-jsep-05.txt   draft-ietf-rtcweb-jsep-06.txt 
Network Working Group J. Uberti Network Working Group J. Uberti
Internet-Draft Google Internet-Draft Google
Intended status: Standards Track C. Jennings Intended status: Standards Track C. Jennings
Expires: April 25, 2014 Cisco Expires: August 17, 2014 Cisco
October 22, 2013 February 13, 2014
Javascript Session Establishment Protocol Javascript Session Establishment Protocol
draft-ietf-rtcweb-jsep-05 draft-ietf-rtcweb-jsep-06
Abstract Abstract
This document describes the mechanisms for allowing a Javascript This document describes the mechanisms for allowing a Javascript
application to control the signaling plane of a multimedia session application to control the signaling plane of a multimedia session
via the interface specified in the W3C RTCPeerConnection API, and via the interface specified in the W3C RTCPeerConnection API, and
discusses how this relates to existing signaling protocols. discusses how this relates to existing signaling protocols.
Status of This Memo Status of This Memo
skipping to change at page 1, line 34 skipping to change at page 1, line 34
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 25, 2014. This Internet-Draft will expire on August 17, 2014.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 14 skipping to change at page 2, line 14
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. General Design of JSEP . . . . . . . . . . . . . . . . . 3 1.1. General Design of JSEP . . . . . . . . . . . . . . . . . 3
1.2. Other Approaches Considered . . . . . . . . . . . . . . . 5 1.2. Other Approaches Considered . . . . . . . . . . . . . . . 5
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6
3. Semantics and Syntax . . . . . . . . . . . . . . . . . . . . 6 3. Semantics and Syntax . . . . . . . . . . . . . . . . . . . . 6
3.1. Signaling Model . . . . . . . . . . . . . . . . . . . . . 6 3.1. Signaling Model . . . . . . . . . . . . . . . . . . . . . 6
3.2. Session Descriptions and State Machine . . . . . . . . . 7 3.2. Session Descriptions and State Machine . . . . . . . . . 7
3.3. Session Description Format . . . . . . . . . . . . . . . 9 3.3. Session Description Format . . . . . . . . . . . . . . . 10
3.4. ICE . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.4. ICE . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4.1. ICE Candidate Trickling . . . . . . . . . . . . . . . 10 3.4.1. ICE Candidate Trickling . . . . . . . . . . . . . . . 10
3.4.1.1. ICE Candidate Format . . . . . . . . . . . . . . 10 3.4.1.1. ICE Candidate Format . . . . . . . . . . . . . . 11
3.5. Interactions With Forking . . . . . . . . . . . . . . . . 11 3.4.2. ICE Candidate Pool . . . . . . . . . . . . . . . . . 11
3.5.1. Sequential Forking . . . . . . . . . . . . . . . . . 11 3.5. Interactions With Forking . . . . . . . . . . . . . . . . 12
3.5.2. Parallel Forking . . . . . . . . . . . . . . . . . . 12 3.5.1. Sequential Forking . . . . . . . . . . . . . . . . . 12
3.6. Session Rehydration . . . . . . . . . . . . . . . . . . . 13 3.5.2. Parallel Forking . . . . . . . . . . . . . . . . . . 13
4. Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.6. Session Rehydration . . . . . . . . . . . . . . . . . . . 14
4. Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1. Methods . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.1. Methods . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.1. createOffer . . . . . . . . . . . . . . . . . . . . . 14 4.1.1. Constructor . . . . . . . . . . . . . . . . . . . . . 14
4.1.2. createAnswer . . . . . . . . . . . . . . . . . . . . 15 4.1.2. createOffer . . . . . . . . . . . . . . . . . . . . . 15
4.1.3. SessionDescriptionType . . . . . . . . . . . . . . . 16 4.1.3. createAnswer . . . . . . . . . . . . . . . . . . . . 16
4.1.3.1. Use of Provisional Answers . . . . . . . . . . . 16 4.1.4. SessionDescriptionType . . . . . . . . . . . . . . . 17
4.1.3.2. Rollback . . . . . . . . . . . . . . . . . . . . 17 4.1.4.1. Use of Provisional Answers . . . . . . . . . . . 18
4.1.4. setLocalDescription . . . . . . . . . . . . . . . . . 18 4.1.4.2. Rollback . . . . . . . . . . . . . . . . . . . . 18
4.1.5. setRemoteDescription . . . . . . . . . . . . . . . . 18 4.1.5. setLocalDescription . . . . . . . . . . . . . . . . . 19
4.1.6. localDescription . . . . . . . . . . . . . . . . . . 19 4.1.6. setRemoteDescription . . . . . . . . . . . . . . . . 20
4.1.7. remoteDescription . . . . . . . . . . . . . . . . . . 19 4.1.7. localDescription . . . . . . . . . . . . . . . . . . 20
4.1.8. updateIce . . . . . . . . . . . . . . . . . . . . . . 19 4.1.8. remoteDescription . . . . . . . . . . . . . . . . . . 20
4.1.9. addIceCandidate . . . . . . . . . . . . . . . . . . . 19 4.1.9. updateIce . . . . . . . . . . . . . . . . . . . . . . 20
5. SDP Interaction Procedures . . . . . . . . . . . . . . . . . 20 4.1.10. addIceCandidate . . . . . . . . . . . . . . . . . . . 21
5.1. Requirements Overview . . . . . . . . . . . . . . . . . . 20 5. SDP Interaction Procedures . . . . . . . . . . . . . . . . . 21
5.1.1. Implementation Requirements . . . . . . . . . . . . . 20 5.1. Requirements Overview . . . . . . . . . . . . . . . . . . 21
5.1.2. Usage Requirements . . . . . . . . . . . . . . . . . 21 5.1.1. Implementation Requirements . . . . . . . . . . . . . 21
5.2. Constructing an Offer . . . . . . . . . . . . . . . . . . 22 5.1.2. Usage Requirements . . . . . . . . . . . . . . . . . 23
5.2.1. Initial Offers . . . . . . . . . . . . . . . . . . . 22 5.2. Constructing an Offer . . . . . . . . . . . . . . . . . . 23
5.2.2. Subsequent Offers . . . . . . . . . . . . . . . . . . 26 5.2.1. Initial Offers . . . . . . . . . . . . . . . . . . . 23
5.2.3. Constraints Handling . . . . . . . . . . . . . . . . 28 5.2.2. Subsequent Offers . . . . . . . . . . . . . . . . . . 27
5.2.3.1. OfferToReceiveAudio . . . . . . . . . . . . . . . 28 5.2.3. Constraints Handling . . . . . . . . . . . . . . . . 29
5.2.3.2. OfferToReceiveVideo . . . . . . . . . . . . . . . 28 5.2.3.1. OfferToReceiveAudio . . . . . . . . . . . . . . . 30
5.2.3.3. VoiceActivityDetection . . . . . . . . . . . . . 28 5.2.3.2. OfferToReceiveVideo . . . . . . . . . . . . . . . 30
5.2.3.4. IceRestart . . . . . . . . . . . . . . . . . . . 29 5.2.3.3. VoiceActivityDetection . . . . . . . . . . . . . 30
5.3. Generating an Answer . . . . . . . . . . . . . . . . . . 29 5.2.3.4. IceRestart . . . . . . . . . . . . . . . . . . . 30
5.3.1. Initial Answers . . . . . . . . . . . . . . . . . . . 29 5.3. Generating an Answer . . . . . . . . . . . . . . . . . . 31
5.3.2. Subsequent Answers . . . . . . . . . . . . . . . . . 33 5.3.1. Initial Answers . . . . . . . . . . . . . . . . . . . 31
5.3.3. Constraints Handling . . . . . . . . . . . . . . . . 33 5.3.2. Subsequent Answers . . . . . . . . . . . . . . . . . 35
5.4. Parsing an Offer . . . . . . . . . . . . . . . . . . . . 33 5.3.3. Constraints Handling . . . . . . . . . . . . . . . . 35
5.5. Parsing an Answer . . . . . . . . . . . . . . . . . . . . 33
5.6. Applying a Local Description . . . . . . . . . . . . . . 33 5.4. Parsing an Offer . . . . . . . . . . . . . . . . . . . . 35
5.7. Applying a Remote Description . . . . . . . . . . . . . . 33 5.5. Parsing an Answer . . . . . . . . . . . . . . . . . . . . 35
6. Configurable SDP Parameters . . . . . . . . . . . . . . . . . 33 5.6. Applying a Local Description . . . . . . . . . . . . . . 35
7. Security Considerations . . . . . . . . . . . . . . . . . . . 34 5.7. Applying a Remote Description . . . . . . . . . . . . . . 35
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 6. Configurable SDP Parameters . . . . . . . . . . . . . . . . . 35
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 34 7. Security Considerations . . . . . . . . . . . . . . . . . . . 36
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 36
10.1. Normative References . . . . . . . . . . . . . . . . . . 35 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 36
10.2. Informative References . . . . . . . . . . . . . . . . . 37 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 37
Appendix A. JSEP Implementation Examples . . . . . . . . . . . . 38 10.1. Normative References . . . . . . . . . . . . . . . . . . 37
A.1. Example API Flows . . . . . . . . . . . . . . . . . . . . 38 10.2. Informative References . . . . . . . . . . . . . . . . . 38
A.1.1. Call using ROAP . . . . . . . . . . . . . . . . . . . 38 Appendix A. JSEP Implementation Examples . . . . . . . . . . . . 40
A.1.2. Call using XMPP . . . . . . . . . . . . . . . . . . . 39 A.1. Example API Flows . . . . . . . . . . . . . . . . . . . . 40
A.1.3. Adding video to a call, using XMPP . . . . . . . . . 40 A.1.1. Call using ROAP . . . . . . . . . . . . . . . . . . . 40
A.1.4. Simultaneous add of video streams, using XMPP . . . . 41 A.1.2. Call using XMPP . . . . . . . . . . . . . . . . . . . 41
A.1.5. Call using SIP . . . . . . . . . . . . . . . . . . . 41 A.1.3. Adding video to a call, using XMPP . . . . . . . . . 43
A.1.6. Handling early media (e.g. 1-800-GO FEDEX), using SIP 42 A.1.4. Simultaneous add of video streams, using XMPP . . . . 43
A.2. Example Session Descriptions . . . . . . . . . . . . . . 43 A.1.5. Call using SIP . . . . . . . . . . . . . . . . . . . 44
A.2.1. createOffer . . . . . . . . . . . . . . . . . . . . . 43 A.1.6. Handling early media (e.g. 1-800-GO FEDEX), using SIP 45
A.2.2. createAnswer . . . . . . . . . . . . . . . . . . . . 45 A.2. Example Session Descriptions . . . . . . . . . . . . . . 46
A.2.3. Call Flows . . . . . . . . . . . . . . . . . . . . . 46 A.2.1. createOffer . . . . . . . . . . . . . . . . . . . . . 46
Appendix B. Change log . . . . . . . . . . . . . . . . . . . . . 46 A.2.2. createAnswer . . . . . . . . . . . . . . . . . . . . 48
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 48 A.2.3. Call Flows . . . . . . . . . . . . . . . . . . . . . 50
Appendix B. Change log . . . . . . . . . . . . . . . . . . . . . 50
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 51
1. Introduction 1. Introduction
This document describes how the W3C WEBRTC RTCPeerConnection This document describes how the W3C WEBRTC RTCPeerConnection
interface[W3C.WD-webrtc-20111027] is used to control the setup, interface[W3C.WD-webrtc-20111027] is used to control the setup,
management and teardown of a multimedia session. management and teardown of a multimedia session.
1.1. General Design of JSEP 1.1. General Design of JSEP
The thinking behind WebRTC call setup has been to fully specify and The thinking behind WebRTC call setup has been to fully specify and
skipping to change at page 6, line 45 skipping to change at page 7, line 5
fashion described by [RFC3264] (offer/answer) in order for both sides fashion described by [RFC3264] (offer/answer) in order for both sides
of the session to know how to conduct the session. JSEP provides of the session to know how to conduct the session. JSEP provides
mechanisms to create offers and answers, as well as to apply them to mechanisms to create offers and answers, as well as to apply them to
a session. However, the browser is totally decoupled from the actual a session. However, the browser is totally decoupled from the actual
mechanism by which these offers and answers are communicated to the mechanism by which these offers and answers are communicated to the
remote side, including addressing, retransmission, forking, and glare remote side, including addressing, retransmission, forking, and glare
handling. These issues are left entirely up to the application; the handling. These issues are left entirely up to the application; the
application has complete control over which offers and answers get application has complete control over which offers and answers get
handed to the browser, and when. handed to the browser, and when.
+-----------+ +-----------+ +-----------+ +-----------+
| Web App |<--- App-Specific Signaling -->| Web App | | Web App |<--- App-Specific Signaling -->| Web App |
+-----------+ +-----------+ +-----------+ +-----------+
^ ^ ^ ^
| SDP | SDP | SDP | SDP
V V V V
+-----------+ +-----------+ +-----------+ +-----------+
| Browser |<----------- Media ------------>| Browser | | Browser |<----------- Media ------------>| Browser |
+-----------+ +-----------+ +-----------+ +-----------+
Figure 1: JSEP Signaling Model Figure 1: JSEP Signaling Model
3.2. Session Descriptions and State Machine 3.2. Session Descriptions and State Machine
In order to establish the media plane, the user agent needs specific In order to establish the media plane, the user agent needs specific
parameters to indicate what to transmit to the remote side, as well parameters to indicate what to transmit to the remote side, as well
as how to handle the media that is received. These parameters are as how to handle the media that is received. These parameters are
determined by the exchange of session descriptions in offers and determined by the exchange of session descriptions in offers and
answers, and there are certain details to this process that must be answers, and there are certain details to this process that must be
skipping to change at page 11, line 26 skipping to change at page 11, line 44
The IceCandidate object also contains fields to indicate which m= The IceCandidate object also contains fields to indicate which m=
line it should be associated with. The m line can be identified in line it should be associated with. The m line can be identified in
one of two ways; either by a m-line index, or a MID. The m-line one of two ways; either by a m-line index, or a MID. The m-line
index is a zero-based index, referring to the Nth m-line in the SDP. index is a zero-based index, referring to the Nth m-line in the SDP.
The MID uses the "media stream identification", as defined in The MID uses the "media stream identification", as defined in
[RFC5888] , to identify the m-line. WebRTC implementations creating [RFC5888] , to identify the m-line. WebRTC implementations creating
an ICE Candidate object MUST populate both of these fields. an ICE Candidate object MUST populate both of these fields.
Implementations receiving an ICE Candidate object SHOULD use the MID Implementations receiving an ICE Candidate object SHOULD use the MID
if they implement that functionality, or the m-line index, if not. if they implement that functionality, or the m-line index, if not.
3.4.2. 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 to gather candidates
for. However, to accelerate cases where the browser knows the number
of media streams to use ahead of time, the application 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 to gather the needed ICE candidates, it can
start by checking if any candidates are available in the pool. If
there are candidates in the pool, they can be handed to the
application immediately via the aforementioned candidate callback.
If the pool becomes depleted, either because a larger than expected
number of candidates is needed, or because the pool has not had
enough time to gather candidates, the remaining candidates are
gathered as usual.
3.5. Interactions With Forking 3.5. Interactions With Forking
Some call signaling systems allow various types of forking where an Some call signaling systems allow various types of forking where an
SDP Offer may be provided to more than one device. For example, SIP SDP Offer may be provided to more than one device. For example, SIP
[RFC3261] defines both a "Parallel Search" and "Sequential Search". [RFC3261] defines both a "Parallel Search" and "Sequential Search".
Although these are primarily signaling level issues that are outside Although these are primarily signaling level issues that are outside
the scope of JSEP, they do have some impact on the configuration of the scope of JSEP, they do have some impact on the configuration of
the media plane which is relevant. When forking happens at the the media plane which is relevant. When forking happens at the
signaling layer, the Javascript application responsible for the signaling layer, the Javascript application responsible for the
signaling needs to make the decisions about what media should be sent signaling needs to make the decisions about what media should be sent
skipping to change at page 14, line 9 skipping to change at page 14, line 45
4. Interface 4. Interface
This section details the basic operations that must be present to This section details the basic operations that must be present to
implement JSEP functionality. The actual API exposed in the W3C API implement JSEP functionality. The actual API exposed in the W3C API
may have somewhat different syntax, but should map easily to these may have somewhat different syntax, but should map easily to these
concepts. concepts.
4.1. Methods 4.1. Methods
4.1.1. createOffer 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. The size
of the ICE candidate pool can also be set, if desired; by default the
candidate pool size is zero.
In addition, the application can specify its preferred policy
regarding use of BUNDLE, the multiplexing mechanism defined in
[I-D.ietf-mmusic-sdp-bundle-negotiation]. By specifying a policy
from the list below, the application can control how aggressively it
will try to BUNDLE media streams together. The set of available
policies is as follows:
o "default": The application will BUNDLE all media streams of the
same type together. That is, if there are multiple audio and
multiple video MediaStreamTracks attached to a PeerConnection, all
but the first audio and video tracks will be marked as bundle-
only, and candidates will only be gathered for N media streams,
where N is the number of distinct media types. When talking to a
non-BUNDLE-aware endpoint, only the non-bundle-only streams will
be negotiated. This policy balances desire to multiplex with the
need to ensure basic audio and video still works in legacy cases.
o "max-bundle": The application will BUNDLE all of its media streams
on a single transport. All streams other than the first will be
marked as bundle-only. This policy aims to minimize candidate
gathering and maximize multiplexing, at the cost of less
compatibility with legacy endpoints.
o "max-compat": The application will offer BUNDLE, but mark none of
its streams as bundle-only. This policy will allow all streams to
be received by non-BUNDLE-aware endpoints, but require separate
candidates to be gathered for each media stream.
4.1.2. createOffer
The createOffer method generates a blob of SDP that contains a The createOffer method generates a blob of SDP that contains a
[RFC3264] offer with the supported configurations for the session, [RFC3264] offer with the supported configurations for the session,
including descriptions of the local MediaStreams attached to this including descriptions of the local MediaStreams attached to this
PeerConnection, the codec/RTP/RTCP options supported by this PeerConnection, the codec/RTP/RTCP options supported by this
implementation, and any candidates that have been gathered by the ICE implementation, and any candidates that have been gathered by the ICE
Agent. A constraints parameters may be supplied to provide Agent. A constraints parameter may be supplied to provide additional
additional control over the generated offer. This constraints control over the generated offer. This constraints parameter should
parameter should allow for the following manipulations to be allow for the following manipulations to be performed:
performed:
o To indicate support for a media type even if no MediaStreamTracks 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 of that type have been added to the session (e.g., an audio call
that wants to receive video.) that wants to receive video.)
o To trigger an ICE restart, for the purpose of reestablishing o To trigger an ICE restart, for the purpose of reestablishing
connectivity. connectivity.
o For re-offer cases, to request an offer that contains the full set
of supported capabilities, as opposed to just the currently
negotiated parameters.
In the initial offer, the generated SDP will contain all desired In the initial offer, the generated SDP will contain all desired
functionality for the session (certain parts that are supported but functionality for the session (certain parts that are supported but
not desired by default may be omitted); for each SDP line, the not desired by default may be omitted); for each SDP line, the
generation of the SDP will follow the process defined for generating generation of the SDP will follow the process defined for generating
an initial offer from the document that specifies the given SDP line. an initial offer from the document that specifies the given SDP line.
The exact handling of initial offer generation is detailed in The exact handling of initial offer generation is detailed in
Section 5.2.1. below. Section 5.2.1. below.
In the event createOffer is called after the session is established, In the event createOffer is called after the session is established,
createOffer will generate an offer to modify the current session createOffer will generate an offer to modify the current session
skipping to change at page 15, line 32 skipping to change at page 16, line 37
offer that reflects the current state of the system, so that offer that reflects the current state of the system, so that
setLocalDescription will succeed when it attempts to acquire those setLocalDescription will succeed when it attempts to acquire those
resources. Because this method may need to inspect the system state resources. Because this method may need to inspect the system state
to determine the currently available resources, it may be implemented to determine the currently available resources, it may be implemented
as an async operation. as an async operation.
Calling this method may do things such as generate new ICE Calling this method may do things such as generate new ICE
credentials, but does not result in candidate gathering, or cause credentials, but does not result in candidate gathering, or cause
media to start or stop flowing. media to start or stop flowing.
4.1.2. createAnswer 4.1.3. createAnswer
The createAnswer method generates a blob of SDP that contains a The createAnswer method generates a blob of SDP that contains a
[RFC3264] SDP answer with the supported configuration for the session [RFC3264] SDP answer with the supported configuration for the session
that is compatible with the parameters supplied in the offer. Like that is compatible with the parameters supplied in the offer. Like
createOffer, the returned blob contains descriptions of the local createOffer, the returned blob contains descriptions of the local
MediaStreams attached to this PeerConnection, the codec/RTP/RTCP MediaStreams attached to this PeerConnection, the codec/RTP/RTCP
options negotiated for this session, and any candidates that have options negotiated for this session, and any candidates that have
been gathered by the ICE Agent. A constraints parameter may be been gathered by the ICE Agent. A constraints parameter may be
supplied to provide additional control over the generated answer. supplied to provide additional control over the generated answer.
skipping to change at page 16, line 12 skipping to change at page 17, line 18
usable by setLocalDescription; like createOffer, the returned usable by setLocalDescription; like createOffer, the returned
description should reflect the current state of the system. Because description should reflect the current state of the system. Because
this method may need to inspect the system state to determine the this method may need to inspect the system state to determine the
currently available resources, it may need to be implemented as an currently available resources, it may need to be implemented as an
async operation. async operation.
Calling this method may do things such as generate new ICE Calling this method may do things such as generate new ICE
credentials, but does not trigger candidate gathering or change media credentials, but does not trigger candidate gathering or change media
state. state.
4.1.3. SessionDescriptionType 4.1.4. SessionDescriptionType
Session description objects (RTCSessionDescription) may be of type Session description objects (RTCSessionDescription) may be of type
"offer", "pranswer", and "answer". These types provide information "offer", "pranswer", and "answer". These types provide information
as to how the description parameter should be parsed, and how the as to how the description parameter should be parsed, and how the
media state should be changed. media state should be changed.
"offer" indicates that a description should be parsed as an offer; "offer" indicates that a description should be parsed as an offer;
said description may include many possible media configurations. A said description may include many possible media configurations. A
description used as an "offer" may be applied anytime the description used as an "offer" may be applied anytime the
PeerConnection is in a stable state, or as an update to a previously PeerConnection is in a stable state, or as an update to a previously
supplied but unanswered "offer". supplied but unanswered "offer".
"pranswer" indicates that a description should be parsed as an "pranswer" indicates that a description should be parsed as an
answer, but not a final answer, and so should not result in the answer, but not a final answer, and so should not result in the
freeing of allocated resources. It may result in the start of media freeing of allocated resources. It may result in the start of media
transmission, if the answer does not specify an inactive media transmission, if the answer does not specify an inactive media
direction. A description used as a "pranswer" may be applied as a direction. A description used as a "pranswer" may be applied as a
response to an "offer", or an update to a previously sent "answer". response to an "offer", or an update to a previously sent "pranswer".
"answer" indicates that a description should be parsed as an answer, "answer" indicates that a description should be parsed as an answer,
the offer-answer exchange should be considered complete, and any the offer-answer exchange should be considered complete, and any
resources (decoders, candidates) that are no longer needed can be resources (decoders, candidates) that are no longer needed can be
released. A description used as an "answer" may be applied as a released. A description used as an "answer" may be applied as a
response to a "offer", or an update to a previously sent "pranswer". response to a "offer", or an update to a previously sent "pranswer".
The only difference between a provisional and final answer is that The only difference between a provisional and final answer is that
the final answer results in the freeing of any unused resources that the final answer results in the freeing of any unused resources that
were allocated as a result of the offer. As such, the application were allocated as a result of the offer. As such, the application
can use some discretion on whether an answer should be applied as can use some discretion on whether an answer should be applied as
provisional or final, and can change the type of the session provisional or final, and can change the type of the session
description as needed. For example, in a serial forking scenario, an description as needed. For example, in a serial forking scenario, an
application may receive multiple "final" answers, one from each application may receive multiple "final" answers, one from each
remote endpoint. The application could choose to accept the initial remote endpoint. The application could choose to accept the initial
answers as provisional answers, and only apply an answer as final answers as provisional answers, and only apply an answer as final
when it receives one that meets its criteria (e.g. a live user when it receives one that meets its criteria (e.g. a live user
instead of voicemail). instead of voicemail).
4.1.3.1. Use of Provisional Answers 4.1.4.1. Use of Provisional Answers
Most web applications will not need to create answers using the Most web applications will not need to create answers using the
"pranswer" type. The preferred handling for a web application would "pranswer" type. While it is good practice to send an immediate
be to create and send an "inactive" answer more or less immediately response to an "offer", in order to warm up the session transport and
after receiving the offer, instead of waiting for a human user to prevent media clipping, the preferred handling for a web application
physically answer the call. Later, when the human input is received, would be to create and send an "inactive" final answer immediately
the application can create a new "sendrecv" offer to update the after receiving the offer. Later, when the called user actually
previous offer/answer pair and start the media flow. This approach accepts the call, the application can create a new "sendrecv" offer
is preferred because it minimizes the amount of time that the offer- to update the previous offer/answer pair and start the media flow.
answer exchange is left open, in addition to avoiding media clipping While this could also be done with an inactive "pranswer", followed
by ensuring the transport is ready to go by the time the call is by a sendrecv "answer", the initial "pranswer" leaves the offer-
physically answered. However, some applications may not be able to answer exchange open, which means the caller cannot send an updated
do this, particularly ones that are attempting to gateway to other offer during this time.
signaling protocols. In these cases, "pranswer" can still allow the
application to warm up the transport.
Consider a typical web application that will set up a data channel, As an example, consider a typical web application that will set up a
an audio channel, and a video channel. When an endpoint receives an data channel, an audio channel, and a video channel. When an
offer with these channels, it could send an answer accepting the data endpoint receives an offer with these channels, it could send an
channel for two-way data, and accepting the audio and video tracks as answer accepting the data channel for two-way data, and accepting the
inactive or receive-only. It could then ask the user to accept the audio and video tracks as inactive or receive-only. It could then
call, acquire the local media streams, and send a new offer to the ask the user to accept the call, acquire the local media streams, and
remote side moving the audio and video to be two-way media. By the send a new offer to the remote side moving the audio and video to be
time the human has accepted the call and sent the new offer, it is two-way media. By the time the human has accepted the call and
likely that the ICE and DTLS handshaking for all the channels will triggered the new offer, it is likely that the ICE and DTLS
already be set up. handshaking for all the channels will already be set up.
4.1.3.2. Rollback Of course, some applications may not be able to perform this double
offer-answer exchange, particularly ones that are attempting to
gateway to legacy signaling protocols. In these cases, "pranswer"
can still provide the application with a mechanism to warm up the
transport.
4.1.4.2. Rollback
In certain situations it may be desirable to "undo" a change made to In certain situations it may be desirable to "undo" a change made to
setLocalDescription or setRemoteDescription. Consider a case where a setLocalDescription or setRemoteDescription. Consider a case where a
call is ongoing, and one side wants to change some of the session call is ongoing, and one side wants to change some of the session
parameters; that side generates an updated offer and then calls parameters; that side generates an updated offer and then calls
setLocalDescription. However, the remote side, either before or setLocalDescription. However, the remote side, either before or
after setRemoteDescription, decides it does not want to accept the after setRemoteDescription, decides it does not want to accept the
new parameters, and sends a reject message back to the offerer. Now, new parameters, and sends a reject message back to the offerer. Now,
the offerer, and possibly the answerer as well, need to return to a the offerer, and possibly the answerer as well, need to return to a
stable state and the previous local/remote description. To support stable state and the previous local/remote description. To support
this, we introduce the concept of "rollback". this, we introduce the concept of "rollback".
A rollback returns the state machine to its previous state, and the A rollback discards any proposed changes to the session, returning
local or remote description to its previous value. Any resources or the state machine to the stable state, and setting the modified local
candidates that were allocated by the new local description are and/or remote description back to their previous values. Any
discarded; any media that is received will be processed according to resources or candidates that were allocated by the abandoned local
the previous session description. 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.
A rollback is performed by supplying a session description of type A rollback is performed by supplying a session description of type
"rollback" to either setLocalDescription or setRemoteDescription, "rollback" with empty contents to either setLocalDescription or
depending on which needs to be rolled back (i.e. if the new offer was setRemoteDescription, depending on which was most recently used (i.e.
supplied to setLocalDescription, the rollback should be done on if the new offer was supplied to setLocalDescription, the rollback
setLocalDescription as well.) should be done using setLocalDescription as well).
4.1.4. setLocalDescription 4.1.5. setLocalDescription
The setLocalDescription method instructs the PeerConnection to apply The setLocalDescription method instructs the PeerConnection to apply
the supplied SDP blob as its local configuration. The type field the supplied SDP blob as its local configuration. The type field
indicates whether the blob should be processed as an offer, indicates whether the blob should be processed as an offer,
provisional answer, or final answer; offers and answers are checked provisional answer, or final answer; offers and answers are checked
differently, using the various rules that exist for each SDP line. differently, using the various rules that exist for each SDP line.
This API changes the local media state; among other things, it sets This API changes the local media state; among other things, it sets
up local resources for receiving and decoding media. In order to up local resources for receiving and decoding media. In order to
successfully handle scenarios where the application wants to offer to successfully handle scenarios where the application wants to offer to
skipping to change at page 18, line 36 skipping to change at page 20, line 5
local description is supplied, and the number of transports currently local description is supplied, and the number of transports currently
in use does not match the number of transports needed by the local in use does not match the number of transports needed by the local
description, the PeerConnection will create transports as needed and description, the PeerConnection will create transports as needed and
begin gathering candidates for them. begin gathering candidates for them.
If setRemoteDescription was previous called with an offer, and If setRemoteDescription was previous called with an offer, and
setLocalDescription is called with an answer (provisional or final), setLocalDescription is called with an answer (provisional or final),
and the media directions are compatible, and media are available to and the media directions are compatible, and media are available to
send, this will result in the starting of media transmission. send, this will result in the starting of media transmission.
4.1.5. setRemoteDescription 4.1.6. setRemoteDescription
The setRemoteDescription method instructs the PeerConnection to apply The setRemoteDescription method instructs the PeerConnection to apply
the supplied SDP blob as the desired remote configuration. As in the supplied SDP blob as the desired remote configuration. As in
setLocalDescription, the type field of the indicates how the blob setLocalDescription, the type field of the indicates how the blob
should be processed. should be processed.
This API changes the local media state; among other things, it sets This API changes the local media state; among other things, it sets
up local resources for sending and encoding media. up local resources for sending and encoding media.
If setRemoteDescription was previously called with an offer, and If setRemoteDescription was previously called with an offer, and
setLocalDescription is called with an answer (provisional or final), setLocalDescription is called with an answer (provisional or final),
and the media directions are compatible, and media are available to and the media directions are compatible, and media are available to
send, this will result in the starting of media transmission. send, this will result in the starting of media transmission.
4.1.6. localDescription 4.1.7. localDescription
The localDescription method returns a copy of the current local The localDescription method returns a copy of the current local
configuration, i.e. what was most recently passed to configuration, i.e. what was most recently passed to
setLocalDescription, plus any local candidates that have been setLocalDescription, plus any local candidates that have been
generated by the ICE Agent. generated by the ICE Agent.
TODO: Do we need to expose accessors for both the current and TODO: Do we need to expose accessors for both the current and
proposed local description? proposed local description?
A null object will be returned if the local description has not yet A null object will be returned if the local description has not yet
been established, or if the PeerConnection has been closed. been established, or if the PeerConnection has been closed.
4.1.7. remoteDescription 4.1.8. remoteDescription
The remoteDescription method returns a copy of the current remote The remoteDescription method returns a copy of the current remote
configuration, i.e. what was most recently passed to configuration, i.e. what was most recently passed to
setRemoteDescription, plus any remote candidates that have been setRemoteDescription, plus any remote candidates that have been
supplied via processIceMessage. supplied via processIceMessage.
TODO: Do we need to expose accessors for both the current and TODO: Do we need to expose accessors for both the current and
proposed remote description? proposed remote description?
A null object will be returned if the remote description has not yet A null object will be returned if the remote description has not yet
been established, or if the PeerConnection has been closed. been established, or if the PeerConnection has been closed.
4.1.8. updateIce 4.1.9. updateIce
The updateIce method allows the configuration of the ICE Agent to be The updateIce method allows the configuration of the ICE Agent to be
changed during the session, primarily for changing which types of changed during the session, primarily for changing which types of
local candidates are provided to the application and used for local candidates are provided to the application and used for
connectivity checks. A callee may initially configure the ICE Agent connectivity checks. A callee may initially configure the ICE Agent
to use only relay candidates, to avoid leaking location information, to use only relay candidates, to avoid leaking location information,
but update this configuration to use all candidates once the call is but update this configuration to use all candidates once the call is
accepted. accepted.
Regardless of the configuration, the gathering process collects all Regardless of the configuration, the gathering process collects all
available candidates, but excluded candidates will not be surfaced in available candidates, but excluded candidates will not be surfaced in
onicecandidate callback or used for connectivity checks. onicecandidate callback or used for connectivity checks.
This call may result in a change to the state of the ICE Agent, and This call may 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 may result in a change to media state if it results in connectivity
being established. being established.
4.1.9. addIceCandidate 4.1.10. addIceCandidate
The addIceCandidate method provides a remote candidate to the ICE The addIceCandidate method provides a remote candidate to the ICE
Agent, which, if parsed successfully, will be added to the remote Agent, which, if parsed successfully, will be added to the remote
description according to the rules defined for Trickle ICE. description according to the rules defined for Trickle ICE.
Connectivity checks will be sent to the new candidate. Connectivity checks will be sent to the new candidate.
This call will result in a change to the state of the ICE Agent, and 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 may result in a change to media state if it results in connectivity
being established. being established.
skipping to change at page 20, line 36 skipping to change at page 21, line 51
The second set of specifications is the "mandatory-to-use" set. The The second set of specifications is the "mandatory-to-use" set. The
local JSEP endpoint and any remote endpoint must indicate support for local JSEP endpoint and any remote endpoint must indicate support for
these specifications in their session descriptions. these specifications in their session descriptions.
5.1.1. Implementation Requirements 5.1.1. Implementation Requirements
This list of mandatory-to-implement specifications is derived from This list of mandatory-to-implement specifications is derived from
the requirements outlined in [I-D.ietf-rtcweb-rtp-usage]. the requirements outlined in [I-D.ietf-rtcweb-rtp-usage].
R-1 [RFC4566] is the base SDP specification and MUST be R-1 [RFC4566] is the base SDP specification and MUST be
implemented. implemented.
R-2 [RFC5764] MUST be supported for signaling the UDP/TLS/RTP/SAVPF R-2 [RFC5764] MUST be supported for signaling the UDP/TLS/RTP/SAVPF
RTP profile. RTP profile.
R-3 [RFC5245] MUST be implemented for signaling the ICE credentials R-3 [RFC5245] MUST be implemented for signaling the ICE credentials
and candidate lines corresponding to each media stream. The ICE and candidate lines corresponding to each media stream. The
implementation MUST be a Full implementation, not a Lite ICE implementation MUST be a Full implementation, not a Lite
implementation. implementation.
R-4 [RFC5763] MUST be implemented to signal DTLS certificate R-4 [RFC5763] MUST be implemented to signal DTLS certificate
fingerprints. fingerprints.
R-5 [RFC4568] MUST NOT be implemented to signal SDES SRTP keying R-5 [RFC4568] MUST NOT be implemented to signal SDES SRTP keying
information. information.
R-6 The [RFC5888] grouping framework MUST be implemented for R-6 The [RFC5888] grouping framework MUST be implemented for
signaling grouping information, and MUST be used to identify m= signaling grouping information, and MUST be used to identify m=
lines via the a=mid attribute. lines via the a=mid attribute.
R-7 [I-D.ietf-mmusic-msid] MUST be supported, in order to signal R-7 [I-D.ietf-mmusic-msid] MUST be supported, in order to signal
associations between RTP objects and W3C MediaStreams and associations between RTP objects and W3C MediaStreams and
MediaStreamTracks in a standard way. MediaStreamTracks in a standard way.
R-8 The bundle mechanism in R-8 The bundle mechanism in
[I-D.ietf-mmusic-sdp-bundle-negotiation] MUST be supported to [I-D.ietf-mmusic-sdp-bundle-negotiation] MUST be supported to
signal the ability to multiplex RTP streams on a single UDP port, signal the ability to multiplex RTP streams on a single UDP
in order to avoid excessive use of port number resources. port, in order to avoid excessive use of port number resources.
R-9 The SDP attributes of "sendonly", "recvonly", "inactive", and R-9 The SDP attributes of "sendonly", "recvonly", "inactive", and
"sendrecv" from [RFC4566] MUST be implemented to signal "sendrecv" from [RFC4566] MUST be implemented to signal
information about media direction. information about media direction.
R-10 [RFC5576] MUST be implemented to signal RTP SSRC values. R-10 [RFC5576] MUST be implemented to signal RTP SSRC values.
R-11 [RFC4585] MUST be implemented to signal RTCP based feedback. R-11 [RFC4585] MUST be implemented to signal RTCP based feedback.
R-12 [RFC5761] MUST be implemented to signal multiplexing of RTP and R-12 [RFC5761] MUST be implemented to signal multiplexing of RTP and
RTCP. RTCP.
R-13 [RFC5506] MUST be implemented to signal reduced-size RTCP R-13 [RFC5506] MUST be implemented to signal reduced-size RTCP
messages. messages.
R-14 [RFC3556] with bandwidth modifiers MAY be supported for R-14 [RFC3556] with bandwidth modifiers MAY be supported for
specifying RTCP bandwidth as a fraction of the media bandwidth, specifying RTCP bandwidth as a fraction of the media bandwidth,
RTCP fraction allocated to the senders and setting maximum media RTCP fraction allocated to the senders and setting maximum
bit-rate boundaries. media bit-rate boundaries.
As required by [RFC4566], Section 5.13, JSEP implementations MUST As required by [RFC4566], Section 5.13, JSEP implementations MUST
ignore unknown attribute (a=) lines. ignore unknown attribute (a=) lines.
5.1.2. Usage Requirements 5.1.2. Usage Requirements
All session descriptions handled by JSEP endpoints, both local and All session descriptions handled by JSEP endpoints, both local and
remote, MUST indicate support for the following specifications. If remote, MUST indicate support for the following specifications. If
any of these are absent, this omission MUST be treated as an error. any of these are absent, this omission MUST be treated as an error.
R-1 Either the UDP/TLS/RTP/SAVP or the UDP/TLS/RTP/SAVPF RTP R-1 Either the UDP/TLS/RTP/SAVP or the UDP/TLS/RTP/SAVPF RTP
profile, as specified in [RFC5764], MUST be used. profile, as specified in [RFC5764], MUST be used.
R-2 ICE, as specified in [RFC5245], MUST be used. Note that the R-2 ICE, as specified in [RFC5245], MUST be used. Note that the
remote endpoint MAY use a Lite implementation. remote endpoint MAY use a Lite implementation.
R-3 DTLS-SRTP, as specified in [RFC5763], MUST be used. R-3 DTLS-SRTP, as specified in [RFC5763], MUST be used.
5.2. Constructing an Offer 5.2. Constructing an Offer
When createOffer is called, a new SDP description must be created When createOffer is called, a new SDP description must be created
that includes the functionality specified in that includes the functionality specified in
[I-D.ietf-rtcweb-rtp-usage]. The exact details of this process are [I-D.ietf-rtcweb-rtp-usage]. The exact details of this process are
explained below. explained below.
skipping to change at page 23, line 51 skipping to change at page 25, line 15
o To properly indicate use of DTLS, the <proto> field MUST be set to o To properly indicate use of DTLS, the <proto> field MUST be set to
"UDP/TLS/RTP/SAVPF", as specified in [RFC5764], Section 8. "UDP/TLS/RTP/SAVPF", as specified in [RFC5764], Section 8.
Each m= section MUST include the following attribute lines: Each m= section MUST include the following attribute lines:
o An "a=mid" line, as specified in [RFC5888], Section 4. o An "a=mid" line, as specified in [RFC5888], Section 4.
o An "a=msid" line, as specified in [I-D.ietf-mmusic-msid], o An "a=msid" line, as specified in [I-D.ietf-mmusic-msid],
Section 2. Section 2.
o [OPEN ISSUE: Use of App Token versus stream-correlator ] o [OPEN ISSUE: Use of AppID]
o An "a=sendrecv" line, as specified in [RFC3264], Section 5.1. o An "a=sendrecv" line, as specified in [RFC3264], Section 5.1.
o For each supported codec, "a=rtpmap" and "a=fmtp" lines, as o For each supported codec, "a=rtpmap" and "a=fmtp" lines, as
specified in [RFC4566], Section 6. For audio, the codecs specified in [RFC4566], Section 6. For audio, the codecs
specified in [I-D.ietf-rtcweb-audio], Section 3, MUST be be specified in [I-D.ietf-rtcweb-audio], Section 3, MUST be be
supported. supported.
o For each primary codec where RTP retransmission should be used, a o For each primary codec where RTP retransmission should be used, a
corresponding "a=rtpmap" line indicating "rtx" with the clock rate corresponding "a=rtpmap" line indicating "rtx" with the clock rate
of the primary codec and an "a=fmtp" line that references the of the primary codec and an "a=fmtp" line that references the
skipping to change at page 25, line 37 skipping to change at page 26, line 45
[RFC5576], section 4.2, with semantics set to "FID" and including [RFC5576], section 4.2, with semantics set to "FID" and including
the primary and RTX SSRCs. the primary and RTX SSRCs.
o If FEC is supported for this media type, another "a=ssrc" line o If FEC is supported for this media type, another "a=ssrc" line
with the FEC SSRC, and an "a=ssrc-group" line, as specified in with the FEC SSRC, and an "a=ssrc-group" line, as specified in
[RFC5576], section 4.2, with semantics set to "FEC" and including [RFC5576], section 4.2, with semantics set to "FEC" and including
the primary and FEC SSRCs. the primary and FEC SSRCs.
o [OPEN ISSUE: Handling of a=imageattr] o [OPEN ISSUE: Handling of a=imageattr]
o [TODO: bundle-only] 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 "default", and this is not the first m= section
for this media type, an "a=bundle-only" line.
Lastly, if a data channel has been created, a m= section MUST be Lastly, if a data channel has been created, a m= section MUST be
generated for data. The <media> field MUST be set to "application" generated for data. The <media> field MUST be set to "application"
and the <proto> field MUST be set to "DTLS/SCTP", as specified in and the <proto> field MUST be set to "DTLS/SCTP", as specified in
[I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value MUST be set to [I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value MUST be set to
the SCTP port number, as specified in Section 4.1. the SCTP port number, as specified in Section 4.1.
Within the data m= section, the "a=mid", "a=ice-ufrag", "a=ice- Within the data m= section, the "a=mid", "a=ice-ufrag", "a=ice-
passwd", "a=ice-options", "a=candidate", "a=fingerprint", and passwd", "a=ice-options", "a=candidate", "a=fingerprint", and
"a=setup" lines MUST be included as mentioned above, along with an "a=setup" lines MUST be included as mentioned above, along with an
"a=sctpmap" line referencing the SCTP port number and specifying the "a=sctpmap" line referencing the SCTP port number and specifying the
application protocol indicated in [I-D.ietf-rtcweb-data-protocol]. application protocol indicated in [I-D.ietf-rtcweb-data-protocol].
[OPEN ISSUE: the -00 of this document is missing this information.] [OPEN ISSUE: the -01 of this document is missing this information.]
Once all m= sections have been generated, a session-level "a=group" Once all m= sections have been generated, a session-level "a=group"
attribute MUST be added as specified in [RFC5888]. This attribute attribute MUST be added as specified in [RFC5888]. This attribute
MUST have semantics "BUNDLE", and identify the m= sections to be MUST have semantics "BUNDLE", and MUST include the mid identifiers of
bundled. [OPEN ISSUE: Need to determine exactly how this decision is each m= section.
made.]
Attributes that are common between all m= sections MAY be moved to Attributes that are common between all m= sections MAY be moved to
session-level, if desired. session-level, if explicitly defined to be valid at session-level.
Attributes other than the ones specified above MAY be included, Attributes other than the ones specified above MAY be included,
except for the following attributes which are specifically except for the following attributes which are specifically
incompatible with the requirements of [I-D.ietf-rtcweb-rtp-usage], incompatible with the requirements of [I-D.ietf-rtcweb-rtp-usage],
and MUST NOT be included: and MUST NOT be included:
o "a=crypto" o "a=crypto"
o "a=key-mgmt" o "a=key-mgmt"
skipping to change at page 27, line 19 skipping to change at page 28, line 29
o For MediaStreamTracks that are still present, the "a=msid", o For MediaStreamTracks that are still present, the "a=msid",
"a=ssrc", and "a=ssrc-group" lines MUST stay the same. "a=ssrc", and "a=ssrc-group" lines MUST stay the same.
o If any MediaStreamTracks have been removed, either through the o If any MediaStreamTracks have been removed, either through the
removeStream method or by removing them from an added MediaStream, removeStream method or by removing them from an added MediaStream,
their m= sections MUST be marked as recvonly by changing the value their m= sections MUST be marked as recvonly by changing the value
of the [RFC3264] directional attribute to "a=recvonly". The of the [RFC3264] directional attribute to "a=recvonly". The
"a=msid", "a=ssrc", and "a=ssrc-group" lines MUST be removed from "a=msid", "a=ssrc", and "a=ssrc-group" lines MUST be removed from
the associated m= sections. the associated m= sections.
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.
If the initial offer was applied using setLocalDescription, and an If the initial offer was applied using setLocalDescription, and an
answer from the remote side has been applied using answer from the remote side has been applied using
setRemoteDescription, meaning the PeerConnection is in the "remote- setRemoteDescription, meaning the PeerConnection is in the "remote-
pranswer" or "stable" states, an offer is generated based on the pranswer" or "stable" states, an offer is generated based on the
negotiated session descriptions by following the steps mentioned for negotiated session descriptions by following the steps mentioned for
the "local-offer" state above, along with these exceptions: [OPEN the "local-offer" state above, along with these exceptions: [OPEN
ISSUE: should this be permitted in the remote-pranswer state?] ISSUE: should this be permitted in the remote-pranswer state?]
o If a m= section was rejected, i.e. has had its port set to zero in
either the local or remote description, it MUST remain rejected
and have a zero port in the new offer, as indicated in RFC3264,
Section 5.1.
o If a m= section exists in the current local description, but has
its state set to inactive or recvonly, and a new MediaStreamTrack
is added, the previously existing m= section MUST be recycled
instead of creating a new m= section. [OPEN ISSUE: Nail down
exactly what this means. Should the codecs remain the same?
(No.) Should ICE restart? (No.) Can the "a=mid" attribute be
changed? (Yes?)]
o If a m= section exists in the current local description, but does o If a m= section exists in the current local description, but does
not have an associated MediaStreamTrack (i.e. it is inactive or not have an associated local MediaStreamTrack (possibly because
recvonly), a corresponding m= section MUST be generated in the new said MediaStreamTrack was removed since the last exchange), a m=
offer, but without "a=msid", "a=ssrc", or "a=ssrc-group" section MUST still be generated in the new offer, as indicated in
attributes, and the appropriate directional attribute must be [RFC3264], Section 8. The disposition of this section will depend
specified. 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.
In addition, for each previously existing, non-rejected m= section in o If any MediaStreamTracks have been added, and there exist recvonly
the new offer, the following adjustments are made based on the m= sections of the appropriate media type with no associated
contents of the corresponding m= section in the current remote MediaStreamTracks, or rejected m= sections of any media type,
description: those m= sections MUST be recycled, and the local
MediaStreamTracks associated with these recycled m= sections.
This includes any recvonly or rejected m= sections created by the
preceding paragraph.
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 o The m= line and corresponding "a=rtpmap" and "a=fmtp" lines MUST
only include codecs present in the remote description. only include codecs present in the remote description.
o The RTP header extensions MUST only include those that are present o The RTP header extensions MUST only include those that are present
in the remote description. in the remote description.
o The RTCP feedback extensions MUST only include those that are o The RTCP feedback extensions MUST only include those that are
present in the remote description. present in the remote description.
o The "a=rtcp-mux" line MUST only be added if present in the remote o The "a=rtcp-mux" line MUST only be added if present in the remote
description. description.
o The "a=rtcp-rsize" line MUST only be added if present in the o The "a=rtcp-rsize" line MUST only be added if present in the
remote description. remote description.
The "a=group:BUNDLE" attribute MUST include the mid identifiers
specified in the BUNDLE group in the most recent answer, minus any m=
sections that have been marked as rejected, plus any newly added or
re-enabled m= sections. In other words, the BUNDLE attribute must
contain all m= sections that were previously bundled, as long as they
are still alive, as well as any new m= sections.
5.2.3. Constraints Handling 5.2.3. Constraints Handling
The createOffer method takes as a parameter a MediaConstraints The createOffer method takes as a parameter a MediaConstraints
object. Special processing is performed when generating a SDP object. Special processing is performed when generating a SDP
description if the following constraints are present. description if the following constraints are present.
5.2.3.1. OfferToReceiveAudio 5.2.3.1. OfferToReceiveAudio
If the "OfferToReceiveAudio" constraint is specified, with a value of If the "OfferToReceiveAudio" constraint is specified, with a value of
"true", the offer MUST include a non-rejected m= section with media "N", the offer MUST include N non-rejected m= sections with media
type "audio", even if no audio MediaStreamTrack has been added to the type "audio", even if fewer than N audio MediaStreamTracks have been
PeerConnection. This allows the offerer to receive audio even when added to the PeerConnection. This allows the offerer to receive
not sending it; accordingly, the directional attribute on the audio audio, including multiple independent streams, even when not sending
m= section MUST be set to recvonly. If this constraint is specified it; accordingly, the directional attribute on the audio m= sections
when an audio MediaStreamTrack has already been added to the without associated MediaStreamTracks MUST be set to recvonly. If
PeerConnection, or a non-rejected m= section with media type "audio" this constraint is specified in the case where at least N audio
previously existed, it has no effect. MediaStreamTracks have already been added to the PeerConnection, or N
non-rejected m= sections with media type "audio" would otherwise be
generated, it has no effect. For backwards compatibility, a value of
"true" is interpreted as equivalent to N=1.
5.2.3.2. OfferToReceiveVideo 5.2.3.2. OfferToReceiveVideo
If the "OfferToReceiveAudio" constraint is specified, with a value of If the "OfferToReceiveVideo" constraint is specified, with a value of
"true", the offer MUST include a m= section with media type "video", "N", the offer MUST include N non-rejected m= sections with media
even if no video MediaStreamTrack has been added to the type "video", even if fewer than N video MediaStreamTracks have been
PeerConnection. This allows the offerer to receive video even when added to the PeerConnection. This allows the offerer to receive
not sending it; accordingly, the directional attribute on the video video, including multiple independent streams, even when not sending
m= section MUST be set to recvonly. If this constraint is specified it; accordingly, the directional attribute on the video m= sections
when an video MediaStreamTrack has already been added to the without associated MediaStreamTracks MUST be set to recvonly. If
PeerConnection, or a non-rejected m= section with media type "video" this constraint is specified in the case where at least N video
previously existed, it has no effect. MediaStreamTracks have already been added to the PeerConnection, or N
non-rejected m= sections with media type "video" would otherwise be
generated, it has no effect. For backwards compatibility, a value of
"true" is interpreted as equivalent to N=1.
5.2.3.3. VoiceActivityDetection 5.2.3.3. VoiceActivityDetection
If the "VoiceActivityDetection" constraint is specified, with a value If the "VoiceActivityDetection" constraint is specified, with a value
of "true", the offer MUST indicate support for silence suppression by of "true", the offer MUST indicate support for silence suppression by
including comfort noise ("CN") codecs for each supported clock rate, including comfort noise ("CN") codecs for each supported clock rate,
as specified in [RFC3389], Section 5.1. as specified in [RFC3389], Section 5.1.
5.2.3.4. IceRestart 5.2.3.4. IceRestart
If the "IceRestart" constraint is specified, with a value of "true", If the "IceRestart" constraint is specified, with a value of "true",
the offer MUST indicate an ICE restart by generating new ICE ufrag 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 and pwd attributes, as specified in RFC5245, Section 9.1.1.1. If
skipping to change at page 29, line 49 skipping to change at page 31, line 37
The first step in generating an initial answer is to generate The first step in generating an initial answer is to generate
session-level attributes. The process here is identical to that session-level attributes. The process here is identical to that
indicated in the Initial Offers section above. indicated in the Initial Offers section above.
The next step is to generate m= sections for each m= section that is 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. present in the remote offer, as specified in [RFC3264], Section 6.
For the purposes of this discussion, any session-level attributes in For the purposes of this discussion, any session-level attributes in
the offer that are also valid as media-level attributes SHALL be the offer that are also valid as media-level attributes SHALL be
considered to be present in each m= section. considered to be present in each m= section.
If any of the offered m= sections have been rejected, by stopping the For each offered m= section of a given media type, if there is a
associated remote MediaStreamTrack, 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 processing
continues with the next m= section.
For each non-rejected m= section of a given media type, if there is a
local MediaStreamTrack of the specified type which has been added to local MediaStreamTrack of the specified type which has been added to
the PeerConnection via addStream and not yet associated with a m= the PeerConnection via addStream and not yet associated with a m=
section, the MediaStreamTrack is associated with the m= section at section, and the specific m= section is either sendrecv or recvonly,
this time. If there are more m= sections of a certain type than the MediaStreamTrack is associated with the m= section at this time.
If there are more m= sections of a certain type than
MediaStreamTracks, some m= sections will not have an associated MediaStreamTracks, some m= sections will not have an associated
MediaStreamTrack. If there are more MediaStreamTracks of a certain MediaStreamTrack. If there are more MediaStreamTracks of a certain
type than m= sections, only the first N MediaStreamTracks will be type than compatible m= sections, only the first N MediaStreamTracks
able to be associated in the constructed answer. The remainder will will be able to be associated in the constructed answer. The
need to be associated in a subsequent offer. remainder will need to be associated in a subsequent offer.
Each m= section should then generated as specified in [RFC3264], For each offered m= section, if the associated remote
Section 6.1. Because use of DTLS is mandatory, the <proto> field MediaStreamTrack has been stopped, and is therefore in state "ended",
MUST be set to "UDP/TLS/RTP/SAVPF". If the offer supports BUNDLE, and no local MediaStreamTrack has been associated, the corresponding
all m= sections to be BUNDLEd must use the same ICE credentials and m= section in the answer MUST be marked as rejected by setting the
candidates; all m= sections not being BUNDLEd must use unique ICE port in the m= line to zero, as indicated in [RFC3264], Section 6.,
credentials and candidates. Each m= section MUST include the and further processing for this m= section can be skipped.
following:
Provided that is not the case, each m= section in the answer should
then generated as specified in [RFC3264], Section 6.1. Because use
of DTLS is mandatory, the <proto> field MUST be set to "UDP/TLS/RTP/
SAVPF". If the offer supports BUNDLE, all m= sections to be BUNDLEd
must use the same ICE credentials and candidates; all m= sections not
being BUNDLEd must use unique ICE credentials and candidates. Each
m= section MUST include the following:
o If present in the offer, an "a=mid" line, as specified in o If present in the offer, an "a=mid" line, as specified in
[RFC5888], Section 9.1. The "mid" value MUST match that specified [RFC5888], Section 9.1. The "mid" value MUST match that specified
in the offer. in the offer.
o If a local MediaStreamTrack has been associated, an "a=msid" line, o If a local MediaStreamTrack has been associated, an "a=msid" line,
as specified in [I-D.ietf-mmusic-msid], Section 2. as specified in [I-D.ietf-mmusic-msid], Section 2.
o [OPEN ISSUE: Use of App Token versus stream-correlator ] o [OPEN ISSUE: Use of AppID]
o If a local MediaStreamTrack has been associated, an "a=sendrecv" o Depending on the directionality of the offer, the disposition of
line, as specified in [RFC3264], Section 6.1. If no local any associated remote MediaStreamTrack, and the presence of an
MediaStreamTrack has been associated, an "a=recvonly" line. associated local MediaStreamTrack, the appropriate directionality
[TODO: handle non-sendrecv offered m= sections] attribute, as specified in [RFC3264], Section 6.1. If the offer
was sendrecv, and the remote MediaStreamTrack is still "live", and
there a local MediaStreamTrack 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 For each supported codec that is present in the offer, "a=rtpmap" o For each supported codec that is present in the offer, "a=rtpmap"
and "a=fmtp" lines, as specified in [RFC4566], Section 6, and and "a=fmtp" lines, as specified in [RFC4566], Section 6, and
[RFC3264], Section 6.1. For audio, the codecs specified in [RFC3264], Section 6.1. For audio, the codecs specified in
[I-D.ietf-rtcweb-audio], Section 3, MUST be be supported. Note [I-D.ietf-rtcweb-audio], Section 3, MUST be be supported. Note
that for simplicity, the answerer MAY use different payload types that for simplicity, the answerer MAY use different payload types
for codecs than the offerer, as it is not prohibited by for codecs than the offerer, as it is not prohibited by
Section 6.1. Section 6.1.
o If "rtx" is present in the offer, for each primary codec where RTP o If "rtx" is present in the offer, for each primary codec where RTP
skipping to change at page 32, line 29 skipping to change at page 34, line 23
and RTX SSRCs. and RTX SSRCs.
o If a local MediaStreamTrack has been associated, and FEC has been o If a local MediaStreamTrack has been associated, and FEC has been
negotiated for this m= section, another "a=ssrc" line with the FEC negotiated for this m= section, another "a=ssrc" line with the FEC
SSRC, and an "a=ssrc-group" line, as specified in [RFC5576], SSRC, and an "a=ssrc-group" line, as specified in [RFC5576],
section 4.2, with semantics set to "FEC" and including the primary section 4.2, with semantics set to "FEC" and including the primary
and FEC SSRCs. and FEC SSRCs.
o [OPEN ISSUE: Handling of a=imageattr] o [OPEN ISSUE: Handling of a=imageattr]
o [TODO: bundle-only]
If a data channel m= section has been offered, a m= section MUST also If a data channel m= section has been offered, a m= section MUST also
be generated for data. The <media> field MUST be set to be generated for data. The <media> field MUST be set to
"application" and the <proto> field MUST be set to "DTLS/SCTP", as "application" and the <proto> field MUST be set to "DTLS/SCTP", as
specified in [I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value specified in [I-D.ietf-mmusic-sctp-sdp], Section 3; the "fmt" value
MUST be set to the SCTP port number, as specified in Section 4.1. MUST be set to the SCTP port number, as specified in Section 4.1.
Within the data m= section, the "a=mid", "a=ice-ufrag", "a=ice- Within the data m= section, the "a=mid", "a=ice-ufrag", "a=ice-
passwd", "a=ice-options", "a=candidate", "a=fingerprint", and passwd", "a=ice-options", "a=candidate", "a=fingerprint", and
"a=setup" lines MUST be included as mentioned above, along with an "a=setup" lines MUST be included as mentioned above, along with an
"a=sctpmap" line referencing the SCTP port number and specifying the "a=sctpmap" line referencing the SCTP port number and specifying the
application protocol indicated in [I-D.ietf-rtcweb-data-protocol]. application protocol indicated in [I-D.ietf-rtcweb-data-protocol].
[OPEN ISSUE: the -00 of this document is missing this information.] [OPEN ISSUE: the -01 of this document is missing this information.]
[TODO: processing of BUNDLE group] If "a=group" attributes with semantics of "BUNDLE" are offered,
corresponding session-level "a=group" attributes MUST be added as
specified in [RFC5888]. These attributes MUST have semantics
"BUNDLE", and MUST include the all mid identifiers from the offered
BUNDLE groups that have not been rejected. Note that regardless of
the presence of "a=bundle-only" in the offer, no m= sections in the
answer should have an "a=bundle-only" line.
Attributes that are common between all m= sections MAY be moved to Attributes that are common between all m= sections MAY be moved to
session-level, if desired. session-level, if explicitly defined to be valid at session-level.
The attributes prohibited in the creation of offers are also The attributes prohibited in the creation of offers are also
prohibited in the creation of answers. prohibited in the creation of answers.
5.3.2. Subsequent Answers 5.3.2. Subsequent Answers
5.3.3. Constraints Handling 5.3.3. Constraints Handling
5.4. Parsing an Offer 5.4. Parsing an Offer
skipping to change at page 47, line 4 skipping to change at page 50, line 12
a=mid:data a=mid:data
a=sctpmap:5000 webrtc-datachannel 16 a=sctpmap:5000 webrtc-datachannel 16
A.2.3. Call Flows A.2.3. Call Flows
Example SDP for WebRTC call flows can be found in Example SDP for WebRTC call flows can be found in
[I-D.nandakumar-rtcweb-sdp]. [TODO: should these call flows be [I-D.nandakumar-rtcweb-sdp]. [TODO: should these call flows be
merged into this section?] merged into this section?]
Appendix B. Change log Appendix B. Change log
Changes in draft-06:
o Reworked handling of m= line recycling.
o Added handling of BUNDLE and bundle-only.
o Clarified handling of rollback.
o Added text describing the ICE Candidate Pool and its behavior.
o Allowed OfferToReceiveX to create multiple recvonly m= sections.
Changes in draft-05: Changes in draft-05:
o Fixed several issues identified in the createOffer/Answer sections o Fixed several issues identified in the createOffer/Answer sections
during document review. during document review.
o Updated references. o Updated references.
Changes in draft-04: Changes in draft-04:
o Filled in sections on createOffer and createAnswer. o Filled in sections on createOffer and createAnswer.
 End of changes. 66 change blocks. 
223 lines changed or deleted 338 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/