RFC 3326 PROPOSED STANDARD SIP · SIGNALING · HEADERS

SIP Reason header: The Reason Header Field for the Session Initiation Protocol (SIP)

A SIP header that records the protocol and cause behind a request.

On rfc-editor.org ↗
PUBLISHED
December 2002
AUTHORS
H. Schulzrinne, D. Oran, G. Camarillo
STREAM
IETF
UPDATED BY
RFC 8606 — ISUP Cause Location, RFC 9366 — SIP Reason Header
DEFINED PROTOCOLS
SIP and Q.850
Q.850 CAUSE 16
Normal Call Clearing
EFFECT ON PROCESSING
None; implementations may ignore it
DOI
10.17487/RFC3326

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                     H. Schulzrinne
Request for Comments: 3326                           Columbia University
Category: Standards Track                                        D. Oran
                                                                   Cisco
                                                            G. Camarillo
                                                                Ericsson
                                                           December 2002


   The Reason Header Field for the Session Initiation Protocol (SIP)

Status of this Memo

   This document specifies an Internet standards track protocol for the
   Internet community, and requests discussion and suggestions for
   improvements.  Please refer to the current edition of the "Internet
   Official Protocol Standards" (STD 1) for the standardization state
   and status of this protocol.  Distribution of this memo is unlimited.

Copyright Notice

   Copyright (C) The Internet Society (2002).  All Rights Reserved.

Abstract

   For creating services, it is often useful to know why a Session
   Initiation Protocol (SIP) request was issued.  This document defines
   a header field, Reason, that provides this information.  The Reason
   header field is also intended to be used to encapsulate a final
   status code in a provisional response.  This functionality is needed
   to resolve the "Heterogeneous Error Response Forking Problem", or
   HERFP.

Table of Contents

   1.   Introduction ...............................................  2
   1.1. Terminology ................................................  3
   2.   The Reason Request Header Field ............................  3
   3.   Examples ...................................................  4
   3.1. Call Completed Elsewhere ...................................  4
   3.2. Refusing an Offer that Comes in a Response .................  4
   3.3. Third Party Call Control ...................................  5
   3.4. ISUP interworking ..........................................  5
   4.   IANA Considerations ........................................  6
   5.   Security Considerations ....................................  6
   6.   Acknowledgments ............................................  7
   7.   Authors' Addresses .........................................  7
   8.   Normative References .......................................  7
   9.   Full Copyright Statement ...................................  8

1. Introduction

   The same SIP [1] request can be issued for a variety of reasons.  For
   example, a SIP CANCEL request can be issued if the call has completed
   on another branch or was abandoned before answer.  While the protocol
   and system behavior is the same in both cases, namely, alerting will
   cease, the user interface may well differ.  In the second case, the
   call may be logged as a missed call, while this would not be
   appropriate if the call was picked up elsewhere.

   Third party call controllers sometimes generate a SIP request upon
   reception of a SIP response from another dialog.  Gateways generate
   SIP requests after receiving messages from a different protocol than
   SIP.  In both cases the client may be interested in knowing what
   triggered the SIP request.

   SIP responses already offer a means of informing the user of why a
   request failed.  The simple mechanism in this document accomplishes
   something roughly similar for requests.

   An INVITE can sometimes be rejected not because the session
   initiation was declined, but because some aspect of the request was
   not acceptable.  If the INVITE forked and resulted in a rejection,
   the error response may never be forwarded to the client unless all
   the other branches also reject the request.  This problem is known as
   the "Heterogeneous Error Response Forking Problem", or HERFP.  It is
   foreseen that a solution to this problem may involve encapsulating
   the final error response in a provisional response. The Reason header
   field is a candidate to be used for such encapsulation.

   Initially, the Reason header field defined here appears to be most
   useful for BYE and CANCEL requests, but it can appear in any request
   within a dialog, in any CANCEL request and in any response whose
   status code explicitly allows the presence of this header field.

   Note that the Reason header field is usually not needed in responses
   because the status code and the reason phrase already provide
   sufficient information.

   Clients and servers are free to ignore this header field.  It has no
   impact on protocol processing.

1.1 Terminology

   In this document, the key words "MUST", "MUST NOT", "REQUIRED",
   "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
   and "OPTIONAL" are to be interpreted as described in BCP 14, RFC 2119
   [2] and indicate requirement levels for compliant SIP
   implementations.

2. The Reason Header Field

   The Reason header field MAY appear in any request within a dialog, in
   any CANCEL request and in any response whose status code explicitly
   allows the presence of this header field.  The syntax of the header
   field follows the standard SIP parameter syntax.

 Reason            =  "Reason" HCOLON reason-value *(COMMA reason-value)
 reason-value      =  protocol *(SEMI reason-params)
 protocol          =  "SIP" / "Q.850" / token
 reason-params     =  protocol-cause / reason-text
                      / reason-extension
 protocol-cause    =  "cause" EQUAL cause
 cause             =  1*DIGIT
 reason-text       =  "text" EQUAL quoted-string
 reason-extension  =  generic-param

   The following values for the protocol field have been defined:

      SIP: The cause parameter contains a SIP status code.

      Q.850: The cause parameter contains an ITU-T Q.850 cause value
           in decimal representation.

   Examples are:

      Reason: SIP ;cause=200 ;text="Call completed elsewhere"
      Reason: Q.850 ;cause=16 ;text="Terminated"
      Reason: SIP ;cause=600 ;text="Busy Everywhere"
      Reason: SIP ;cause=580 ;text="Precondition Failure"

   Proxies generating a CANCEL request upon reception of a CANCEL from
   the previous hop that contains a Reason header field SHOULD copy it
   into the new CANCEL request.

   In normal SIP operation, a SIP status code in a response provides the
   client with information about the request that triggered the
   response, the session parameters, or the user.  For example, a 405
   (Method not allowed) response indicates that the request contained an
   unsupported method.  A 488 (Not Acceptable Here) indicates that the
   session parameters are unacceptable and a 486 (Busy Here) provides
   information about the status of the user.

   Any SIP status code MAY appear in the Reason header field of a
   request.  However, status codes that provide information about the
   user and about session parameters are typically useful for
   implementing services whereas status codes intended to report errors
   about a request are typically useful for debugging purposes.

   A SIP message MAY contain more than one Reason value (i.e., multiple
   Reason lines), but all of them MUST have different protocol values
   (e.g., one SIP and another Q.850).  An implementation is free to
   ignore Reason values that it does not understand.

3. Examples

   This section contains a number of examples that illustrate the use of
   the Reason header field.

3.1 Call Completed Elsewhere

   A proxy forks an INVITE request and one of the branches returns a 200
   (OK).  The forking proxy includes this status code in a Reason header
   field in the CANCEL request that it sends to the rest of the
   branches.

3.2 Refusing an Offer that Comes in a Response

   A client sends an empty INVITE and receives an unacceptable offer in
   a 200 (OK) response.  The client sends an ACK with a correctly
   formatted answer and immediately sends a BYE to terminate the
   session.  The client includes a 488 (Not Acceptable Here) status code
   in a Reason header field.

3.3 Third Party Call Control

   The third party call controller of figure 1 tries to establish a
   session between A and B.  However, user B is busy.  The controller
   sends a BYE with the status code 486 (Busy Here) in a Reason header
   field.

      A                Controller            B
      |   INV  no SDP     |                  |
      |<------------------|                  |
      |                   |                  |
      |    200 SDP A1     |                  |
      |-----------------> |                  |
      |                   |                  |
      |   ACK  SDP held   |                  |
      |<------------------|                  |
      |                   |                  |
      |                   |   INV no SDP     |
      |                   |----------------->|
      |                   |                  |
      |                   |  486 Busy Here   |
      |                   |<-----------------|
      |                   |                  |
      |                   |       ACK        |
      |                   |----------------->|
      |     BYE (486)     |                  |
      |<------------------|                  |
      |                   |                  |
      |     200 OK        |                  |
      |-----------------> |                  |
      |                   |                  |

         Figure 1: Third Party Call Control

3.4 ISUP interworking

   The PSTN gateway of figure 2 generates an INVITE that has to be
   CANCELed when a REL (release) message is received from the ISUP side.
   The CANCEL request contains the Q.850 cause value (16 Normal Call
   Clearing) of the REL message.

      A                Gateway               B
      |       IAM         |                  |
      |-----------------> |                  |
      |                   |     INVITE       |
      |                   |----------------->|
      |                   |                  |
      |                   |   100 Trying     |
      |                   |<-----------------|
      |     REL (16)      |                  |
      |-----------------> |                  |
      |                   | CANCEL (Q.850 16)|
      |                   |----------------->|
      |                   |      200 OK      |
      |                   |<-----------------|

             Figure 2: ISUP Interworking

4. IANA Considerations

   This document defines a new SIP header field, "Reason", according to
   Section 27 of RFC 3261.

   Protocol values (and their associated protocol cause) to be used with
   this header field are registered by the IANA into a new sub-registry
   under http://www.iana.org/assignments/sip-parameters, labeled "Reason
   Protocols".  Reason protocols MUST refer to either an ITU-T
   Recommendation number, an IETF protocol name or the recognized
   protocol identifier from another standardization organization.
   Protocol cause describes the source of the 'cause' field in the
   Reason header field.

   The only entries in the registry for the time being are:

   Protocol Value   Protocol Cause            Reference
   --------------   ---------------           -----------
   SIP              Status code               RFC 3261
   Q.850            Cause value in decimal    ITU-T Q.850
                    representation

5. Security Considerations

   Spoofing or removing the Reason header field from a response in a
   HERFP scenario can make it impossible for a client to update properly
   its previous request, making therefore session establishment
   impossible. Thus, it is RECOMMENDED that this header field is
   protected by a suitable integrity mechanism.

   properly its previous request, making therefore session establishment
   impossible. Thus, it is RECOMMENDED that this header field is
   protected by a suitable integrity mechanism.

6. Acknowledgments

   Jonathan Rosenberg, Rohan Mahy and Vijay K. Gurbani provided helpful
   comments and suggestions.

8. Normative References

   [1] 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.

   [2] Bradner, S., "Key words for use in RFCs to indicate requirement
       levels," BCP 14, RFC 2119, March 1997.

7. Authors' Addresses

   Henning Schulzrinne
   Dept. of Computer Science
   Columbia University
   1214 Amsterdam Avenue
   New York, NY 10027
   USA

   EMail:  schulzrinne@cs.columbia.edu


   David R. Oran
   Cisco Systems, Inc.
   Acton, MA
   USA

   EMail:  oran@cisco.com


   Gonzalo Camarillo
   Ericsson
   Advanced Signalling Research Lab.
   FIN-02420 Jorvas
   Finland

   EMail:  Gonzalo.Camarillo@ericsson.com

9.  Full Copyright Statement

   Copyright (C) The Internet Society (2002).  All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works.  However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assigns.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement

   Funding for the RFC Editor function is currently provided by the
   Internet Society.

ISO Plain Language

On this page
PROBLEMThe same SIP request can be sent for different reasons, and a receiver may need to know what caused it to provide the right service or explanation.
MECHANISMThe Reason header carries a protocol name, a numeric cause, and optional text. RFC 3326 defines values for SIP status codes and Q.850 causes.
STATUS TODAYThe header does not change SIP protocol processing and can be ignored. RFC 3326 is updated by RFC 8606 and RFC 9366.

§1Why a Request Needs a Cause

A SIP CANCEL request can mean that a call completed on another branch or that the caller stopped waiting. Both stop alerting, but a user interface may want to record them differently.

Third-party call controllers and gateways may also create a SIP request because of another dialog or another protocol. RFC 3326 adds a header that can tell the receiver what triggered a request. It also identifies the Reason header as a possible way to carry a final error code in a provisional response for the Heterogeneous Error Response Forking Problem (HERFP).

The header is initially most useful on BYE and CANCEL. It has no effect on protocol processing, and clients and servers may ignore it.

A request can look the same even when it was sent for a different reason. The Reason header gives a program extra information to explain or handle that request.

§2The Reason Header Value

A Reason header can contain one or more values. Each value names a protocol and can include semicolon-separated parameters, including a numeric cause and quoted text.

The SIP protocol value means the cause is a SIP status code. Q.850 means the cause is a decimal Q.850 cause value. The syntax also permits other protocol tokens. For example, Reason: SIP ;cause=200 ;text="Call completed elsewhere" records a SIP status code with explanatory text.

The header MAY appear in any request within a dialog, any CANCEL request, and responses whose status code explicitly permits it. A response often needs no Reason header because its status code and reason phrase already explain the result.

A Reason value says which protocol defines its number and can add a short explanation. The two defined choices are SIP status codes and Q.850 causes.

REASON HEADER GRAMMAR AND EXAMPLES FROM RFC 3326
Reason values
Reason            =  "Reason" HCOLON reason-value *(COMMA reason-value)
reason-value      =  protocol *(SEMI reason-params)
protocol          =  "SIP" / "Q.850" / token
reason-params     =  protocol-cause / reason-text / reason-extension
protocol-cause    =  "cause" EQUAL cause
cause             =  1*DIGIT
reason-text       =  "text" EQUAL quoted-string

Reason: SIP ;cause=200 ;text="Call completed elsewhere"
Reason: Q.850 ;cause=16 ;text="Terminated"

§2Using and Forwarding Reasons

Any SIP status code MAY appear as a cause in a request. Codes about a user or session parameters can help implement a service; codes about request errors can help with debugging.

A SIP message MAY contain more than one Reason value, but each value MUST name a different protocol. An implementation may ignore a value it does not understand. A proxy that creates a CANCEL after receiving one with a Reason header SHOULD copy the header into its new request.

A message can carry separate reasons from different protocols. A proxy should preserve the reason when it creates a new CANCEL from an earlier one.

§3Examples of the Cause in Use

When one branch of a forked INVITE succeeds, a proxy can put the successful 200 status in the Reason header of CANCEL requests sent to the other branches. This lets a client distinguish a call completed elsewhere from an abandoned call.

A client that rejects an offer received in a 200 response can include 488 in a Reason header on its BYE. A third-party controller can include 486 when it ends a call because the other user is busy.

For ISUP interworking, a gateway can put Q.850 cause 16 (Normal Call Clearing) from a release message in the Reason header of its SIP CANCEL.

The examples show how a request can carry the event that caused it: a call answered elsewhere, an unacceptable offer, a busy user, or a release from an ISUP network.

§4Registered Protocol Values

The document defines the SIP Reason header field and an IANA subregistry called Reason Protocols. Each registered protocol value identifies the source and meaning of the cause parameter.

A value must refer to an ITU-T Recommendation, an IETF protocol name, or a recognized protocol identifier from another standards organization. The initial entries are SIP, whose cause is a status code, and Q.850, whose cause is a decimal cause value.

An official registry lists which protocols can be named in a Reason header. Each entry explains what its cause number means.

§5Protecting the Reason Header

In a HERFP scenario, an attacker who spoofs or removes a Reason header in a response may prevent a client from updating its earlier request correctly. The RFC says this can make session establishment impossible.

For that reason, the Reason header is RECOMMENDED to be protected by a suitable integrity mechanism.

If someone changes or removes a Reason value, a client may not be able to complete its session. An integrity mechanism can help protect the header from tampering.

§7References