NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

javax.sip.header
Interface ReasonHeader

All Superinterfaces:
Cloneable, Header, Parameters, Serializable
All Known Implementing Classes:
Reason

public interface ReasonHeader
extends Parameters, Header

This interface represents the Reason header, as defined by RFC3326, this header is not part of RFC3261.

The ReasonHeader provides information on why a SIP request was issued, often useful when creating services and also used to encapsulate a final status code in a provisional response, which is needed to resolve the "Heterogeneous Error Response Forking Problem".

The Reason header field 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 155 (Update Requested) responses. When used in requests, clients and servers are free to ignore this header field. It has no impact on protocol processing.

Examples of the ReasonHeader usage are:

A server must ignore Headers that it does not understand. A proxy must not remove or modify Headers that it does not understand.

Version:
1.2
Author:
BEA Systems, NIST

Field Summary
static String NAME
          Name of ReasonHeader
 
Method Summary
 int getCause()
          Gets the cause value of the ReasonHeader
 String getProtocol()
          Gets the protocol value of the ReasonHeader
 String getText()
          Gets the text value of the ReasonHeader
 void setCause(int cause)
          Sets the cause value of the ReasonHeader.
 void setProtocol(String protocol)
          Sets the protocol of the ReasonHeader, for example SIP or Q.850.
 void setText(String text)
          Sets the text value of the ReasonHeader.
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, hashCode, toString
 

Field Detail

NAME

static final String NAME
Name of ReasonHeader

See Also:
Constant Field Values
Method Detail

getCause

int getCause()
Gets the cause value of the ReasonHeader

Returns:
the integer value of the cause of the ReasonHeader

setCause

void setCause(int cause)
              throws InvalidArgumentException
Sets the cause value of the ReasonHeader. Any SIP status code MAY appear in the Reason header field of a request, assuming the protocol field of the ReasonHeader is SIP.

Parameters:
cause - - the new integer value of the cause of the ReasonHeader
Throws:
InvalidArgumentException - if the cause value is less than zero.

setProtocol

void setProtocol(String protocol)
                 throws ParseException
Sets the protocol of the ReasonHeader, for example SIP or Q.850.

Parameters:
protocol - - the new string value of the protocol of the ReasonHeader
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the protocol value.

getProtocol

String getProtocol()
Gets the protocol value of the ReasonHeader

Returns:
the string value of the protocol of the ReasonHeader

setText

void setText(String text)
             throws ParseException
Sets the text value of the ReasonHeader.

Parameters:
text - - the new string value of the text of the ReasonHeader
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the text value.

getText

String getText()
Gets the text value of the ReasonHeader

Returns:
the string value of the text of the ReasonHeader

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.