<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc3667.dtd">
<?rfc toc='yes'?>
<?rfc tocdepth='4'?>
<?rfc compact="yes"?>
<rfc category="info" ipr="trust200902" docName='draft-ietf-sipping-sip-offeranswer-18'>
	<front>
		<title abbrev="SIP Usage of the Offer/Answer Model">
		    SIP (Session Initiation Protocol) Usage of the Offer/Answer Model
		</title>
		<author initials="S." surname="Okumura" fullname="OKUMURA Shinji">
			<organization>Softfront</organization>
			<address>
				<postal>
					<street>28-196, Noth9, West15, Chuo-ku</street>
					<city>Sapporo</city>
					<region>Hokkaido</region>
					<code>060-0009</code>
					<country>Japan</country>
				</postal>
				<email>shinji.okumura@softfront.jp</email>
			</address>
		</author>
		<author initials="T." surname="Sawada" fullname="Takuya Sawada">
			<organization>KDDI Corporation</organization>
			<address>
				<postal>
					<street>3-10-10, Iidabashi, Chiyoda-ku</street>
					<city>Tokyo</city>
					<country>Japan</country>
				</postal>
				<email>tu-sawada@kddi.com</email>
			</address>
		</author>
		<author initials="P." surname="Kyzivat" fullname="Paul H. Kyzivat">
			<organization>Cisco Systems, Inc.</organization>
			<address>
				<postal>
					<street>1414 Massachusetts Avenue</street>
					<city>Boxborough</city>
					<region>MA</region>
					<code>01719</code>
					<country>USA</country>
				</postal>
				<email>pkyzivat@cisco.com</email>
			</address>
		</author>
		<date year="2011" />
		<area>Transport</area>
		<workgroup>Sipping</workgroup>
		<abstract>
			<t>
The Session Initiation Protocol (SIP) utilizes the offer/answer
model to establish and update multimedia sessions using the Session
Description Protocol (SDP). The description of the offer/answer
model in SIP is dispersed across multiple RFCs. This document
summarizes all the current usages of the offer/answer model in SIP
communication.
			</t>
		</abstract>
	</front>
	<middle>
		<section title="Introduction">
			<t>
SIP utilizes the offer/answer model to establish and update
sessions. The rules to govern the offer/answer behaviors in SIP are
described in the several RFCs. (<xref target="RFC3261"/>,
<xref target="RFC3262"/>, <xref target="RFC3264"/>,
<xref target="RFC3311"/>, and <xref target="RFC6141"/>.)
			</t>
			<t>
The primary purpose of this document is to describe all forms of
SIP usage of the offer/answer model in one document to help the
readers to fully understand it. Also, this document tries to
incorporate the results of the discussions on the controversial
issues to avoid repeating the same discussions later.
			</t>
			<t>
This document describes ambiguities in the current specifications and
the authors' understanding of the correct interpretation of these
specifications. This document is not intended to make any changes to
those specifications, but rather is intended to provide a reference
for future standards development work on the SIP offer/answer model,
and to developers looking for advice on how to implement in
compliance with the standards.
			</t>

		</section>

		<section title="Summary of SIP usage of the Offer/Answer Model">
			<t>
The offer/answer model itself is independent from the higher layer
application protocols which utilize it. SIP is one of the
applications using the offer/answer model. <xref target="RFC3264"/> defines the
offer/answer model, but does not specify which SIP messages should
convey an offer or an answer. This should be defined in the SIP
core and extensions RFCs.
			</t>
			<t>
In theory, any SIP message can include a session description in its
body. But a session description in a SIP message is not necessarily
an offer or an answer. Only certain session description usages that
conform to the rules described in standards-track RFCs can be
interpreted as an offer or an answer. The rules for how to handle
the offer/answer model are defined in several RFCs.
			</t>
			<t>
The offer/answer model defines a mechanism for update of sessions.
In SIP, a dialog is used to associate an offer/answer exchange with
the session which it is to update. In other words, only the
offer/answer exchange in the SIP dialog can update the session
which is managed by that dialog.
			</t>

			<section title="Offer/Answer Exchange Pairs in SIP Messages">
				<t>
Currently, the rules on the offer/answer model are defined in
<xref target="RFC3261"/>, <xref target="RFC3262"/>,
<xref target="RFC3264"/>, <xref target="RFC3311"/> and
<xref target="RFC6141"/>.
In these RFCs, only the six patterns shown in Table 1 are defined for
exchanging an offer and an answer with SIP messages.
				</t>
				<t>
Note that an offer/answer exchange initiated by an INVITE request
must follow exactly one of the patterns 1, 2, 3, 4. When an initial
INVITE causes multiple dialogs due to forking, an offer/answer
exchange is carried out independently in each distinct dialog. When
an INVITE request contains no offer, only Pattern 2 or Pattern 4
apply. 'The first reliable non-failure message' must have an offer
if there is no offer in the INVITE request. This means that UA
which receives the INVITE request without an offer must include an
offer in the first reliable response with 100rel extension. If no
reliable provisional response has been sent, the UAS must include
an offer when sending 2xx response.
				</t>
				<t>
In Pattern 3, the first reliable provisional response may or may
not have an answer. When a reliable provisional response contains a
session description, and is the first to do so, then that session
description is the answer to the offer in the INVITE request. The
answer can not be updated, and a new offer can not be sent in a
subsequent reliable response for the same INVITE transaction.
				</t>
				<t>
In Pattern 5, a PRACK request can contain an offer only if the
reliable response which it acknowledges contains an answer to the
previous offer/answer exchange.
					<list> <t/> <t>
NOTE: It is legal to have UPDATE/2xx exchanges without
offer/answer exchanges (Pattern 6). However when re-INVITEs
are sent for non-offer/answer purposes, an offer/answer
exchange is required. In that case the prior SDP will
typically be repeated.
					</t> </list>
				</t>
				<t>
There may be ONLY ONE offer/answer negotiation in progress for a
single dialog at any point in time.
<xref target="sec.except-case-handling"/> explains how to
ensure this. When an INVITE results in multiple dialogs each has a
separate offer/answer negotiation.
					<list> <t/> <t>
NOTE: This is when using a Content-Disposition of "session".
There may be a second offer/answer negotiation in progress
using a Content-Disposition of "early-session"
<xref target="RFC3959"/>. That is
not addressed by this draft.
					</t> </list>
				</t>
				<figure title="Table 1: Summary of SIP Usage of the Offer/Answer Model">
					<artwork>
         Offer                Answer             RFC    Ini Est Early
  -------------------------------------------------------------------
  1. INVITE Req.          2xx INVITE Resp.     RFC 3261  Y   Y    N
  2. 2xx INVITE Resp.     ACK Req.             RFC 3261  Y   Y    N
  3. INVITE Req.          1xx-rel INVITE Resp. RFC 3262  Y   Y    N
  4. 1xx-rel INVITE Resp. PRACK Req.           RFC 3262  Y   Y    N
  5. PRACK Req.           200 PRACK Resp.      RFC 3262  N   Y    Y
  6. UPDATE Req.          2xx UPDATE Resp.     RFC 3311  N   Y    Y
					</artwork>
				</figure>
				<t>
In Table 1, '1xx-rel' corresponds to the reliable provisional
response which contains the 100rel option defined in <xref target="RFC3262"/>.
				</t>
				<t>
The 'Ini' column shows the ability to exchange the offer/answer to
initiate the session. 'Y' indicates that the pattern can be used in
the initial offer/answer exchange, while 'N' indicates that it can
not. Only the initial INVITE transaction can be used to exchange
the offer/answer to establish a multimedia session.
				</t>
				<t>
The 'Est' column shows the ability to update the established
session.
				</t>
				<t>
The 'Early' column indicates which patterns may be used to modify
the established session in an early dialog. There are two ways to
exchange a subsequent offer/answer in an early dialog.
				</t>
			</section>

			<section title="Rejection of an Offer" anchor="sec.rej-offer">
				<t>
It is not always clear how to reject an offer when it is
unacceptable, and some methods do not allow explicit rejection of
an offer. For each of the patterns in Table 1, Table 2 shows how to
reject an offer.
				</t>
				<t>
When a UA receives an INVITE request with an unacceptable offer, it
should respond with a 488 response, preferably with Warning header
field indicating the reason of the rejection, unless another
response code is more appropriate to reject it. (Pattern 1 and
Pattern 3.)
				</t>
				<t>
If this is a re-INVITE extra care must be taken,
as detailed in <xref target="RFC6141"/>.
Specifically, if the offer contains any changes
or additions to media stream properties, and those have already been
used to transmit/receive media before the final response is sent, then
a 2xx response should be sent, with a syntactically correct session
description.  This may optionally be followed by an UPDATE request to
rearrange the session parameters if both ends support the UPDATE method.
Alternatively the UA may send an error response to the (re)INVITE
request to terminate the dialog or to roll back the offer-answer
status before sending re-INVITE request. In this case UAS should not
continue to retransmit the unacknowledged reliable provisional
response, UAC should not continue to retransmit a PRACK request.
				</t>
				<t>
When a UA receives an UPDATE request with an offer which it can not
accept, it should respond with a 488 response preferably with
Warning header field indicating the reason of the rejection, unless
another response code is more appropriate to reject it. (Pattern 6)
				</t>
				<t>
When a UA receives a PRACK request with an offer which it can not
accept, it may respond with a 200 response with a syntactically
correct session description. This may optionally be followed by an
UPDATE request to rearrange the session parameters if both ends
support the UPDATE method. Alternatively the UA may terminate the
dialog and send an error response to the INVITE request. (Pattern 5)
				</t>
				<t>
In addition, there is a possibility for UAC to receive a 488 response
for an PRACK request.
In that case, UAC may send again a PRACK request without an offer
or send a CANCEL request to terminate the INVITE transaction.
					<list> <t/> <t>
NOTE: In <xref target="RFC3262"/>, the following restriction is
defined with regard to responding to a PRACK request.
					</t>
					<t/><t>
"If the PRACK does match an
unacknowledged reliable provisional response, it MUST be responded to
with a 2xx response."
					</t><t/>
					<t>
This restriction is not clear.  There are cases where it is
unacceptable to send a 2xx response.  For example, the UAS may
need to send an authentication challenge in a 401 response.
This is an open issue and out of scope for this document.
					</t> </list>
				</t>
				<t>
When a UA receives a response with an offer which it can not accept,
the UA does not have a way to reject it explicitly. Therefore, a UA
should respond to the offer with the correct session description
and rearrange the session parameters by initiating a new
offer/answer exchange, or alternatively terminate the session.
(Pattern 2 and Pattern 4) When initiating a new offer/answer, a UA
should take care not to cause an infinite offer/answer loop.
				</t>
				<t>
In <xref target="RFC3262"/> section 14.2 UAS Behavior,
			<list><t/><t>
   "The UAS MUST
   ensure that the session description overlaps with its previous
   session description in media formats, transports, or other parameters
   that require support from the peer.  This is to avoid the need for
   the peer to reject the session description."
			</t></list>
This is a rule for an offer within 2xx response to a re-INVITE.
This rule should be applied to an offer within a reliable provisional
response and a PRACK request.
				</t>
				<figure title="Table 2: Rejection of an Offer">
					<artwork>
     Offer                Rejection
  ------------------------------------------------------------------
  1. INVITE Req. (*)      488 INVITE Response
  2. 2xx INVITE Resp.     Answer in ACK Req. followed by new offer
                          OR termination of dialog
  3. INVITE Req.          488 INVITE Response (same as Pattern 1.)
  4. 1xx-rel INVITE Resp. Answer in PRACK Req. followed by new offer
  5. PRACK Req. (**)      200 PRACK Resp. followed by new offer
                          OR termination of dialog
  6. UPDATE Req.          488 UPDATE Response
				</artwork>
					<postamble>
						<t>
  (*)  If this was a re-INVITE, a failure response should not be sent if
  media has already been exchanged using the new offer.
						</t>
						<t>
  (**) A UA should only use PRACK to send an offer when it has strong
  reasons to expect the receiver will accept the offer.
						</t>
					</postamble>
				</figure>
			</section>

			<section title="Session Description which is not Offer nor Answer">
				<t>
As previously stated, a session description in a SIP message is not
necessarily an offer or an answer. For example, SIP can use a
session description to describe capabilities apart from
offer/answer exchange. Examples of this are a 200 OK response for
OPTIONS and a 488 response for INVITE.
				</t>
			</section>

		</section>

		<section title="Detailed Discussion of the Offer/Answer Model for SIP">

			<section title="Offer/Answer for the INVITE method with 100rel extension">
				<t>
The INVITE method provides the basic procedure for offer/answer
exchange in SIP. Without the 100rel option, the rules are simple as
described in <xref target="RFC3261"/>. If an INVITE request includes a session
description, Pattern 1 is applied and if an INVITE request does not
include a session description, Pattern 2 is applied.
				</t>
				<t>
With 100rel, Pattern 3, 4 and 5 are added and this complicates
the rules. An INVITE request may cause multiple responses. Note
that even if both UAs support the 100rel extension, not all the
provisional responses may be sent reliably.
				</t>
				<section title="INVITE Request with SDP">
					<t>
When a UAC includes a SDP body in the INVITE request as an offer, only
the first SDP in a reliable non-failure response to the INVITE
request is the real answer.  No other offer/answer exchanges
can occur within the messages (other responses and ACK) of the INVITE
transaction.
					</t>
					<t>
In <xref target="RFC3261"/> there are some descriptions about an offer/answer
exchange, but those cause a little confusion.
We interpret those descriptions as follows,
</t>
<t>UAC behavior</t>
<list>
<list style="numbers">
<t>
If the first SDP that the UAC received is included in an
an unreliable provisional response to the INVITE request,
<xref target="RFC3261"/> (section 13.2.1, 2nd bullet) 
requires that this be
treated as an answer. However, because that same section
states that the answer has to be in a reliable non-failure
message, this SDP is not the true answer and therefore the
offer/answer exchange is not yet completed. 
</t>
<t>
After the UAC has received the answer in a reliable provisional
response to the INVITE, <xref target="RFC3261"/> requires that any SDP in 
subsequent responses be ignored.
</t>
<t>
If the second and subsequent SDP(including a real answer) is
different from the first SDP, UAC should consider that the SDP
is equal to the first SDP.
Therefore, UAC should not switch to the new SDP.
</t>
</list>
</list>
<t>UAS behavior</t>
<list>
<list style="numbers">
<t>
<xref target="RFC3261"/> requires all SDP in the responses to the 
INVITE request to be identical. 
</t>
<t>
After UAS has sent the answer in a reliable provisional response
to the INVITE, UAS should not include any SDP in subsequent responses
to the INVITE.
</t>
<t>
<xref target="RFC3261"/> permits the UAS to send any provisional response
without SDP regardless of the transmission of the answer. </t>
</list>
</list>
<t>
A session description in an unreliable response
that precedes a reliable response can be considered a "preview" of
the answer that will be coming.
</t>
					<list> <t/> <t>
NOTE: This "preview" session description rule applies to a
single offer/answer exchange. In parallel offer/answer
exchanges (caused by forking) a UA may obviously receive a
different "preview" of an answer in each dialog. UAs are
expected to deal with this.
					</t> </list>
					<t>
Although <xref target="RFC3261"/> says a UA should accept media once an INVITE with
an offer has been sent, in many cases, an answer (or, at least a
preview of it) is required in order for media to be accepted. Two
examples of why this might be required are:
					</t>
					<t/>
					<list style='symbols'>
						<t>
To avoid receiving media from undesired sources, some User
Agents assume symmetric RTP will be used, ignore all incoming
media packets until an address/port has been received from the
other end, and then use that address/port to filter incoming
media packets.
						</t>
					</list>
					<t/>
					<list style='symbols'>
						<t>
In some networks, an intermediate node must authorize a media
stream before it can flow and requires a confirming answer to
the offer before doing so.
						</t>
					</list>
					<t>
Therefore, a UAS should send a SDP answer reliably (if possible)
before it starts sending media. And, if neither the UAC nor the UAS
support 100rel, the UAS should send a preview of the answer before
it starts sending media.
					</t>
					<figure title="Example of Offer/Answer with 100rel Extension (1)" anchor="fig-ex-oa-1">
						<artwork><![CDATA[
   UAC                   UAS
    | F1  INVITE (SDP)    | <- The offer in the offer/answer model
    |-------------------->|
    | F2     1xx (SDP)    | <- The offer/answer exchange is not
    |<--------------------|    closed yet, but UAC acts as if it
    |                     | ^  receives the answer.
    | F3 1xx-rel (no SDP) | |<- a 1xx-rel may be sent without answer
    |<--------------------| |   SDP.
    | F4   PRACK (no SDP) | |
    |-------------------->| | UAC must not send a new offer.
    | F5 2xx PRA (no SDP) | |
    |<--------------------| v
    |                     |
    | F6 1xx-rel (SDP)    | <- The answer in the offer/ answer model
    |<--------------------| -
    | F7   PRACK          | | UAC can send a new offer in a PRACK
    |-------------------->| | request to acknowledge F6.
    | F8 2xx PRA          | | After F7 UAC and UAS can send a new
    |<--------------------| v offer in an UPDATE request.
    |                     |
    | F9 1xx-rel          | <- SDP should not be included in the
    |<--------------------|    subsequent 1xx-rel once offer/answer
    | F10  PRACK          |    has been completed.
    |-------------------->|
    | F11 2xx PRA         |
    |<--------------------|
    |                     |
    | F12 2xx INV         | <- SDP should not be included in the
    |<--------------------|    final response once offer/answer has
    | F13    ACK          |    been completed.
    |-------------------->|
						]]></artwork>
					</figure>
					<t>
For example, in Figure <xref target="fig-ex-oa-1" format="counter" />,
only the SDP in F6 is the answer. The SDP
in the non-reliable response (F2) is the preview of the answer and
must be the same as the answer in F6. Receiving F2, the UAC should
act as if it receives the answer. However, offer/answer exchange is
not completed yet and
the UAC must not send a new offer until it
receives the same SDP in a reliable non-failure response, which is the
real answer.
After sending the SDP in F6, the UAS must prepare
to receive a new offer from the UAC in a PRACK request,
or in an UPDATE request if the UAS supports UPDATE.
					</t>
					<t>
The UAS does not include SDP in responses F9 and F12. However, the
UAC should prepare to receive SDP bodies in F9 and/or F12, and just
ignore them, to handle a peer that does not conform to the
recommended implementation.
					</t>
				</section>

				<section title="INVITE request without SDP">
					<t>
When a UAC does not include an SDP body in the INVITE request,
<xref target="RFC3261"/> (section 13.2.1, first bullet) 
requires that the UAS
include an offer in the first reliable non-failure response. However,
a UAC might not expect an SDP in the other responses to the INVITE
request because RFC 3261 simply does not anticipate the possibility.
Therefore, the UAS ought not include any SDP in the other responses to the
INVITE request.
					</t>
					<list> <t/> <t>
NOTE: In Figure <xref target="fig-ex-oa-2" format="counter" />,
the UAS should not include SDP in the responses F6 and
F9. However, the UAC should prepare to receive SDP bodies in
F6 and/or F9, and just ignore them to handle a peer that does
not conform to the recommended implementation.
					</t> </list>
					<figure title="Example of Offer/Answer with 100rel Extension (2)" anchor="fig-ex-oa-2">
						<artwork><![CDATA[
   UAC                   UAS
    | F1  INVITE (no SDP) |
    |-------------------->|
    | F2     1xx          |
    |<--------------------|
    |                     |
    | F3 1xx-rel (SDP)    | <- The first 1xx-rel must contain SDP
    |<--------------------|    as the offer.
    | F4   PRACK (SDP)    | <- A PRACK request to the first 1xx-rel
    |-------------------->|    must contain SDP as the answer.
    | F5 2xx PRA (no SDP) | -
    |<--------------------| |
    |                     | |
    | F6 1xx-rel (no SDP) | <- The subsequent 1xx-rel should not
    |<--------------------| |  contain SDP.
    | F7   PRACK          | |
    |-------------------->| | UAC can send a new offer in an UPDATE
    | F8 2xx PRA          | | request after F4.
    |<--------------------| v
    |                     |
    | F9 2xx INV (no SDP) | <- The final response should not
    |<--------------------|    contain SDP.
    | F10    ACK          |
    |-------------------->|
						]]></artwork>
					</figure>
					<t>
Note that in the case that the UAC needs to prompt the user to
accept or reject the offer, the reliable provisional response with
SDP as an offer (Pattern 4) can result in the retransmission until
the PRACK request can be sent. The UAC should take care to avoid
this situation when it sends the INVITE request without SDP.
					</t>
				</section>

			</section>

			<section title="Offer/Answer Exchange in Early Dialog" anchor="sec.oa-early-dialog">
				<t>
When both UAs support the 100rel extension, they can update the
session in the early dialog once the first offer/answer exchange
has been completed.
				</t>
				<t>
From a UA sending an INVITE request:
				</t>
				<t>
A UA can send an UPDATE request with a new offer if both ends
support the UPDATE method. Note that if the UAS needs to prompt the
user to accept or reject the offer, the delay can result in
retransmission of the UPDATE request.
				</t>
				<t>
A UA can send a PRACK request with a new offer only when
acknowledging the reliable provisional response carrying the answer
to an offer in the INVITE request. Compared to using the UPDATE
method, using PRACK can reduce the number of messages exchanged
between the UAs. However, to avoid problems or delays caused by
PRACK offer rejection, the UA is recommended to send a PRACK
request only when it has strong reasons to expect the receiver will
accept it. For example, the procedure used in precondition
extension <xref target="RFC3312"/> is a case where a PRACK request
should be used for
updating the session status in an early dialog. Note also that if a
UAS needs to prompt the user to accept or reject the offer, the
delay can result in retransmission of the PRACK request.
				</t>
				<t>
From a UA receiving an INVITE request:
				</t>
				<t>
A UA can send an UPDATE request with a new offer if both ends
support the UPDATE method. A UAS can not send a new offer in the
reliable provisional response, so the UPDATE method is the only
method for a UAS to update an early session.
				</t>
			</section>

			<section title="Offer/Answer Exchange in an Established Dialog">
				<t>
Both the re-INVITE and UPDATE methods can be used in an established
dialog to update the session.
				</t>
				<t>
The UPDATE method is simpler and can save at least one message
compared with the INVITE method. But both ends must support the
UPDATE method for it to be used.
				</t>
				<t>
The INVITE method needs at least three messages to complete but no
extensions are needed. Additionally, the INVITE method allows the
peer to take time to decide whether it will accept a session update
or not by sending provisional responses. That is, re-INVITE allows
the UAS to interact with the user at the peer, while UPDATE needs
to be answered automatically by the UAS. It is noted that re-INVITE
should be answered immediately unless such a user interaction is
needed. Otherwise, some 3pcc (Third Party Call Control) <xref target="RFC3725"/>
flows will break.
				</t>
			</section>

			<section title="Recovering From a Failed ReINVITE">
				<t>
<xref target="RFC3261"/> section 14.1 requires that the session parameters in effect
prior to a re-INVITE remain unchanged if the re-INVITE fails, as if
no re-INVITE had been issued.
This remains the case even if multiple offer/answer
exchanges have occurred between the sending of the re-INVITE and its failure,
and even if media has been exchanged using the proposed changes in the session.
Because this can be difficult to achieve in practice, a newer specification
<xref target="RFC6141"/>
recommends the UAS to send a 2xx response
to a re-INVITE in cases where rolling back changes would be problematic.
				</t>
				<t>
Nevertheless, a UAC may receive a failure response to a re-INVITE
after proposed changes that must be rolled back have already been used.
In such a case, the UAC should send an UPDATE offering the SDP that has been reinstated.
(See <xref target="RFC6141"/> for details.)
				</t>
			</section>

		</section>

		<section title="Exceptional Case Handling" anchor="sec.except-case-handling">
			<t>
In <xref target="RFC3264"/>, the following restrictions are defined with regard
to sending a new offer.
			</t>
			<list> <t/> <t>
"At any time, either agent MAY generate a new offer that updates
the session.  However, it MUST NOT generate a new offer if it
has received an offer which it has not yet answered or rejected.
It MUST NOT generate a new offer if it has generated a prior
offer for which it has not yet received an answer or a
rejection."
			</t> </list>
			<t>
Assuming that the above rules are guaranteed, there seem to be two
possible 'exceptional' cases to be considered in SIP offer/answer
usage: the 'message crossing' case, and the 'glare' case. One of
the reasons why the usage of SIP methods to exchange offer/answer
needs to be carefully restricted in the RFCs is to ensure that the
UA can detect and handle appropriately the 'exceptional' cases to
avoid incompatible behavior.
			</t>

			<section title="Message Crossing Case Handling" anchor="sec.message-crossing">
				<t>
When message packets cross in the transport network, an offer may
be received before the answer for the previous offer/answer
exchange, as shown in Figure <xref target="fig-cross-case" format="counter" />.
In such a case, UA A must detect
that the session description SDP-2 is not the answer to offer1.
				</t>
				<figure title="Message Crossing Case" anchor="fig-cross-case">
					<artwork><![CDATA[

      A                  B
      |SDP-1     (offer1)|
   M1 |----------------->|
      |SDP-2    (answer1)|
   M2 |<------\  /-------|
      |        \/        |
      |SDP-3   /\(offer2)|
   M3 |<------/  \-------|
					]]></artwork>
				</figure>
				<t>
Because of the restrictions on placement of offers and answers
(summarized in Table 1) there are a limited number of valid
exchanges of messages that may lead to this message crossing case.
These are enumerated in Table 3. (This table only shows messages
containing offers or answers. There could be other messages,
without session descriptions, which are not shown.)
				</t>
				<t>
When a response to UPDATE request crosses a reliable response to INVITE request,
there are variants shown in
Figures <xref target="fig-cross-case-1" format="counter" />
and <xref target="fig-cross-case-2" format="counter" />,
which are dependent on an
INVITE (Mx) that contains no offer. These are also included in Table 3.
				</t>
				<figure title="Avoidable message crossing cases" anchor="fig-cross-case-1">
					<artwork><![CDATA[
                A                               B
                |                               |
                |UPDATE(offer1)                 |
             M1 |==============================>|
                |re-INVITE(no offer)            |
             Mx |------------------------------>| --+
                |               2xx-UPD(answer1)|   |
             M2 |<===========\  /===============|   | first reliable
                |             \/ 1xx-rel/2xx-INV|   | response
                |             /\        (offer2)|   |
             M3 |<===========/  \===============| <-+
                |PRACK/ACK(answer2)             |
             My |------------------------------>|
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid this message crossing condition shown in
Figure <xref target="fig-cross-case-1" format="counter" />,
UA A should not send this re-INVITE request
until an UPDATE transaction has been completed.
If UA B encounters this message crossing condition,
it should reject this re-INVITE request with a 500 response.
				</t>


				<figure title="Avoidable message crossing cases" anchor="fig-cross-case-2">
					<artwork><![CDATA[
                A                               B
                |                               |
                |re-INVITE(no offer)            |
             Mx |------------------------------>| --+
                |UPDATE(offer1)                 |   |
             M1 |==============================>|   |
                |               2xx-UPD(answer1)|   |
             M2 |<===========\  /===============|   | first reliable
                |             \/ 1xx-rel/2xx-INV|   | response
                |             /\        (offer2)|   |
             M3 |<===========/  \===============| <-+
                |PRACK/ACK(answer2)             |
             My |------------------------------>|
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid this message crossing condition shown in
Figure <xref target="fig-cross-case-2" format="counter" />,
UA A should not send this UPDATE request
until an ACK or a PRACK transaction associated with an offer-answer
has been completed.
If UA B encounters this message crossing condition,
it should reject this UPDATE request with a 500 response.
				</t>

				<t>
The situation when
PRACK request crosses
UPDATE request is shown in
Figure <xref target="fig-cross-case-3" format="counter" />.
				</t>
				<figure title="Avoidable message crossing cases" anchor="fig-cross-case-3">
					<artwork><![CDATA[
                A                               B
                |                               |
                |           re-INVITE (no offer)|
1st reliable+-- |<------------------------------|
response    | M1|1xx-rel(offer1)                |
            +-> |==============================>| --+
                |                 PRACK(answer1)| M3| Acknowledge
                |<===========\  /===============| <-+
                |             \/                |
                |             /\  UPDATE(offer2)|
                |<===========/  \===============| M2
                |500-UPD                        |
                |------------------------------>|
                |2xx-PRA                        |
                |------------------------------>|
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid the message crossing condition shown in
Figure <xref target="fig-cross-case-3" format="counter" />,
UA B should not send this UPDATE request
until an PRACK transaction associated with an offer-answer
has been completed.
If UA A encounters this message crossing condition,
it should reject this UPDATE request with a 500 response.
				</t>

				<t>
The situation when
a reliable provisional response to INVITE request crosses
UPDATE request is shown in
Figure <xref target="fig-cross-case-4" format="counter" />.
				</t>
				<figure title="Avoidable message crossing cases" anchor="fig-cross-case-4">
					<artwork><![CDATA[
                A                               B
                |                               |
                |re-INVITE(offer1)              |
             M1 |==============================>|
                |               1xx-rel(answer1)|
                |<===========\  /===============| M3
                |             \/                |
                |             /\  UPDATE(offer2)|
            +-- |<===========/  \===============| M2
            |   |491-UPD                        |
Acknowledge |   |------------------------------>|
            |   |PRACK                          |
            +-> |------------------------------>|
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid the message crossing condition shown in
Figure <xref target="fig-cross-case-4" format="counter" />,
UA B should not send this UPDATE request
until an PRACK transaction associated with an offer-answer
has been completed.
If UA A encounters this message crossing condition,
it should reject this UPDATE request with a 491 response.
				</t>

				<t>
The situation when
a 2xx response to INVITE request crosses
UPDATE request is shown in
Figure <xref target="fig-cross-case-5" format="counter" />.
				</t>
				<figure title="Avoidable message crossing cases" anchor="fig-cross-case-5">
					<artwork><![CDATA[
                A                               B
                |                               |
                |re-INVITE(offer1)              |
                |==============================>|
                |               2xx-INV(answer1)|
                |<===========\  /===============|
                |             \/                |
                |             /\  UPDATE(offer2)|
            +-- |<===========/  \===============|
            |   |491-UPD                        |
Acknowledge |   |------------------------------>|
            |   |ACK                            |
            +-> |------------------------------>|
                |                               |
					]]></artwork>
				</figure>
				<t>
This is a true glare.
To avoid the message crossing condition shown in
Figure <xref target="fig-cross-case-5" format="counter" />,
UA B should not send the UPDATE request until it
has received an ACK request.  But there is no problem even if UA B
sends it.  If UA A encounters this message crossing condition, it
should reject this UPDATE request with a 491 response.
				</t>

				<t>
The situation when
a response to UPDATE request crosses
PRACK request is shown in
Figure <xref target="fig-cross-case-6" format="counter" />.
				</t>
				<figure title="Avoidable message crossing case" anchor="fig-cross-case-6">
					<artwork><![CDATA[
                A                               B
                |                               |
                |              re-INVITE(offer0)|
                |<------------------------------|
                |1xx-rel(answer0)               |
                |------------------------------>| --+
                |UPDATE(offer1)                 |   |
             M1 |==============================>|   |
                |               2xx-UPD(answer1)|   | Acknowledge
                |<===========\  /===============| M3|
                |             \/                |   |
                |             /\   PRACK(offer2)| M2|
                |<===========/  \===============| <-+
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid the message crossing condition shown in
Figure <xref target="fig-cross-case-6" format="counter" />,
UA A should not send this UPDATE request
until an PRACK transaction associated with an offer-answer
has been completed.
If UA B encounters this message crossing condition,
it should reject this UPDATE request with a 491 response.
				</t>

				<figure title="Table 3: Offer / Answer Crossing Message Sequences">
<preamble>
Table 3 summarize this section.
Each action is described in <xref target="sec.iw-update-reinvite"/>.
</preamble>
					<artwork><![CDATA[
     | M1     | M3       | M2        |Action |Action |Figure|
     |(offer1)|(answer1) |(offer2)   | of A  | of B  |      |
     +--------+----------+-----------+-------+-------+------+
     | UPDATE | 2xx-UPD  | UPDATE    |UAS-UcU|       |      |
     |        |          +-----------+-------+ -     |      |
     |        |          | INVITE    |UAS-UcI|       |      |
     |        |          +-----------+-------+-------+------+
     |        |          | 1xx-INV   |       |       |      |
     |        |          +-----------+UAC-UI,|UAS-UsI| 4,5  |
     |        |          | 2xx-INV   |UAC-IU |UAS-IsU|      |
     |        |          +-----------+-------+-------+------+
     |        |          | PRACK  (*)|UAC-IU |UAS-IcU|  9   |
     +--------+----------+-----------+-------+-------+------+
     | PRACK  | 2xx-PRA  | UPDATE    |UAS-IcU|       |      |
     +--------+----------+-----------+-------+       |      |
     | 2xx-INV| ACK      | UPDATE    |UAS-IsU| -     |      |
     |        |          +-----------+-------+       |      |
     |        |          | INVITE    |UAS-IsI|       |      |
     +--------+----------+-----------+-------+-------+------+
     | 1xx-rel| PRACK    | UPDATE    |UAS-IsU|       |  6   |
     +--------+----------+-----------+-------+UAC-IU +------+
     | INVITE | 1xx-rel  | UPDATE (*)|       |       |  7   |
     |        +----------+-----------+UAS-IcU+-------+------+
     |        | 2xx-INV  | UPDATE (*)|       | -     |  8   |
     +--------+----------+-----------+-------+-------+------+
     (*) invalid sequences if INVITE request is an initial one
					]]></artwork>
				</figure>
			</section>

			<section title="Glare Case Handling" anchor="sec.glare">
				<t>
When both ends in a dialog send a new offer at nearly the same time,
as described in Figure <xref target="fig-glare-case" format="counter" />,
a UA may receive a new offer before it
receives the answer to the offer it sent. This case is usually
called a 'glare' case.
				</t>
				<figure title="Glare Case" anchor="fig-glare-case">
					<artwork><![CDATA[
      A                  B
      |offer1      offer2|
   M1 |-------\  /-------| M2
      |        \/        |
      |        /\        |
      |<------/  \------>|
					]]></artwork>
				</figure>
				<t>
When offer2 is in an UPDATE request or (re-)INVITE request, it must
be rejected with a 491 or 500 response.
				</t>
				<t>
There is a variant of
Figure <xref target="fig-cross-case-4" format="counter" />.
When offer2 is in a PRACK request (within the current rules, only
possible if offer1 is in an UPDATE request),
as shown in Figure <xref target="fig-glare-case-1" format="counter" />,
UA A has a dilemma.
				</t>
				<figure title="Avoidable glare case" anchor="fig-glare-case-1">
					<artwork><![CDATA[
                A                               B
                |                               |
                |              re-INVITE(offer0)|
                |<------------------------------|
                |1xx-rel(answer0)               |
                |------------------------------>| --+
                |UPDATE(offer1)    PRACK(offer2)| M2| Acknowledge
             M1 |============\  /===============| <-+
                |             \/                |
                |             /\                |
                |<===========/  \==============>|
                |                        491-UPD|
                |<------------------------------|
                |                               |
					]]></artwork>
				</figure>
				<t>
All PRACKs are supposed to be accepted with a 200 response, yet there is
no way to indicate the problem with a 200 response. At best it could
proceed on the assumption that the UPDATE will be rejected with a 491.
To avoid this glare condition shown in
Figure <xref target="fig-glare-case-1" format="counter" />,
UA A should not send this UPDATE request
until an PRACK transaction associated with an offer-answer
has been completed.
If UA B encounters this glare
condition it should reject this UPDATE request with a 491 response.
				</t>

				<t>
Glare can also occur when offer2 is in a 1xx or 2xx response.
This is a variant of Figure <xref target="fig-cross-case-2" format="counter" />,
as shown in Figure <xref target="fig-glare-case-2" format="counter" />.
				</t>
				<figure title="Avoidable glare case" anchor="fig-glare-case-2">
					<artwork><![CDATA[
                A                               B
                |                               |
                |re-INVITE(no offer)            |
                |------------------------------>| --+
                |                1xx-rel/2xx-INV|   | 1st reliable
                |UPDATE(offer1)         (offer2)| M2| response
             M1 |============\  /===============| <-+
                |             \/                |
                |             /\                |
                |<===========/  \==============>|
                |                        500-UPD|
                |<------------------------------|
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid this glare condition shown in
Figure <xref target="fig-glare-case-2" format="counter" />,
UA A should not send this UPDATE request
until an ACK or a PRACK transaction associated with an offer-answer
has been completed.
If UA B encounters this glare condition
it should reject this UPDATE request with a 500 response.
				</t>

				<t>
There is a variant of Figure <xref target="fig-cross-case-1" format="counter" />,
as shown in Figure <xref target="fig-glare-case-3" format="counter" />.
				</t>
				<figure title="Avoidable glare case" anchor="fig-glare-case-3">
					<artwork><![CDATA[
                A                               B
                |                               |
                |UPDATE(offer1)                 |
                |==========\                    |
                |re-INVITE  \  (no offer)       |
                |------------\----------------->| --+
                |             \  1xx-rel/2xx-INV|   | 1st reliable
                |              \        (offer2)|   | response
                |<==============\===============| <-+
                |                \              |
                |                 \============>|
                |                        500-UPD|
                |<------------------------------|
                |                               |
					]]></artwork>
				</figure>
				<t>
To avoid this glare condition shown in
Figure <xref target="fig-glare-case-3" format="counter" />,
UA A should not send this re-INVITE request
until an UPDATE transaction has been completed.
If UA B encounters this glare condition
it should reject this UPDATE request with a 500 response.
				</t>

				<figure title="Table 4: Offer / Answer Glare Message Sequences">
<preamble>
Table 4 summarize this section.
Each action is described in <xref target="sec.iw-update-reinvite"/>.
</preamble>
					<artwork><![CDATA[
    | offer1    | offer2    |Action |Action |Figure|
    |  M1       |  M2       | of A  | of B  |      |
    +-----------+-----------+-------+-------+------+
    |           | re-INVITE |UAS-IcI|UAS-IcI|      |
    | re-INVITE +-----------+-------+-------+      |
    |           | UPDATE    |UAS-IcU|UAS-UcI|      |
    +-----------+-----------+-------+-------+      |
    |           | UPDATE    |UAS-UcU|UAS-UcU|      |
    |           +-----------+-------+-------+------+
    |           | 1xx-rel   |       |       |      |
    | UPDATE    +-----------+UAC-IU,|UAS-IsU|12,13 |
    |           | 2xx-INV   |UAC-UI |       |      |
    |           +-----------+-------+-------+------+
    |           | PRACK (*) |UAC-IU |UAS-IcU|  11  |
    +-----------+-----------+-------+-------+------+
     (*) invalid sequences if INVITE request is an initial one
					]]></artwork>
				</figure>
			</section>

			<section title="Interworking of UPDATE and re-INVITE" anchor="sec.iw-update-reinvite">
<t>
Almost all exceptional cases are caused by an interworking of UPDATE and re-INVITE.
The interworking is described in Section 5 of <xref target="RFC3311"/>.
And UAC Behavior sending an UPDATE is described in Section 5.1 of <xref target="RFC3311"/>.
There are two concerns in this section,
</t>
<list style="numbers">
	<t>
	It seems to describe different rules for each of initial INVITE
	and re-INVITE.  But there is no particular reason why the rules
	are separated.  The lack of restrictions for sending a re-INVITE
	request cause a lot of problems shown in
	<xref target="sec.message-crossing"/>.
	</t>
	<t>
	It seems to describe that a UA may send an UPDATE request after
	sending or receiving a PRACK request.  But it should be "after
	PRACK transaction is completed by 2xx response", because it
	causes the message-crossing case shown in
	Figure <xref target="fig-cross-case-3" format="counter" />
	</t>
</list>

<t>
Since it is assumed that the language in this section itself is non-normative
and is justified as a corollary of 3261, we interpret it as follows,
</t>
<list style="hanging" hangIndent="10">
	<t hangText="UAC-II:">
	While an INVITE transaction is incomplete
	or ACK transaction associated with an offer-answer is incomplete,
	a UA must not send another INVITE request.
	</t>
	<t hangText="UAC-UU:">
	While an UPDATE transaction is incomplete, a UA must not
	send another UPDATE request.
	</t>
	<t hangText="UAC-UI:">
	While an UPDATE transaction is incomplete, a UA should not
	send a re-INVITE request.
	</t>
	<t hangText="UAC-IU:">
	While an INVITE transaction is incomplete, and an ACK or a PRACK
	transaction associated with an offer-answer is incomplete,
	a UA should not send an UPDATE request.
	</t>
</list>
<t>
When a 2xx response to an INVITE includes an offer,
the ACK transaction is considered to be associated with an offer-answer.
</t>
<t>
When a reliable provisional response to an INVITE includes an offer or an answer,
the PRACK transaction is considered to be associated with an offer-answer.
</t>

<t>
UAS Behavior receiving an UPDATE is described in Section 5.2 of <xref target="RFC3311"/>.
There are two concerns in this section,
</t>
<list style="numbers">
	<t>
	There are no description about the interworking of an UPDATE
	request and an INVITE request without an offer.
	</t>
	<t>
	There are no description about the interworking of an UPDATE
	request and reliable response to INVITE with an offer.
	</t>
</list>
<t>
We interpret this section as follows,
</t>
<list style="hanging" hangIndent="10">
	<t hangText="UAS-IcI:">
	While an INVITE client transaction is incomplete
	or ACK transaction associated with an offer-answer is incomplete,
	a UA must reject another INVITE request with a 491 response.
	</t>
	<t hangText="UAS-IsI:">
	While an INVITE server transaction is incomplete
	or ACK transaction associated with an offer-answer is incomplete,
	a UA must reject another INVITE request with a 500 response.
	</t>
	<t hangText="UAS-UcU:">
	While an UPDATE client transaction is incomplete, a UA
	must reject another UPDATE request with a 491 response.
	</t>
	<t hangText="UAS-UsU:">
	While an UPDATE server transaction is incomplete, a UA
	must reject another UPDATE request with a 500 response.
	</t>
	<t hangText="UAS-UcI:">
	While an UPDATE client transaction is incomplete, a UA
	should reject a re-INVITE request with a 491 response.
	</t>
	<t hangText="UAS-UsI:">
	While an UPDATE server transaction is incomplete, a UA
	should reject a re-INVITE request with a 500 response.
	</t>
	<t hangText="UAS-IcU:">
	While an INVITE client transaction is incomplete,
	and an ACK or a PRACK transaction associated with an offer-answer is incomplete,
	a UA should reject an UPDATE request with a 491 response.
	</t>
	<t hangText="UAS-IsU:">
	While an INVITE server transaction is incomplete,
	and an ACK or a PRACK transaction associated with an offer-answer is incomplete,
	a UA should reject an UPDATE request with a 500 response.
	</t>
</list>

<t>
These rules are shown in following figures.
</t>

<figure title="Example of UAC-UU and UAS-UcU" anchor="fig-iw-1">
<artwork><![CDATA[
            A                               B
            |                               |
            |                         UPDATE|
            |<------------------------------|
            |UPDATE                         |
            |==============================>|
            |                            491|
            |<==============================|
            |                               |
]]></artwork>
</figure>

<figure title="Example of UAC-UU and UAS-UsU" anchor="fig-iw-2">
<artwork><![CDATA[
            A                               B
            |                               |
            |UPDATE CSeq:m                  |
            |------------------------------>|
            |UPDATE CSeq:n(>m)              |
            |==============================>|
            |            500 (UPDATE CSeq:n)|
            |<==============================|
            |                               |
]]></artwork>
</figure>

<figure title="Example of UAC-UI and UAS-UcI" anchor="fig-iw-3">
<artwork><![CDATA[
            A                               B
            |                               |
            |                 UPDATE(offer1)|
            |<------------------------------|
            |reINVITE(no offer)             |
            |==============================>|
            |                   491 (INVITE)|
            |<==============================|
            |                               |
]]></artwork>
</figure>

<figure title="Example of UAC-UU and UAS-UsI" anchor="fig-iw-4">
<artwork><![CDATA[
            A                               B
            |                               |
            |UPDATE(offer1)                 |
            |------------------------------>|
            |reINVITE(no offer)             |
            |==============================>|
            |                   500 (INVITE)|
            |<==============================|
            |                               |
]]></artwork>
</figure>

<figure title="Example of UAC-IU and UAS-IcU" anchor="fig-iw-5">
<artwork><![CDATA[
            A                               B
            |                               |
            |             reINVITE(no offer)|
            |<------------------------------|
            |1xx-rel(offer0)                |
            |------------------------------>|
            |UPDATE(offer1)                 |
            |==============================>|
            |                   491 (UPDATE)|
            |<==============================|
            |                               |
]]></artwork>
</figure>

<figure title="Example of UAC-IU and UAS-IsU" anchor="fig-iw-6">
<artwork><![CDATA[
            A                               B
            |                               |
            |reINVITE(no offer)             |
            |------------------------------>|
            |                1xx-rel(offer0)|
            |<------------------------------|
            |UPDATE(offer1)                 |
            |==============================>|
            |                   500 (UPDATE)|
            |<==============================|
            |                               |
]]></artwork>
</figure>

<t>
In addition, it is assumed that the UPDATE request in this
section include an offer.
The interworking of a re-INVITE and an UPDATE without an offer
is out of scope for this document.
</t>
			</section>
		</section>

		<section title="Content of Offers and Answers" anchor="sec.oa-content">
			<t>
While <xref target="RFC3264"/> and <xref target="RFC3312"/> give some guidance,
questions remain
about exactly what should be included in an offer or answer. This
is especially a problem when the common "hold" feature has been
activated, and when there is the potential for a multimedia call.
			</t>
			<t>
Details of behavior depend on the capabilities and state of the
User Agent. The kinds of recommendations that can be made are
limited by the model of device capabilities and state that is
presumed to exist.
			</t>
			<t>
This section focuses on a few key aspects of offers and answers
that have been identified as troublesome, and will consider other
aspects to be out of scope. This section considers:
			</t>
			<list style='symbols'>
				<t>
choice of supported media types and formats to include and
exclude
				</t>
				<t>
hold and resume of media
				</t>
			</list>
			<t>
The following are out of scope for this document:
			</t>
			<list style='symbols'>
				<t>
NAT traversal and ICE
				</t>
				<t>
specific codecs and their parameters
				</t>
				<t>
the negotiation of secure media streams
				</t>
				<t>
grouping of media streams
				</t>
				<t>
preconditions
				</t>
			</list>

			<section title="General Principle for Constructing Offers and Answers" anchor="sec.oa-gen-principle">
				<t>
A UA should send an offer that indicates what it, and its user, are
interested in using/doing at that time, without regard for what the
other party in the call may have indicated previously. This is the
case even when the offer is sent in response to an INVITE or re-
INVITE that contains no offer. (However in the case of re-INVITE
the constraints of <xref target="RFC3261"/> and <xref target="RFC3264"/> must be observed.)
				</t>
				<t>
A UA should send an answer that includes as close an approximation
to what the UA and its user are interested in doing at that time,
while remaining consistent with the offer/answer rules of
<xref target="RFC3264"/> and other RFCs.
				</t>
				<list> <t/> <t>
NOTE: "at that time" is important. The device may permit the
user to configure which supported media are to be used by
default.
				</t> </list>
				<t>
In some cases a UA may not have direct knowledge of what it is
interested in doing at a particular time. If it is an intermediary
it may be able to delegate the decision. In the worst case it may
apply a default, such as assuming it wants to use all of its
capabilities.
				</t>
			</section>

			<section title="Choice of Media Types and Formats to Include and Exclude">
				<section title="Sending an Initial INVITE with Offer" anchor="sec.init-inv-offer">
					<t>
When a UAC sends an initial INVITE with an offer, it has complete
freedom to choose which media type(s) and media format(s) (payload
types in the case of RTP) it should include in the offer.
					</t>
					<t>
The media types may be all or a subset of the media the UAC is
capable of supporting, with the particular subset being determined
by the design and configuration (e.g., via <xref target="RFC6080"/>)
of the UAC combined with input from the user interface of the UAC.
<!-- Used to ref 3959, but that had to be wrong. -->
					</t>
					<t>
The media formats may be all or a subset of the media formats the
UAC is capable of supporting for the corresponding media type, with
the particular subset being determined by the design and
configuration of the
UAC combined with input from the user interface of the UAC.
<!-- Used to ref 3959, but that had to be wrong. -->
					</t>
					<t>
Including all supported media formats will maximize the possibility
that the other party will have a supported format in common. But
including many can result in an unacceptably large SDP body.
					</t>
				</section>

				<section title="Responding with an Offer when the Initial INVITE has no Offer">
					<t>
When a UAS has received an initial INVITE without an offer, it must
include an offer in the first reliable response to the INVITE. It
has largely the same options as when sending an initial INVITE with
an offer, but there are some differences. The choice may be
governed by both static (default) selections of media types as well
as dynamic selections made by a user via interaction with the
device while it is alerting.
					</t>
					<list> <t/> <t>
NOTE: The offer may be sent in a reliable provisional response, before
the user of the device has been alerted and had an opportunity
to select media options for the call. In this case the UAS
cannot include any call-specific options from the user of the
device. If there is a possibility that the user of the device
will wish to change what is offered before answering the call,
then special care should be taken. If PRACK and UPDATE are
supported by caller and callee then an initial offer can be
sent reliably, and changed with an UPDATE if the user desires
a change. If PRACK and UPDATE are not supported then the
initial offer cannot be changed until the call is fully
established. In that
case the offer in a 200 response for the initial INVITE should
include only the media types and formats believed to be
acceptable to the user.
					</t> </list>
				</section>

				<section title="Answering an Initial INVITE with Offer">
					<t>
When a UAS receives an initial INVITE with an offer, what media
lines the answer may contain is constrained by <xref target="RFC3264"/>. The
answer must contain the same number of m-lines as the offer, and
they must contain the same media types. Each media line may be
accepted, by including a non-zero port number, or rejected by
including a zero port number in the answer.
The media lines that are accepted should
typically be those with types and formats the UAS would have included
if it were the offerer.
					</t>
					<t>
The media formats the answer may contain are constrained by
<xref target="RFC3264"/>. For each accepted m-line in the answer, there must be at
least one media format in common with the corresponding m-line of
the offer. The UAS may also include other media formats it is able
to support at this time.
Doing so establishes an asymmetric media format situation, where
these "other" media formats may only be sent from the offerer to the
answerer. This asymmetric media situation is also limited because it
cannot be sustained if there is a subsequent offer/answer exchange in
the opposite direction. Also, there is limited value in including
these other media formats because there is no assurance that the
offerer will be able to use them.
					</t>
					<t>
If the UAS does not wish to indicate support for any of the media
types in a particular media line of the offer it must reject the
corresponding media line, by setting the port number to zero.
					</t>
					<t>
When the UAS wishes to reject all of the media lines in the offer,
it may send a 488 failure response.  Alternatively it may send a
reliable non-failure response including all media lines with port
numbers set to zero.
					</t>
				</section>

				<section title="Answering when the Initial INVITE had no Offer" anchor="sec.ans-ini-inv-no-offer">
					<t>
When a UAC has sent an initial INVITE without an offer, and then
receives a response with the first offer, it should answer in the
same way as a UAS receiving an initial INVITE with an offer.
					</t>
					<t>
Because the offer arrives in a response to the INVITE, the UAC cannot
reject the message containing the offer. If the UAC wishes to reject
the entire offer, it must send a PRACK or ACK request including all
the media lines with ports set to zero. Then, if it does not wish to
continue the session it may send a CANCEL or BYE request to terminate
the dialog.
					</t>
				</section>

				<section title="Subsequent Offers and Answers">
					<t>
The guidelines above (<xref target="sec.oa-gen-principle"/> and
<xref target="sec.init-inv-offer"/> through
<xref target="sec.ans-ini-inv-no-offer"/>)
apply, but constraints in <xref target="RFC3264"/> must also be followed. The
following are of particular note because they have proven
troublesome:
					</t>
					<list style='symbols'>
						<t>
The number of m-lines may not be reduced in a subsequent offer.
Previously rejected media streams must remain, or be reused to
offer the same or a different stream. (Section 6 of <xref target="RFC3264"/>.)
						</t>
						<t>
In the o-line, only the version number may change, and if it
changes it must increment by one from the one previously sent as
an offer or answer. (Section 8 of <xref target="RFC3264"/>.) If it doesn't
change then the entire SDP body must be identical to what was
previously sent as an offer or answer. Changing the o-line,
except version number value, during the session is an error case.
The behavior when receiving such a non-compliant offer/answer
SDP body is implementation dependent. If a UA needs to negotiate
a 'new' SDP session, it should use the INVITE/Replaces method.
						</t>
						<t>
In the case of RTP, the mapping from a particular dynamic
payload type number to a particular codec within that media
stream (m-line) must not change for the duration of the session.
(Section 8.3.2 of <xref target="RFC3264"/>.)
						</t>
						<list style='empty'> <t/> <t>
NOTE: This may be impossible for a B2BUA to follow in some
cases (e.g. 3pcc transfer) if it does not terminate media.
						</t> </list>
					</list>
					<t>
When the new offer is sent in response to an offerless (re)INVITE,
it should be constructed according to the General Principle for
Constructing Offers and Answers (<xref target="sec.oa-gen-principle"/> ):
all codecs the UA is currently willing and able to use should be included,
not just the ones that were negotiated by previous offer/answer exchanges.
The same is true for media types - so if UA A initially offered audio
and video to UA B, and they end up with only audio, and UA B sends
an offerless (re)INVITE to UA A, A's resulting offer should most likely
re-attempt video, by reusing the zeroed m-line used previously.
					</t>
					<list> <t/> <t>
NOTE: The behavior above is recommended, but it is not always
achievable - for example in some interworking scenarios. Or,
the offerer may simply not have enough resources to offer
"everything" at that point. Even if the UAS is not able to
offer any other SDP that the one currently being used, it
should not reject the re-INVITE. Instead, it should generate
an offer with the currently used SDP with o- line unchanged.
					</t> </list>
				</section>

			</section>

			<section title="Hold and Resume of media" anchor="sec.hold-resume">
				<t>
<xref target="RFC3264"/> specifies (using non-normative language) that "hold" should be
indicated in an established session by sending a new offer
containing "a=sendonly" for each media stream to be held. An
answerer is then to respond with "a=recvonly" to acknowledge that
the hold request has been understood.
				</t>
				<t>
Note that the use of sendonly/recvonly is not limited to hold.
These may be used for other reasons, such as devices that are only
capable of sending or receiving. So receiving an offer with
"a=sendonly" must not be treated as a certain indication that the
offerer has placed the media stream on hold.
				</t>
				<t>
This model is based on an assumption that the UA initiating the
hold will want to play Music on Hold, which is not always the case.
A UA may, if desired, initiate hold by offering "a=inactive" if it
does not intend to transmit any media while in hold status.
				</t>
				<t>
The rules of <xref target="RFC3264"/> constrain what may be in an answer when
the offer contains "sendonly", "recvonly", or "inactive" in an a=
line. But they do not constrain what must be in a subsequent offer.
The General Principle for Constructing Offers and Answers
(<xref target="sec.oa-gen-principle"/>) is important here.
The initiation of "hold" is a local
action. It should reflect the desired state of the UA. It then
affects what the UA includes in offers and answers until the local
state is reset.
				</t>
				<t>
The receipt of an offer containing "a=sendonly" or "a=inactive" and
the sending of a compatible answer should not change the desired
state of the recipient. However, a UA that has been "placed on
hold" may itself desire to initiate its own hold status, based on
local input.
				</t>
				<t>
If UA2 has previously been "placed on hold" by UA1, via receipt of
"a=sendonly", then it may initiate its own hold by sending a new
offer containing "a=sendonly" to UA1. Upon receipt of that, UA1
will answer with "a=inactive" because that is the only valid answer
that reflects its desire not to receive media.
				</t>
					<list> <t/> <t>
NOTE: Section 8.4 of <xref target="RFC3264"/> contains a conflicting recommendation
that the offer contain "a=inactive" in this case. We interpret that
recommendation to be non-normative. The use of "a=sendonly" in this
case will never produce a worse outcome, and can produce a better
outcome in useful cases.
					</t> </list>
				<t>
Once in this state, to resume a two way exchange of media each side
must reset its local hold status. If UA1 is first to go off hold it
will then send an offer with "a=sendrecv". The UA2 will respond
with its desired state of "a=sendonly" because that is a permitted
response. When UA2 desires to also resume, it will send an offer
with "a=sendrecv". In this case, because UA1 has the same desire it
will respond with "a=sendrecv". In the same case, when UA2 receives
the offer with "a=sendrecv", if it has decided it wants to reset
its local hold but has not yet signaled the intent, it may send
"a=sendrecv" in the answer.
				</t>
				<t>
If UA2 has been "placed on hold" by UA1 via receipt of "a=inactive",
and subsequently wants to initiate its own hold, also using
"a=inactive", it need not send a new offer, since the only valid
response is "a=inactive" and that is already in effect. However,
its local desired state will now be either "inactive" or
"a=sendonly". This affects what it will send in future offers and
answers.
				</t>
				<t>
If a UA has occasion to send another offer in the session, without
any desire to change the hold status (e.g. in response to a re-
INVITE without an offer, or when sending a re-INVITE to refresh the
session timer) it should follow the General Principle for
Constructing Offers and Answers (<xref target="sec.oa-gen-principle"/>).
If it previously
initiated a "hold" by sending "a=sendonly" or "a=inactive" then it
should offer that again. If it had not previously initiated "hold"
then it should offer "a=sendrecv", even if it had previously been
forced to answer something else. Without this behavior it is
possible to get "stuck on hold" in some cases, especially when a
3pcc is involved.
				</t>
			</section>

			<section title="Behavior on receiving SDP with c=0.0.0.0">
				<t>
<xref target="RFC3264"/> requires that an agent be capable of receiving
SDP with a connection address of 0.0.0.0, in which case it means
that neither RTP nor RTCP should be sent to the peer.
				</t>
				<t>
If a UA generates an answer to the offer received with
"c=IN IP4 0.0.0.0", the direction attribute of the accepted media
stream in the answer must still be based on direction attribute of
the offered stream and rules specified in <xref target="RFC3264"/> to form the
direction a-line in the answer. There is no clear rule about the use
of "c=IN IP4 0.0.0.0" in the answer - it may be used or c-line with
a valid IP address may be used. RTP/RTCP will not be sent toward an
address of 0.0.0.0 because it is an invalid address.
				</t>
			</section>
		</section>

		<section title="IANA Considerations" anchor="sec.iana-considerations">
			<t>
This document has no actions for IANA.
			</t>
		</section>

		<section title="Security Considerations">
			<t>
This document clarifies ambiguities in the intended behavior of the two 
SIP User Agents engaged in a dialog. The primary specification of 
offer/answer behavior that is being clarified resides in 
<xref target="RFC3261"/> and <xref target="RFC3264"/>, with extensions 
in <xref target="RFC3311"/>, <xref target="RFC3312"/>, and <xref target="RFC6141"/>.
The focus of this document is on cases where ambiguities can result 
failed or degraded calls when there is no attacker. The clarifications 
exclude call flows that lead to difficulties, without 
legitimizing any formerly invalid call flows. Thus the security 
considerations of the above mentioned documents continue to apply and 
need not be extended to handle any additional cases.
			</t>
			<t>
The offer/answer process can be disrupted in numerous ways by an attacker.
SIP provides mechanisms to protect the offer/answer exchange from tampering 
by 3rd parties. Of note is <xref target="RFC4474">Enhancements for Authenticated 
Identity Management in the Session Initiation Protocol (SIP)</xref>, as well as
Section Section 26.3.2 (Security Solutions) of <xref target="RFC3261"/>.
			</t>
		</section>

		<section title="Acknowledgement">
			<t>
The authors would like to thank Christer Holmberg, Rajeev Seth,
Nataraju A B, Byron Campen, Jonathan Rosenberg, Gonzalo Camarillo
and Gao Yang for their thorough reviews and comments.
Many of their suggestions and ideas have been incorporated in this
document.
			</t>
		</section>

	</middle>
	<back>
		<references title="Normative References">
            <?rfc include="reference.RFC.3261"?>
            <?rfc include="reference.RFC.3262"?>
            <?rfc include="reference.RFC.3264"?>
            <?rfc include="reference.RFC.3311"?>
            <?rfc include="reference.RFC.3312"?>
            <?rfc include="reference.RFC.6141"?>
		</references>
		<references title="Informative References">
            <?rfc include="reference.RFC.3725"?>
            <?rfc include="reference.RFC.3959"?>
            <?rfc include="reference.RFC.4474"?>
            <?rfc include="reference.RFC.6080"?>
		</references>
	</back>
</rfc>
