|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.EventObject
|
+--jain.protocol.ip.sip.message.Message
|
+--jain.protocol.ip.sip.message.ResponseMessage
This class represents a SIP Response message. After receiving and interpreting a RequestMessage, the recipient responds with a ResponseMessage. As well as Headers and a possible body, ResponseMessages also contain a Status-Code and a Reason-Phrase.
The Status-Code is a 3-digit integer result code that indicates the outcome of the attempt to understand and satisfy the RequestMessage. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata, whereas the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason-Phrase.
SIP/2.0 Defines status codes in the following classes:
SIP status codes are extensible. SIP applications are not required to understand the meaning of all registered response codes, though such understanding is obviously desirable. However, applications must understand the class of any status code, as indicated by the first digit, and treat any unrecognized status code as being equivalent to the x00 status code of that class, with the exception that an unrecognized status code must not be cached. For example, if a client receives an unrecognized status code of 431, it can safely assume that there was something wrong with its request and treat the ResponseMessage as if it had received a BAD_REQUEST(400) status code. In such cases, user agents should present to the user the message body returned with the ResponseMessage, since that message body is likely to include human-readable information which will explain the unusual status.
Here is the list of currently defined status codes grouped by class (x00 codes are in bold) :
| Class | Code |
| INFORMATIONAL (1xx) |
|
| SUCCESS (2xx) |
|
| REDIRECTION (3xx) |
|
| CLIENT_ERROR (4xx) |
|
| SERVER_ERROR (5xx) |
|
| GLOBAL_ERROR (6xx) |
|
| Field Summary | |
static int |
ADDRESS_INCOMPLETE
The server received a RequestMessage with a ToHeader address or Request-URI that was incomplete. |
static int |
ALTERNATIVE_SERVICE
The call was not successful, but alternative services are possible. |
static int |
AMBIGUOUS
The callee address provided in the RequestMessage was ambiguous. |
static int |
BAD_EXTENSION
The server did not understand the protocol extension specified in a RequireHeader. |
static int |
BAD_GATEWAY
The server, while acting as a gateway or proxy, received an invalid ResponseMessage from the downstream server it accessed in attempting to fulfill the RequestMessage. |
static int |
BAD_REQUEST
The RequestMessage could not be understood due to malformed syntax. |
static int |
BUSY_EVERYWHERE
The callee's end system was contacted successfully but the callee is busy and does not wish to take the call at this time. |
static int |
BUSY_HERE
The callee's end system was contacted successfully but the callee is currently not willing or able to take additional calls. |
static int |
CALL_IS_BEING_FORWARDED
A proxy server may use this status code to indicate that the call is being forwarded to a different set of destinations. |
static int |
CALL_LEG_OR_TRANSACTION_DOES_NOT_EXIST
This status is returned under two conditions: The server received a ByeMessage that does not match any existing call leg or the server received a CancelMessage that does not match any existing transaction. |
static int |
CONFLICT
The RequestMessage could not be completed due to a conflict with the current state of the resource. |
static int |
DECLINE
The callee's machine was successfully contacted but the user explicitly does not wish to or cannot participate. |
static int |
DOES_NOT_EXIST_ANYWHERE
The server has authoritative information that the user indicated in the ToHeader of the RequestMessage does not exist anywhere. |
static int |
ENTITY_TOO_LARGE
The server is refusing to process a RequestMessage because the RequestMessage entity is larger than the server is willing or able to process. |
static int |
FORBIDDEN
The server understood the RequestMessage, but is refusing to fulfill it. |
static int |
GATEWAY_TIME_OUT
The server, while acting as a gateway, did not receive a timely ResponseMessage from the server (e.g., a location server) it accessed in attempting to complete the RequestMessage. |
static int |
GONE
The requested resource is no longer available at the server and no forwarding address is known. |
static int |
INTERNAL_SERVER_ERROR
The server encountered an unexpected condition that prevented it from fulfilling the RequestMessage. |
static int |
LENGTH_REQUIRED
The server refuses to accept the RequestMessage without a defined Content- Length. |
static int |
LOOP_DETECTED
The server received a RequestMessage with a ViaHeader containing itself. |
static int |
METHOD_NOT_ALLOWED
The method specified in the RequestMessage is not allowed for the address identified by the Request-URI. |
static int |
MOVED_PERMANENTLY
The user can no longer be found at the address in the Request-URI and the requesting client should retry at the new address(es) given by the ContactHeader(s). |
static int |
MOVED_TEMPORARILY
The requesting client should retry the RequestMessage at the new address(es) given by the ContactHeader(s). |
static int |
MULTIPLE_CHOICES
The address in the RequestMessage resolved to several choices, each with its own specific location, and the user (or user agent) can select a preferred communication end point and redirect its RequestMessage to that location. |
static int |
NOT_ACCEPTABLE
The resource identified by the RequestMessage is only capable of generating ResponseMessage entities which have content characteristics not acceptable according to the AcceptHeaders sent in the RequestMessage. |
static int |
NOT_FOUND
The server has definitive information that the user does not exist at the domain specified in the Request-URI. |
static int |
NOT_IMPLEMENTED
The server does not support the functionality required to fulfill the RequestMessage. |
static int |
OK
The RequestMessage has succeeded. |
static int |
PAYMENT_REQUIRED
Reserved for future use. |
static int |
PROXY_AUTHENTICATION_REQUIRED
This code is similar to UNAUTHORIZED, but indicates that the client must first authenticate itself with the proxy. |
static int |
QUEUED
The called party is temporarily unavailable, but the callee has decided to queue the call rather than reject it. |
static int |
REQUEST_TIMEOUT
The server could not produce a ResponseMessage, e.g., a user location, within the time indicated in the ExpiresHeader of the RequestMessage. |
static int |
RINGING
The called user agent has located a possible location where the user has registered recently and is trying to alert the user. |
static int |
SEE_OTHER
See other. |
static int |
SERVICE_UNAVAILABLE
The server is currently unable to handle the RequestMessage due to a temporary overloading or maintenance of the server. |
static int |
SESSION_NOT_ACCEPTABLE
The user's agent was contacted successfully but some aspects of the session description such as the requested media, bandwidth, or addressing style were not acceptable. |
static int |
SIP_VERSION_NOT_SUPPORTED
The server does not support, or refuses to support, the SIP protocol version that was used in the RequestMessage. |
static int |
TEMPORARILY_NOT_AVAILABLE
The callee's end system was contacted successfully but the callee is currently unavailable (e.g., not logged in or logged in in such a manner as to preclude communication with the callee). |
static int |
TOO_MANY_HOPS
The server received a RequestMessage that contains more ViaHeaders than allowed by the MaxForwardsHeader. |
static int |
TRYING
Some unspecified action is being taken on behalf of this call (e.g., a database is being consulted), but the user has not yet been located. |
static int |
UNAUTHORIZED
The RequestMessage requires user authentication. |
static int |
UNSUPPORTED_MEDIA_TYPE
The server is refusing to service the RequestMessage because the message body of the RequestMessage is in a format not supported by the requested resource for the requested method. |
static int |
URI_TOO_LARGE
The server is refusing to service the RequestMessage because the Request-URI is longer than the server is willing to interpret. |
static int |
USE_PROXY
The requested resource must be accessed through the proxy given by the ContactHeader. |
| Constructor Summary | |
ResponseMessage(java.lang.Object source,
int statusCode,
CallIdHeader callIdheader,
CSeqHeader cSeqHeader,
FromHeader fromHeader,
ToHeader toHeader,
ViaHeader[] viaHeaders)
Constructor of ResponseMessage without body |
|
ResponseMessage(java.lang.Object source,
int statusCode,
CallIdHeader callIdheader,
CSeqHeader cSeqHeader,
FromHeader fromHeader,
ToHeader toHeader,
ViaHeader[] viaHeaders,
java.lang.Object body,
ContentTypeHeader contentTypeHeader)
Constructor of ResponseMessage with body |
|
ResponseMessage(java.lang.Object source,
int statusCode,
RequestMessage request)
Constructor of ResponseMessage without body based on received RequestMessage |
|
ResponseMessage(java.lang.Object source,
int statusCode,
RequestMessage request,
java.lang.Object body,
ContentTypeHeader contentTypeHeader)
Constructor of ResponseMessage with body based on received RequestMessage |
|
| Method Summary | |
AllowHeader[] |
getAllowHeaders()
Gets AllowHeaders of ResponseMessage. |
ProxyAuthenticateHeader |
getProxyAuthenticateHeader()
Gets ProxyAuthenticateHeader of ResponseMessage. |
java.lang.String |
getReasonPhrase()
Gets reason phrase of ResponseMessage. |
ServerHeader[] |
getServerHeaders()
Gets ServerHeaders of ResponseMessage. |
static java.lang.String |
getStandardReasonPhrase(int statusCode)
Gets standard reason phrase for status code. |
java.lang.String |
getStartLine()
|
int |
getStatusCode()
Gets status code of ResponseMessage. |
UnsupportedHeader[] |
getUnsupportedHeaders()
Gets UnsupportedHeaders of ResponseMessage. |
WarningHeader[] |
getWarningHeaders()
Gets WarningHeaders of ResponseMessage. |
WWWAuthenticateHeader[] |
getWWWAuthenticateHeaders()
Gets WWWAuthenticateHeaders of ResponseMessage. |
boolean |
hasAllowHeaders()
Returns boolean value to indicate if ResponseMessage has any AllowHeaders. |
boolean |
hasProxyAuthenticateHeader()
Returns boolean value to indicate if ResponseMessage has ProxyAuthenticateHeader. |
boolean |
hasServerHeaders()
Returns boolean value to indicate if ResponseMessage has any ServerHeaders. |
boolean |
hasUnsupportedHeaders()
Returns boolean value to indicate if ResponseMessage has any UnsupportedHeaders. |
boolean |
hasWarningHeaders()
Returns boolean value to indicate if ResponseMessage has any WarningHeaders. |
boolean |
hasWWWAuthenticateHeaders()
Returns boolean value to indicate if ResponseMessage has any WWWAuthenticateHeaders. |
void |
removeAllowHeaders()
Removes all AllowHeaders from ResponseMessage's Header list. |
void |
removeProxyAuthenticateHeader()
Removes ProxyAuthenticateHeader from ResponseMessage's Header list. |
void |
removeServerHeaders()
Removes all ServerHeaders from ResponseMessage's Header list. |
void |
removeUnsupportedHeaders()
Removes all UnsupportedHeaders from ResponseMessage's Header list. |
void |
removeViaHeader()
Removes first ViaHeader from ResponseMessage's Header list. |
void |
removeWarningHeaders()
Removes all WarningHeaders from ResponseMessage's Header list. |
void |
removeWWWAuthenticateHeaders()
Removes WWWAuthenticateHeaders from ResponseMessage's Header list. |
void |
setAllowHeaders(AllowHeader[] allowHeaders)
Sets AllowHeaders of ResponseMessage. |
void |
setProxyAuthenticateHeader(ProxyAuthenticateHeader proxyAuthenticateHeader)
Sets ProxyAuthenticateHeader of ResponseMessage. |
void |
setReasonPhrase(java.lang.String reasonPhrase)
Sets reason phrase of ResponseMessage. |
void |
setServerHeaders(ServerHeader[] serverHeaders)
Sets ServerHeaders of ResponseMessage. |
void |
setStatusCode(int statusCode)
Sets status code of ResponseMessage. |
void |
setUnsupportedHeaders(UnsupportedHeader[] unsupportedHeaders)
Sets UnsupportedHeaders of ResponseMessage. |
void |
setWarningHeaders(WarningHeader[] warningHeaders)
Sets WarningHeaders of ResponseMessage. |
void |
setWWWAuthenticateHeaders(WWWAuthenticateHeader[] wwwAuthenticateHeaders)
Sets WWWAuthenticateHeaders of ResponseMessage. |
| Methods inherited from class java.util.EventObject |
getSource |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int TRYING
public static final int RINGING
public static final int CALL_IS_BEING_FORWARDED
public static final int QUEUED
public static final int OK
public static final int MULTIPLE_CHOICES
public static final int MOVED_PERMANENTLY
public static final int MOVED_TEMPORARILY
public static final int SEE_OTHER
public static final int USE_PROXY
public static final int ALTERNATIVE_SERVICE
public static final int BAD_REQUEST
public static final int UNAUTHORIZED
public static final int PAYMENT_REQUIRED
public static final int FORBIDDEN
public static final int NOT_FOUND
public static final int METHOD_NOT_ALLOWED
public static final int NOT_ACCEPTABLE
public static final int PROXY_AUTHENTICATION_REQUIRED
public static final int REQUEST_TIMEOUT
public static final int CONFLICT
public static final int GONE
public static final int LENGTH_REQUIRED
public static final int ENTITY_TOO_LARGE
public static final int URI_TOO_LARGE
public static final int UNSUPPORTED_MEDIA_TYPE
public static final int BAD_EXTENSION
public static final int TEMPORARILY_NOT_AVAILABLE
public static final int CALL_LEG_OR_TRANSACTION_DOES_NOT_EXIST
public static final int LOOP_DETECTED
public static final int TOO_MANY_HOPS
public static final int ADDRESS_INCOMPLETE
public static final int AMBIGUOUS
public static final int BUSY_HERE
public static final int INTERNAL_SERVER_ERROR
public static final int NOT_IMPLEMENTED
public static final int BAD_GATEWAY
public static final int SERVICE_UNAVAILABLE
public static final int GATEWAY_TIME_OUT
public static final int SIP_VERSION_NOT_SUPPORTED
public static final int BUSY_EVERYWHERE
public static final int DECLINE
public static final int DOES_NOT_EXIST_ANYWHERE
public static final int SESSION_NOT_ACCEPTABLE
| Constructor Detail |
public ResponseMessage(java.lang.Object source,
int statusCode,
RequestMessage request)
throws java.lang.IllegalArgumentException,
HeaderNotSetException
source - source of the ResponseMessagestatusCode - status coderequest - received RequestMessage
public ResponseMessage(java.lang.Object source,
int statusCode,
RequestMessage request,
java.lang.Object body,
ContentTypeHeader contentTypeHeader)
throws java.lang.IllegalArgumentException,
HeaderNotSetException
source - source of the ResponseMessagestatusCode - status coderequest - received RequestMessagebody - rbodycontentTypeHeader - ContentTypeHeader
public ResponseMessage(java.lang.Object source,
int statusCode,
CallIdHeader callIdheader,
CSeqHeader cSeqHeader,
FromHeader fromHeader,
ToHeader toHeader,
ViaHeader[] viaHeaders)
throws java.lang.IllegalArgumentException
source - source of the RequestMessagestatusCode - status codecallIdHeader - CallIdHeadercSeqHeader - CSeqHeaderfromHeader - FromHeadertoHeader - ToHeaderviaHeaders - ViaHeaders
public ResponseMessage(java.lang.Object source,
int statusCode,
CallIdHeader callIdheader,
CSeqHeader cSeqHeader,
FromHeader fromHeader,
ToHeader toHeader,
ViaHeader[] viaHeaders,
java.lang.Object body,
ContentTypeHeader contentTypeHeader)
throws java.lang.IllegalArgumentException
source - source of the RequestMessagestatusCode - status codecallIdHeader - CallIdHeadercSeqHeader - CSeqHeaderfromHeader - FromHeadertoHeader - ToHeaderviaHeaders - ViaHeadersbody - bodycontentTypeHeader - ContentTypeHeader| Method Detail |
public void removeViaHeader()
public AllowHeader[] getAllowHeaders()
throws HeaderNotSetException
public void setAllowHeaders(AllowHeader[] allowHeaders)
throws java.lang.IllegalArgumentException
allowHeaders - AllowHeaders to setpublic boolean hasAllowHeaders()
public void removeAllowHeaders()
public ProxyAuthenticateHeader getProxyAuthenticateHeader()
throws HeaderNotSetException
public void setProxyAuthenticateHeader(ProxyAuthenticateHeader proxyAuthenticateHeader)
throws java.lang.IllegalArgumentException
proxyAuthenticateHeader - ProxyAuthenticateHeader to setpublic boolean hasProxyAuthenticateHeader()
public void removeProxyAuthenticateHeader()
public WWWAuthenticateHeader[] getWWWAuthenticateHeaders()
throws HeaderNotSetException
public void setWWWAuthenticateHeaders(WWWAuthenticateHeader[] wwwAuthenticateHeaders)
throws java.lang.IllegalArgumentException
wwwAuthenticateHeaders - WWWAuthenticateHeaders to setpublic boolean hasWWWAuthenticateHeaders()
public void removeWWWAuthenticateHeaders()
public ServerHeader[] getServerHeaders()
throws HeaderNotSetException
public void setServerHeaders(ServerHeader[] serverHeaders)
throws java.lang.IllegalArgumentException
serverHeaders - ServerHeaders to setpublic boolean hasServerHeaders()
public void removeServerHeaders()
public UnsupportedHeader[] getUnsupportedHeaders()
throws HeaderNotSetException
public void setUnsupportedHeaders(UnsupportedHeader[] unsupportedHeaders)
throws java.lang.IllegalArgumentException
unsupportedHeaders - UnsupportedHeaders to setpublic boolean hasUnsupportedHeaders()
public void removeUnsupportedHeaders()
public WarningHeader[] getWarningHeaders()
throws HeaderNotSetException
public void setWarningHeaders(WarningHeader[] warningHeaders)
throws java.lang.IllegalArgumentException
warningHeaders - WarningHeaders to setpublic boolean hasWarningHeaders()
public void removeWarningHeaders()
public int getStatusCode()
public void setStatusCode(int statusCode)
throws java.lang.IllegalArgumentException
statusCode - status code to setpublic java.lang.String getReasonPhrase()
public static java.lang.String getStandardReasonPhrase(int statusCode)
throws SipException
public void setReasonPhrase(java.lang.String reasonPhrase)
throws java.lang.IllegalArgumentException
reasonPhrase - reason phrase to setpublic java.lang.String getStartLine()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright - 2000 Sun Microsystems