[Asterisk-Dev] Bug report 4783 and RFC 3326: The Reason Header Field for SIP

Mikael Magnusson mikaelmagnusson at glocalnet.net
Tue Aug 2 11:10:47 MST 2005


On Tue, Aug 02, 2005 at 10:40:00AM -0500, Tilghman Lesher wrote:
> On Tuesday 02 August 2005 02:42, Mikael Magnusson wrote:
> > a new header, "X-asterisk-hangupcause", is introduced in bug report
> > #4783 "Adding cleartext hangupcause to BYE and CANCEL" [1].
> >
> > Wouldn't it make more sense to use the Reason header as defined in
> > the standard tracks RFC 3326[2] instead? It explicitly states that
> > the reason header is most useful in BYE and CANCEL requests.
> >
> > Example:
> >      Reason: SIP ;cause=600 ;text="Busy Everywhere"
> 
> That's great when you have a SIP-only system.  However, how do you
> translate between SIP codes and PRI codes?  IAX also used to send around
> text hangup causes, which are great when you're running only IAX
> clients, but aren't so great when you need to communicate the reason a
> call failed back across a PRI.  This is the reason we added PRI hangup
> cause codes to the IAX protocol, via an IE.  The same thing applies to
> SIP:  we need a way to transmit cause codes, regardless of protocol
> translations.

The Reason header can't be used with only SIP cause values. RFC 3326
defines support for both SIP and Q.850 protocols. I believe Q.850 codes
are used by both PRI and H.323. The Reason protocols are registered by
IANA in http://www.iana.org/assignments/sip-parameters.

RFC 3326:

"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)."

  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"

/Mikael Magnusson




More information about the asterisk-dev mailing list