RFC 6228
Session Initiation Protocol (SIP) Response Code for Indication of Terminated Dialog
RFC 6228: Session Initiation Protocol (SIP) Response Code for Indication of Terminated Dialog β¨
- Series: Internet Engineering Task Force (IETF) πΈ
- Author: C. Holmberg, Ericsson π
- Category: Standards Track π
- Date: May 2011 π¦
- ISSN: 2070-1721 π
- Obsoletes / Updates: none listed in this header π«Ά
Abstract π
okay so this spec adds a brand new SIP response code, 199 Early Dialog Terminated π§. A SIP forking proxy and a User Agent Server (UAS) can use it to tell upstream SIP entities (including the User Agent Client (UAC)) that an early dialog has been killed off, before the final response shows up π. Iconic for cleaning up the drama early β¨.
Status of This Memo π
This is an Internet Standards Track document π₯.
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has been through public review and got approved for publication by the Internet Engineering Steering Group (IESG) π. If you want more on Internet Standards, check out Section 2 of RFC 5741 π«Ά.
Info about the current status of this document, any errata, and how to give feedback is at http://www.rfc-editor.org/info/rfc6228 π.
Copyright Notice π
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved β.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the publication date. Please actually read these, because they lay out your rights and restrictions for this doc π. Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as the Simplified BSD License says π
.
Table of Contents ποΈ
1. Introduction ....................................................2
2. Terminology .....................................................4
3. Applicability and Limitation ....................................4
4. User Agent Client Behavior ......................................4
5. User Agent Server Behavior ......................................6
6. Proxy Behavior ..................................................7
7. Backward Compatibility ..........................................9
8. Usage with SDP Offer/Answer .....................................9
9. Message Flow Examples ...........................................9
9.1. Example with a Forking Proxy that Generates 199 ............9
9.2. Example with a Forking Proxy that Receives 200 OK .........10
9.3. Example with Two Forking Proxies, of which One
Generates 199 .............................................11
10. Security Considerations .......................................12
11. IANA Considerations ...........................................13
11.1. IANA Registration of the 199 Response Code ...............13
11.2. IANA Registration of the 199 Option-Tag ..................13
12. Acknowledgements ..............................................13
13. References ....................................................14
13.1. Normative References .....................................14
13.2. Informative References ...................................14
1. Introduction β¨
Okay so, as RFC 3261 [RFC3261] defines, a SIP early dialog gets created when a non-100 provisional response goes out for the initial dialog-starting request (like an INVITE that's outside any existing dialog) π¦. The dialog stays in the early state until a final response gets sent πΈ.
When a proxy gets an initial dialog-starting request, it can forward that request to multiple remote destinations π§. When it does that, it's doing forking [RFC3261] π .
When a forking proxy gets a non-100 provisional response or a 2xx final response, it passes that response upstream toward whoever sent the original request π. After a forking proxy forwards a 2xx final response, it normally generates and sends CANCEL requests downstream to every remote destination where it forked the request tied to that 2xx and hasn't gotten a final response back from yet π. The whole point of the CANCEL requests is to wrap up any early dialogs still hanging around for that request π«Ά.
Upstream SIP entities might end up with multiple 2xx final responses π. When a SIP entity gets the first 2xx final response and doesn't plan to accept any more 2xx final responses, it automatically terminates any other early dialog still outstanding for that request π₯. If a subsequent 2xx final response does show up, it normally generates and sends an ACK request, then a BYE request, using the dialog identifier from that 2xx final response π.
NOTE: A User Agent Client (UAC) can use theRequest-Dispositionheader field [RFC3841] to ask proxies not to generate and sendCANCELrequests downstream once they've gotten the first 2xx final response π.
When a forking proxy gets a non-2xx final response, it doesn't always forward it upstream right away π. Instead, the proxy "stores" the response and waits for later final responses from other remote destinations where the request was forked π. Eventually, the proxy uses a specified mechanism to pick the "best" final response code, then forwards a final response with that code upstream toward whoever sent the request π . When an upstream SIP entity gets the non-2xx final response, it releases the resources tied to the session πΈ. The UAC will either terminate the session setup or retry it π¦.
Since the forking proxy doesn't always forward non-2xx final responses right away, upstream SIP entities (including the UAC that started the request) don't find out immediately that an early dialog has been terminated π. So they keep the resources for that early dialog reserved until the proxy sends a final response, even if the early dialog is already dead π. A SIP entity could use those resources for other things, like accepting subsequent early dialogs it would otherwise have rejected β¨.
This spec defines a new SIP response code, 199 Early Dialog Terminated π. A forking proxy can send a 199 provisional response to let upstream SIP entities know an early dialog has been terminated π§. A UAS can also send a 199 response code, before sending a non-2xx final response, for the same reason π. SIP entities that receive a 199 response can use it to trigger releasing the resources tied to the terminated early dialog β. SIP entities might also use the 199 response to make policy decisions about early dialogs π. For example, a media gate controlling a SIP entity might use the 199 response when deciding which early dialogs get media passed through π.
Section 9 has signalling examples showing when and how a forking proxy generates 199 responses in different situations π¦.
2. Terminology π§
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] π«Ά.
3. Applicability and Limitation π
The 199 response code is an optimization πΈ. It only optimizes how quickly recipients might find out about terminated early dialogs π¦. The optimization it achieves is limited, though π. A UAS normally doesn't send it reliably, and a proxy can't send it reliably when it generates and sends it, so some or all of the 199 responses might get lost before they reach the recipients π. When that happens, recipients behave exactly as they would if the 199 response code weren't used at all π .
One example of how a UAC could use the 199 response: when it gets a 199 response, it releases the resources tied to the terminated early dialog β¨. A UAC could also use the 199 response to make policy decisions about early dialogs π§. For instance, say a UAC is playing media for an early dialog and then gets a 199 response saying that early dialog is terminated. It could start playing media for a different early dialog instead π.
Application designers using the 199 response code MUST ensure that the application's user experience is acceptable even if all 199 responses get lost and never reach the recipients π¨.
Part 1 of 3 is done bestie π Part 2 is coming up next, so stay tuned ππ¦
4. User Agent Client Behavior β¨
okay so bestie, when a UAC π
sends an initial dialog initiation request and it's willing to receive 199 responses, it MUST put a "199" option-tag in the Supported header field [RFC3261] of that request π¦. That option-tag basically says "yes, I support 199s and I'm ready for them" π«Ά. A UAC SHOULD NOT put a "199" option-tag in the Require or Proxy-Require header field [RFC3261] of the request, because in lots of cases it would cause pointless session establishment failures π.
NOTE: The UAC always needs to put a"199"option-tag in theSupportedheader field, so it can say it supports 199s and is willing to receive them. That's true even if it also puts the option-tag inRequireorProxy-Requireπ.
It is RECOMMENDED that a UAC not put a "100rel" option-tag [RFC3262] in its Require header field when it also says it supports 199 responses π. The only exception is if the UAC is also using some other SIP extension or procedure that makes it do so. The reason is kind of iconic: proxies aren't allowed to generate and send 199 responses when the UAC has said provisional responses must be sent reliably π.
When a UAC gets a 199 response, it might release the resources tied to the terminated early dialog π§Ή. It might also use the 199 response to make policy decisions about early dialogs π§ .
NOTE: The 199 response tells the UAC that the early dialog is already terminated. So the UAC doesn't need to send a BYE request to end that early dialog once it gets the 199 π .
NOTE: The 199 response doesn't affect any other early dialogs tied to the same session establishment. For those, the normal SIP rules about transaction timeouts and everything else still apply π.
Once a UAC has received and accepted a 199 response, it MUST NOT send any media associated with the early dialog π«. And if the UAC can connect received media to early dialogs, it MUST NOT process any received media for the early dialog that was terminated π.
If multiple usages [RFC5057] are used within an early dialog, and it isn't clear which dialog usage the 199 response terminates, SIP entities that keep dialog state SHALL NOT release resources associated with the early dialog when they receive the 199 response π. No cap, that one's serious.
If a UAC gets an unreliably sent 199 response on a dialog that hasn't been established yet (this can happen if the 199 reaches the client before the 18x response that would set up the early dialog), it SHALL discard the 199 response ποΈ. If a UAC gets a reliably sent 199 response on a dialog that hasn't been created before, it MUST acknowledge the 199 response, as described in RFC 3262 [RFC3262] π«‘.
If a UAC has received a 199 response for all early dialogs, and no early dialogs tied to the session establishment are left, it stays in the "Proceeding" state [RFC3261] π§. It waits for any later early dialogs to get set up, and eventually for a final response to come through β³.
5. User Agent Server Behavior β¨
If a UAS gets an initial dialog initiation request with a Supported header field that contains a "199" option-tag, it SHOULD NOT send a 199 response on an early dialog tied to that request before it sends a non-2xx final response π
ββοΈ. There are a couple of times a UAS might send one anyway: if it's been configured to because forking proxies or other intermediate SIP entities don't support the 199 response code, or if it's in an environment that says it must send a 199 response before a non-2xx response π.
NOTE: If a UAS has created multiple early dialogs for one initial dialog initiation request (so it's acting kind of like a forking proxy), it doesn't always plan to send a final response on all of them π€·ββοΈ.
NOTE: If theRequireheader field of an initial dialog initiation request contains a"100rel"option-tag, proxies won't be able to generate and send 199 responses. In that situation the UAS might choose to send a 199 response on an early dialog before its non-2xx final response, even if it wouldn't in other cases π.
If the Supported header field of an initial dialog initiation request does not contain a "199" option-tag, the UAC MUST NOT send a 199 response on any early dialog tied to that request π.
When a UAS generates a 199 response, that response MUST contain a To header field tag parameter, so other entities can figure out which early dialog got terminated π. The UAS MUST also insert a Reason header field [RFC3326] with a response code that explains why the early dialog was terminated π. And the UAS MUST NOT insert a "199" option-tag in the Supported, Require, or Proxy-Require header field of the 199 response π.
If a UAS plans to send 199 responses, and it supports the procedures in RFC 3840 [RFC3840], it MAY use the sip.extensions feature tag [RFC3840] during the registration procedure to show it supports the 199 response code π.
A 199 response SHOULD NOT contain a Session Description Protocol (SDP) offer/answer message body, unless the rules in RFC 3264 [RFC3264] require it π¦.
According to RFC 3264, if an INVITE request doesn't contain an SDP offer, and the 199 response is the first reliably sent response for that request, the 199 response is required to contain an SDP offer π§Ύ. In that case, the UAS SHOULD send the 199 response unreliably, or it can send the 199 reliably and include an SDP offer with no m= lines in the response πΈ.
Since a 199 response is only used for information purposes, the UAS SHOULD send it unreliably, unless the "100rel" option-tag is in the Require header field of the associated request π
.
6. Proxy Behavior β¨
When a proxy gets a 199 response to an initial dialog initiation request, it MUST process the response just like any other non-100 provisional response π§. The proxy then forwards the response upstream toward the sender of the associated request β¬οΈ. The proxy MAY release any resources it reserved for the early dialog that got terminated π«§. And if a proxy gets a 199 response out of dialog, it MUST process it the same way it would other non-100 provisional responses received out of dialog π«.
When a forking proxy gets a non-2xx final response to an initial dialog initiation request, and it recognizes that the response terminates one or more early dialogs tied to the request, it MUST generate and send a 199 response upstream for each terminated early dialog that meets all of these conditions π―:
- The forking proxy does not intend to forward the final response immediately (following the rules for a forking proxy).
- The UAC has indicated support (by putting the
"199"option-tag in aSupportedheader field) for the 199 response code in the associated request. - The UAC has not required provisional responses to be sent reliably (meaning it hasn't put the
"100rel"option-tag in aRequireorProxy-Requireheader field) in the associated request. - The forking proxy hasn't already received and forwarded a 199 response for the early dialog.
- The forking proxy hasn't already sent a final response for any of the early dialogs.
So, once the proxy has issued a final response to an initial dialog initiation request, no more 199 responses tied to that request will be generated or forwarded by the proxy πͺ. Period.
When a forking proxy forks an initial dialog initiation request, it generates a unique Via header branch parameter value for each forked leg πΏ. A proxy can figure out whether more forking happened downstream by storing the top Via branch value from each response that creates an early dialog π΅οΈββοΈ. If the same top Via branch value shows up for multiple early dialogs, the proxy knows extra forking happened downstream of it. A non-2xx final response for one specific early dialog also terminates every other early dialog whose creating responses had that same top Via branch value π₯.
Based on implementation policy, a forking proxy MAY wait before sending the 199 response. For example, it might do that if it expects a 2xx final response on another dialog shortly after the non-2xx final response that triggered the 199 β±οΈ.
When a forking proxy generates a 199 response, that response MUST contain a To header field tag parameter that identifies the terminated early dialog π. A proxy MUST also insert a Reason header field containing the SIP response code of the response that triggered the 199 π§Ύ. That SIP response code tells the receiver which code the UAS used to terminate the early dialog, and the receiver might use it to kick off different actions and procedures π. The proxy MUST NOT insert a "199" option-tag in the Supported, Require, or Proxy-Require header field of the 199 response π
ββοΈ.
A forking proxy that supports generating 199 responses MUST keep track of early dialogs, so it knows whether to generate a 199 when it receives a non-2xx final response π. A proxy also MUST keep track of which early dialogs it has already received and forwarded 199 responses for, so it doesn't generate extra 199s for those early dialogs π§ .
If a forking proxy receives a reliably sent 199 response for a dialog it has previously generated and sent a 199 response for, it MUST forward the 199 response π. If a proxy receives an unreliably sent 199 response for which it has previously generated and sent a 199 response, it MAY forward that response, or it MAY discard it π².
When a forking proxy generates and sends a 199 response, the response SHOULD NOT contain a Contact header field or a Record-Route header field [RFC3261] π.
If the Require header field of an initial dialog initiation request contains a "100rel" option-tag, a proxy MUST NOT generate and send 199 responses for that request π«. The reason is that a proxy isn't allowed to generate and send 199 responses reliably π
.
7. Backward Compatibility β¨
Not every SIP entity in a session setup necessarily understands the specific meaning of the 199 Early Dialog Terminated provisional response π§. So the sender of the response MUST be ready to receive SIP requests and responses for the dialog the 199 was sent on, because a proxy can get SIP messages from either direction π. If a UA gets one of those requests, it MUST act exactly as it would if it had received the request after sending the final non-2xx response to the INVITE request, as specified in RFC 3261 π«. A UAC that gets a 199 response for an early dialog MUST NOT send any further requests on that dialog, except for requests that acknowledge reliable responses π ββοΈ. And a proxy MUST forward requests according to RFC 3261, even if the proxy knows the early dialog has been terminated π¨.
A 199 response does not "replace" a final response π«. RFC 3261 is still the boss when it comes to when a final response gets sent π.
8. Usage with SDP Offer/Answer β¨
okay so a 199 response SHOULD NOT carry an SDP offer/answer [RFC3264] message body π ββοΈ, unless the rules in RFC 3264 say it has to π
the tricky bit: if an INVITE doesn't have an SDP offer, and the 199 is the first reliably sent response, then the 199 is required to contain an SDP offer π«£ in that case the UAS SHOULD send the 199 unreliably π¦ or, if it goes reliable, it can include an SDP offer with no "m=" lines π
9. Message Flow Examples π§
9.1. Example with a Forking Proxy that Generates 199
bestie, this one is giving forking chaos π P1 forks an INVITE from a UAC, and it reaches UAS_2, UAS_3, and UAS_4. all three send 18x provisionals to set up early dialogs with the UAC πΈ then UAS_2 and UAS_3 both reject with a 4xx error π P1 sees those 4xx responses and immediately sends 199 responses toward the UAC, so the UAC knows those early dialogs are over π the early dialog leg is in parentheses, so look out for those π
UAC P1 UAS_2 UAS_3 UAS_4
| | | | |
|-- INVITE -->| | | |
| |--- INVITE (2) ->| | |
| |--- INVITE (3) --------->| |
| |--- INVITE (4) ----------------->|
| |<-- 18x (2) -----| | |
|<- 18x (2) --| | | |
| |<-- 18x (3) -------------| |
|<- 18x (3) --| | | |
| |<-- 18x (4) ---------------------|
|<- 18x (4) --| | | |
| |<-- 4xx (2) -----| | |
| |--- ACK (2) ---->| | |
|<- 199 (2) --| | | |
| |<-- 4xx (3) -------------| |
| |--- ACK (3) ------------>| |
|<- 199 (3) --| | | |
| |<-- 200 (4) ---------------------|
|<- 200 (4) --| | | |
|-- ACK (4) ->| | | |
| |--- ACK (4) -------------------->|
| | | | |
Figure 1: Example Call Flow
9.2. Example with a Forking Proxy that Receives 200 OK
this one is a glow-up π P1 forks an INVITE from a UAC to UAS_2, UAS_3, and UAS_4, and all of them send 18x provisionals to build early dialogs with the UAC π¦ then UAS_4 says yes and sends a 200 OK final response π when P1 gets that 200 OK, it immediately forwards it to the UAC β¨
here's the lowkey important part π«’ P1 does NOT send 199 responses for the early dialogs from UAS_2 and UAS_3, because P1 hasn't gotten any final responses on those yet. even if P1 sends CANCEL requests to UAS_2 and UAS_3, P1 can still get a 200 OK final response from UAS_2 or UAS_3, and then P1 would have to forward that toward the UAC π³ the early dialog leg is in parentheses, as always π
UAC P1 UAS_2 UAS_3 UAS_4
| | | | |
|-- INVITE -->| | | |
| |--- INVITE (2) ->| | |
| |--- INVITE (3) --------->| |
| |--- INVITE (4) ----------------->|
| |<-- 18x (2) -----| | |
|<- 18x (2) --| | | |
| |<-- 18x (3) -------------| |
|<- 18x (3) --| | | |
| |<-- 18x (4) ---------------------|
|<- 18x (4) --| | | |
| |<-- 200 (4) ---------------------|
|<- 200 (4) --| | | |
|-- ACK (4) ->| | | |
| |--- ACK (4) -------------------->|
| | | | |
Figure 2: Example Call Flow
9.3. Example with Two Forking Proxies, of which One Generates 199
okay this is the most dramatic one, I'm obsessed π P1 forks an INVITE from a UAC. one copy reaches UAS_2, and the other copies go to another proxy, P2, which forks them to UAS_3 and UAS_4 π UAS_3 and UAS_4 send 18x provisionals to set up early dialogs with the UAC, and then both of them reject the INVITE with a 4xx error π
P2 doesn't support the 199 response code, so it just forwards a single 4xx response. P1 DOES support 199, and when it gets that 4xx from P2, it also manages to link the early dialogs from both UAS_3 and UAS_4 to that response π§ so P1 generates and sends two 199 responses, one for each early dialog, to show they've been terminated π₯ the early dialog leg is in parentheses π¦
UAC P1 P2 UAS_2 UAS_3 UAS_4
| | | | | |
|-- INVITE -->| | | | |
| |-- INVITE (2) ------------------>| | |
| |-- INVITE ---->| | | |
| | |--- INVITE (3) --------->| |
| | |--- INVITE (4) ----------------->|
| | |<-- 18x (3) -------------| |
| |<- 18x (3) ----| | | |
|<- 18x (3) --| | | | |
| | |<-- 18x (4) ---------------------|
| |<- 18x (4) ----| | | |
|<- 18x (4) --| | | | |
| | |<-- 4xx (3) -------------| |
| | |--- ACK (3) ------------>| |
| | |<-- 4xx (4) ---------------------|
| | |--- ACK (4) -------------------->|
| |<- 4xx (3) ----| | | |
| |-- ACK (3) --->| | | |
|<- 199 (3) --| | | | |
|<- 199 (4) --| | | | |
| |<- 200 (2) ----------------------| | |
|<- 200 (2) --| | | | |
|-- ACK (2) ->| | | | |
| |-- ACK (2) --------------------->| | |
| | | | | |
Figure 3: Example Call Flow
10. Security Considerations π
okay bestie, serious moment π«Ά general security issues for SIP responses are covered in RFC 3261 π but the 199 response is a special case, and it's giving danger π¨ someone could totally use it to attack and kill specific early dialogs (the other early dialogs won't be touched) π€
also, if a man-in-the-middle makes a 199 that terminates a specific dialog and sends it toward the UAC, it can take a while before the UAS figures out that the UAC, and possibly stateful intermediates, have ended the dialog π° SIP security mechanisms (for example, hop-to-hop Transport Layer Security (TLS)) can be used to minimize, or eliminate, the risk of these attacks π so please don't skip the security stuff, it's literally important π
11. IANA Considerations π
this section registers a new SIP response code AND a new option-tag, following the procedures of RFC 3261 β¨
11.1. IANA Registration of the 199 Response Code
this section registers the new SIP response code 199 π the required info for this registration, as RFC 3261 specifies, is:
RFC Number: RFC 6228
Response Code Number: 199
Default Reason Phrase: Early Dialog Terminated
11.2. IANA Registration of the 199 Option-Tag
this section registers the new SIP option-tag 199 π·οΈ the required info for this registration, as RFC 3261 specifies, is:
Name: 199
Description: This option-tag is for indicating support of the 199
Early Dialog Terminated provisional response code. When
present in a Supported header of a request, it indicates that
the UAC supports the 199 response code. When present in a
Require or Proxy-Require header field of a request, it
indicates that the UAS, or proxies, MUST support the 199
response code. It does not require the UAS, or proxies, to
actually send 199 responses.
12. Acknowledgements π·
huge thanks to Paul Kyzivat, Dale Worley, Gilad Shaham, Francois Audet, Attila Sipos, Robert Sparks, Brett Tate, Ian Elz, Hadriel Kaplan, Timothy Dwight, Dean Willis, Serhad Doken, John Elwell, Gonzalo Camarillo, Adam Roach, Bob Penfield, Tom Taylor, Ya Ching Tan, Keith Drage, Hans Erik van Elburg, and Cullen Jennings for their feedback and suggestions π«Άπ
13. References π
13.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston,
A., Peterson, J., Sparks, R., Handley, M., and E.
Schooler, "SIP: Session Initiation Protocol", RFC 3261,
June 2002.
[RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of
Provisional Responses in Session Initiation Protocol
(SIP)", RFC 3262, June 2002.
[RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model
with Session Description Protocol (SDP)", RFC 3264,
June 2002.
[RFC3326] Schulzrinne, H., Oran, D., and G. Camarillo, "The Reason
Header Field for the Session Initiation Protocol (SIP)",
RFC 3326, December 2002.
[RFC3840] Rosenberg, J., Schulzrinne, H., and P. Kyzivat,
"Indicating User Agent Capabilities in the Session
Initiation Protocol (SIP)", RFC 3840, August 2004.
13.2. Informative References
[RFC3841] Rosenberg, J., Schulzrinne, H., and P. Kyzivat, "Caller
Preferences for the Session Initiation Protocol (SIP)",
RFC 3841, August 2004.
[RFC5057] Sparks, R., "Multiple Dialog Usages in the Session
Initiation Protocol", RFC 5057, November 2007.
Author's Address π
Christer Holmberg
Ericsson
Hirsalantie 11
Jorvas 02420
Finland
EMail: christer.holmberg@ericsson.com
π¦ where this page comes from
- ietf: rfc6228 2011-05
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms