jain.protocol.ip.sip.message
Class ResponseMessage

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--jain.protocol.ip.sip.message.Message
              |
              +--jain.protocol.ip.sip.message.ResponseMessage

public final class ResponseMessage
extends Message

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:

  • 1xx: Informational -- Indicates that the server or proxy contacted is performing some further action and does not yet have a definitive ResponseMessage. The client should wait for a further ResponseMessage from the server, and the server should send such a ResponseMessage without further prompting. A server should send an Informational ResponseMessage if it expects to take more than 200 ms to obtain a final ResponseMessage. A server may issue zero or more Informational ResponseMessages, with no restriction on their ordering or uniqueness. Note that Informational ResponseMessages are not transmitted reliably, that is, they do not cause the client to send an AckMessage. Servers are free to retransmit Informational ResponseMessages and clients can inquire about the current state of call processing by re-sending the RequestMessage.
  • 2xx: Success -- The RequestMessage was successful and must terminate a search.
  • 3xx: Redirection -- Gives information about the user's new location, or about alternative services that might be able to satisfy the call. They should terminate an existing search, and may cause the initiator to begin a new search if appropriate. Any Redirection ResponseMessage must not suggest any of the addresses in the ViaHeaders or the ContactHeader of the RequestMessage. (Addresses match if their host and port number match.) To avoid forwarding loops, a user agent client or proxy must check whether the address returned by a redirect server equals an address tried earlier.
  • 4xx: Client Error -- These are definite failure ResponseMessages from a particular server. The client should not retry the same RequestMessage without modification (e.g., adding appropriate authorization). However, the same RequestMessage to a different server might be successful.
  • 5xx: Server Error -- These are failure ResponseMessages given when a server itself has erred. They are not definitive failures, and must not terminate a search if other possible locations remain untried.
  • 6xx: Global Failure -- Indicates that a server has definitive information about a particular user, not just the particular instance indicated in the Request-URI. All further searches for this user are doomed to failure and pending searches should be terminated.
  • 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)
  • TRYING
  • RINGING
  • CALL_IS_BEING_FORWARDED
  • QUEUED
  • SUCCESS (2xx)
  • OK
  • REDIRECTION (3xx)
  • MULTIPLE_CHOICES
  • MOVED_PERMANENTLY
  • MOVED_TEMPORARILY
  • SEE_OTHER
  • USE_PROXY
  • ALTERNATIVE_SERVICE
  • CLIENT_ERROR (4xx)
  • BAD_REQUEST
  • UNAUTHORIZED
  • PAYMENT_REQUIRED
  • FORBIDDEN
  • NOT_FOUND
  • METHOD_NOT_ALLOWED
  • NOT_ACCEPTABLE
  • PROXY_AUTHENTICATION_REQUIRED
  • REQUEST_TIMEOUT
  • CONFLICT
  • GONE
  • LENGTH_REQUIRED
  • ENTITY_TOO_LARGE
  • URI_TOO_LARGE
  • UNSUPPORTED_MEDIA_TYPE
  • BAD_EXTENSION
  • TEMPORARILY_NOT_AVAILABLE
  • CALL_LEG_OR_TRANSACTION_DOES_NOT_EXIST
  • LOOP_DETECTED
  • TOO_MANY_HOPS
  • ADDRESS_INCOMPLETE
  • AMBIGUOUS
  • BUSY_HERE
  • SERVER_ERROR (5xx)
  • INTERNAL_SERVER_ERROR
  • NOT_IMPLEMENTED
  • BAD_GATEWAY
  • SERVICE_UNAVAILABLE
  • GATEWAY_TIME_OUT
  • SIP_VERSION_NOT_SUPPORTED
  • GLOBAL_ERROR (6xx)
  • BUSY_EVERYWHERE
  • DECLINE
  • DOES_NOT_EXIST_ANYWHERE
  • NOT_ACCEPTABLE_ANYWHERE
  • Version:
    0.6
    See Also:
    Serialized Form

    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 jain.protocol.ip.sip.message.Message
    addHeader, addHeaders, clone, equals, getAcceptEncodingHeaders, getAcceptHeaders, getAcceptLanguageHeaders, getAllHeaders, getBody, getCallIdHeader, getContactHeaders, getContentEncodingHeaders, getContentLengthHeader, getContentTypeHeader, getCSeqHeader, getDateHeader, getEncryptionHeader, getExpiresHeader, getFromHeader, getHeader, getHeaders, getOrganizationHeader, getRecordRouteHeaders, getRetryAfterHeader, getTimestampHeader, getToHeader, getUserAgentHeaders, getVersionMajor, getVersionMinor, getViaHeaders, hasAcceptEncodingHeaders, hasAcceptHeaders, hasAcceptLanguageHeaders, hasBody, hasContactHeaders, hasContentEncodingHeaders, hasContentLengthHeader, hasContentTypeHeader, hasDateHeader, hasEncryptionHeader, hasExpiresHeader, hasHeaders, hasOrganizationHeader, hasRecordRouteHeaders, hasRetryAfterHeader, hasTimestampHeader, hasUserAgentHeaders, isRequest, removeAcceptEncodingHeaders, removeAcceptHeaders, removeAcceptLanguageHeaders, removeBody, removeContactHeaders, removeContentEncodingHeaders, removeContentLengthHeader, removeDateHeader, removeEncryptionHeader, removeExpiresHeader, removeHeader, removeHeaders, removeOrganizationHeader, removeRecordRouteHeaders, removeRetryAfterHeader, removeTimestampHeader, removeUserAgentHeaders, setAcceptEncodingHeaders, setAcceptHeaders, setAcceptLanguageHeaders, setBody, setCallIdHeader, setContactHeaders, setContentEncodingHeaders, setContentLengthHeader, setContentTypeHeader, setCSeqHeader, setDateHeader, setEncryptionHeader, setExpiresHeader, setFromHeader, setHeader, setHeaders, setOrganizationHeader, setRecordRouteHeaders, setRetryAfterHeader, setTimestampHeader, setToHeader, setUserAgentHeaders, setVersion, setViaHeaders, toString
     
    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

    TRYING

    public static final 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.

    RINGING

    public static final int RINGING
    The called user agent has located a possible location where the user has registered recently and is trying to alert the user.

    CALL_IS_BEING_FORWARDED

    public static final 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.

    QUEUED

    public static final int QUEUED
    The called party is temporarily unavailable, but the callee has decided to queue the call rather than reject it. When the callee becomes available, it will return the appropriate final status ResponseMessage. The reason phrase may give further details about the status of the call, e.g., "5 calls queued; expected waiting time is 15 minutes". The server may issue several QUEUED ResponseMessages to update the caller about the status of the queued call.

    OK

    public static final int OK
    The RequestMessage has succeeded. The information returned with the ResponseMessage depends on the method used in the RequestMessage, for example:
  • BYE: The call has been terminated. The message body is empty.
  • CANCEL: The search has been cancelled. The message body is empty.
  • INVITE: The callee has agreed to participate; the message body indicates the callee's capabilities.
  • OPTIONS: The callee has agreed to share its capabilities, included in the message body.
  • REGISTER: The registration has succeeded. The client treats the message body according to the ContentTypeHeader.

  • MULTIPLE_CHOICES

    public static final 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. The ResponseMessage should include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate, if allowed by the AcceptHeader. The entity format is specified by the media type given in the ContentTypeHeader. The choices should also be listed as ContactHeaders. Unlike HTTP, the SIP ResponseMessage may contain several ContactHeaders. User agents may use the ContactHeader values for automatic redirection or may ask the user to confirm a choice. However, the SIP specification does not define any standard for such automatic selection. This status code is appropriate if the callee can be reached at several different locations and the server cannot or prefers not to proxy the RequestMessage.

    MOVED_PERMANENTLY

    public static final 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). The caller should update any local directories, address books and user location caches with this new value and redirect future RequestMessages to the address(es) listed.

    MOVED_TEMPORARILY

    public static final int MOVED_TEMPORARILY
    The requesting client should retry the RequestMessage at the new address(es) given by the ContactHeader(s). The duration of the redirection can be indicated through an ExpiresHeader. If there is no explicit expiration time, the address is only valid for this call and must not be cached for future calls.

    SEE_OTHER

    public static final int SEE_OTHER
    See other.

    USE_PROXY

    public static final int USE_PROXY
    The requested resource must be accessed through the proxy given by the ContactHeader. The ContactHeader gives the URI of the proxy. The recipient is expected to repeat this single RequestMessage via the proxy. USE_PROXY ResponseMessages must only be generated by user agent servers.

    ALTERNATIVE_SERVICE

    public static final int ALTERNATIVE_SERVICE
    The call was not successful, but alternative services are possible. The alternative services are described in the message body of the ResponseMessage. Formats for such bodies are not defined in RFC 2543, and may be he subject of future standardization.

    BAD_REQUEST

    public static final int BAD_REQUEST
    The RequestMessage could not be understood due to malformed syntax.

    UNAUTHORIZED

    public static final int UNAUTHORIZED
    The RequestMessage requires user authentication.

    PAYMENT_REQUIRED

    public static final int PAYMENT_REQUIRED
    Reserved for future use.

    FORBIDDEN

    public static final int FORBIDDEN
    The server understood the RequestMessage, but is refusing to fulfill it. Authorization will not help, and the RequestMessage should not be repeated.

    NOT_FOUND

    public static final int NOT_FOUND
    The server has definitive information that the user does not exist at the domain specified in the Request-URI. This status is also returned if the domain in the Request-URI does not match any of the domains handled by the recipient of the RequestMessage.

    METHOD_NOT_ALLOWED

    public static final int METHOD_NOT_ALLOWED
    The method specified in the RequestMessage is not allowed for the address identified by the Request-URI. The ResponseMessage must include AllowHeaders containing a valid methods for the indicated address.

    NOT_ACCEPTABLE

    public static final 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.

    PROXY_AUTHENTICATION_REQUIRED

    public static final int PROXY_AUTHENTICATION_REQUIRED
    This code is similar to UNAUTHORIZED, but indicates that the client must first authenticate itself with the proxy. The proxy must return a ProxyAuthenticateHeader containing a challenge applicable to the proxy for the requested resource. The client may repeat the RequestMessage with a suitable ProxyAuthorizationHeader. This status code is used for applications where access to the communication channel (e.g., a telephony gateway) rather than the callee requires authentication.

    REQUEST_TIMEOUT

    public static final 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. The client may repeat the RequestMessage without modifications at any later time.

    CONFLICT

    public static final int CONFLICT
    The RequestMessage could not be completed due to a conflict with the current state of the resource. This status code is returned if the action parameter in a RegisterMessage conflicts with existing registrations.

    GONE

    public static final int GONE
    The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code NOT_FOUND should be used instead.

    LENGTH_REQUIRED

    public static final int LENGTH_REQUIRED
    The server refuses to accept the RequestMessage without a defined Content- Length. The client may repeat the RequestMessage if it adds a valid ContentLengthHeader containing the length of the message-body in the RequestMessage.

    ENTITY_TOO_LARGE

    public static final 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. The server may close the connection to prevent the client from continuing the RequestMessage. If the condition is temporary, the server should include a RetryAfterHeader to indicate that it is temporary and after what time the client may try again.

    URI_TOO_LARGE

    public static final 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.

    UNSUPPORTED_MEDIA_TYPE

    public static final 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. The server should return a list of acceptable formats using AcceptHeaders, AcceptEncodingHeaders and AcceptLanguageHeaders.

    BAD_EXTENSION

    public static final int BAD_EXTENSION
    The server did not understand the protocol extension specified in a RequireHeader.

    TEMPORARILY_NOT_AVAILABLE

    public static final 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). The ResponseMessage may indicate a better time to call in the RetryAfterHeader. The user could also be available elsewhere (unbeknownst to this host), thus, this ResponseMessage does not terminate any searches. The reason phrase should indicate a more precise cause as to why the callee is unavailable. This value should be setable by the user agent. Status BUSY_HERE may be used to more precisely indicate a particular reason for the call failure. This status is also returned by a redirect server that recognizes the user identified by the Request-URI, but does not currently have a valid forwarding location for that user.

    CALL_LEG_OR_TRANSACTION_DOES_NOT_EXIST

    public static final 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. (A server simply discards an AckMessage referring to an unknown transaction.)

    LOOP_DETECTED

    public static final int LOOP_DETECTED
    The server received a RequestMessage with a ViaHeader containing itself.

    TOO_MANY_HOPS

    public static final int TOO_MANY_HOPS
    The server received a RequestMessage that contains more ViaHeaders than allowed by the MaxForwardsHeader.

    ADDRESS_INCOMPLETE

    public static final int ADDRESS_INCOMPLETE
    The server received a RequestMessage with a ToHeader address or Request-URI that was incomplete. Additional information should be provided. This status code allows overlapped dialing. With overlapped dialing, the client does not know the length of the dialing string. It sends strings of increasing lengths, prompting the user for more input, until it no longer receives an ADDRESS_INCOMPLETE status response.

    AMBIGUOUS

    public static final int AMBIGUOUS
    The callee address provided in the RequestMessage was ambiguous. The ResponseMessage may contain a listing of possible unambiguous addresses in ContactHeaders. Revealing alternatives can infringe on privacy concerns of the user or the organization. It must be possible to configure a server to respond with status NOT_FOUND or to suppress the listing of possible choices if the RequestMessage address was ambiguous. Some email and voice mail systems provide this functionality. A status code separate from Redirect status codes is used since the semantics are different: for MULTIPLE_CHOICES, it is assumed that the same person or service will be reached by the choices provided. While an automated choice or sequential search makes sense for a Redirect ResponseMessage, user intervention is required for an AMBIGUOUS response.

    BUSY_HERE

    public static final int BUSY_HERE
    The callee's end system was contacted successfully but the callee is currently not willing or able to take additional calls. The ResponseMessage may indicate a better time to call in the RetryAfterHeader. The user could also be available elsewhere, such as through a voice mail service, thus, this ResponseMessage does not terminate any searches. Status BUSY_EVERYWHERE should be used if the server knows that no other end system will be able to accept this call.

    INTERNAL_SERVER_ERROR

    public static final int INTERNAL_SERVER_ERROR
    The server encountered an unexpected condition that prevented it from fulfilling the RequestMessage. The client may display the specific error condition, and may retry the RequestMessage after several seconds.

    NOT_IMPLEMENTED

    public static final int NOT_IMPLEMENTED
    The server does not support the functionality required to fulfill the RequestMessage. This is the appropriate ResponseMessage when the server does not recognize the RequestMessage method and is not capable of supporting it for any user.

    BAD_GATEWAY

    public static final 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.

    SERVICE_UNAVAILABLE

    public static final int SERVICE_UNAVAILABLE
    The server is currently unable to handle the RequestMessage due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay may be indicated in a RetryAfterHeader. If no RetryAfterHeader is given, the client must handle the response as it would for an INTERNAL_SERVER_ERROR ResponseMessage. Note: The existence of the SERVICE_UNAVAILABLE status code does not imply that a server has to use it when becoming overloaded. Some servers may wish to simply refuse the connection.

    GATEWAY_TIME_OUT

    public static final 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.

    SIP_VERSION_NOT_SUPPORTED

    public static final int SIP_VERSION_NOT_SUPPORTED
    The server does not support, or refuses to support, the SIP protocol version that was used in the RequestMessage. The server is indicating that it is unable or unwilling to complete the RequestMessage using the same major version as the client, other than with this error message. The ResponseMessage may contain an entity describing why that version is not supported and what other protocols are supported by that server. The format for such an entity is not defined in RFC 2543 and may be the subject of future standardization.

    BUSY_EVERYWHERE

    public static final 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. The ResponseMessage may indicate a better time to call in the RetryAfterHeader. If the callee does not wish to reveal the reason for declining the call, the callee uses status code DECLINE instead. This status code is returned only if the client knows that no other end point (such as a voice mail system) will answer the RequestMessage. Otherwise, BUSY_HERE should be returned.

    DECLINE

    public static final int DECLINE
    The callee's machine was successfully contacted but the user explicitly does not wish to or cannot participate. The ResponseMessage may indicate a better time to call in the RetryAfterHeader.

    DOES_NOT_EXIST_ANYWHERE

    public static final int DOES_NOT_EXIST_ANYWHERE
    The server has authoritative information that the user indicated in the ToHeader of the RequestMessage does not exist anywhere. Searching for the user elsewhere will not yield any results.

    SESSION_NOT_ACCEPTABLE

    public static final 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. A SESSION_NOT_ACCEPTABLE response means that the user wishes to communicate, but cannot adequately support the session described. The SESSION_NOT_ACCEPTABLE ResponseMessage may contain a list of reasons in a WarningHeader describing why the session described cannot be supported. It is hoped that negotiation will not frequently be needed, and when a new user is being invited to join an already existing conference, negotiation may not be possible. It is up to the invitation initiator to decide whether or not to act on a SESSION_NOT_ACCEPTABLE ResponseMessage.
    Constructor Detail

    ResponseMessage

    public ResponseMessage(java.lang.Object source,
                           int statusCode,
                           RequestMessage request)
                    throws java.lang.IllegalArgumentException,
                           HeaderNotSetException
    Constructor of ResponseMessage without body based on received RequestMessage
    Parameters:
    source - source of the ResponseMessage
    statusCode - status code
    request - received RequestMessage
    Throws:
    java.lang.IllegalArgumentException - if any arguments are invalid
    HeaderNotSetException - if specified RequestMessage is missing any mandatory Header

    ResponseMessage

    public ResponseMessage(java.lang.Object source,
                           int statusCode,
                           RequestMessage request,
                           java.lang.Object body,
                           ContentTypeHeader contentTypeHeader)
                    throws java.lang.IllegalArgumentException,
                           HeaderNotSetException
    Constructor of ResponseMessage with body based on received RequestMessage
    Parameters:
    source - source of the ResponseMessage
    statusCode - status code
    request - received RequestMessage
    body - rbody
    contentTypeHeader - ContentTypeHeader
    Throws:
    java.lang.IllegalArgumentException - if any arguments are invalid
    HeaderNotSetException - if specified RequestMessage is missing any mandatory Header

    ResponseMessage

    public ResponseMessage(java.lang.Object source,
                           int statusCode,
                           CallIdHeader callIdheader,
                           CSeqHeader cSeqHeader,
                           FromHeader fromHeader,
                           ToHeader toHeader,
                           ViaHeader[] viaHeaders)
                    throws java.lang.IllegalArgumentException
    Constructor of ResponseMessage without body
    Parameters:
    source - source of the RequestMessage
    statusCode - status code
    callIdHeader - CallIdHeader
    cSeqHeader - CSeqHeader
    fromHeader - FromHeader
    toHeader - ToHeader
    viaHeaders - ViaHeaders
    Throws:
    java.lang.IllegalArgumentException - if any arguments are invalid

    ResponseMessage

    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
    Constructor of ResponseMessage with body
    Parameters:
    source - source of the RequestMessage
    statusCode - status code
    callIdHeader - CallIdHeader
    cSeqHeader - CSeqHeader
    fromHeader - FromHeader
    toHeader - ToHeader
    viaHeaders - ViaHeaders
    body - body
    contentTypeHeader - ContentTypeHeader
    Throws:
    java.lang.IllegalArgumentException - if any arguments are invalid
    Method Detail

    removeViaHeader

    public void removeViaHeader()
    Removes first ViaHeader from ResponseMessage's Header list.

    getAllowHeaders

    public AllowHeader[] getAllowHeaders()
                                  throws HeaderNotSetException
    Gets AllowHeaders of ResponseMessage.
    Returns:
    AllowHeaders of ResponseMessage
    Throws:
    HeaderNotSetException - if no AllowHeaders exist

    setAllowHeaders

    public void setAllowHeaders(AllowHeader[] allowHeaders)
                         throws java.lang.IllegalArgumentException
    Sets AllowHeaders of ResponseMessage.
    Parameters:
    allowHeaders - AllowHeaders to set
    Throws:
    java.lang.IllegalArgumentException - if allowHeaders is null or empty, or if any AllowHeader in allowHeaders is null

    hasAllowHeaders

    public boolean hasAllowHeaders()
    Returns boolean value to indicate if ResponseMessage has any AllowHeaders.
    Returns:
    boolean value to indicate if ResponseMessage has any AllowHeaders

    removeAllowHeaders

    public void removeAllowHeaders()
    Removes all AllowHeaders from ResponseMessage's Header list. Note that if no AllowHeaders exist the method has no effect

    getProxyAuthenticateHeader

    public ProxyAuthenticateHeader getProxyAuthenticateHeader()
                                                       throws HeaderNotSetException
    Gets ProxyAuthenticateHeader of ResponseMessage.
    Returns:
    ProxyAuthenticateHeader of ResponseMessage
    Throws:
    HeaderNotSetException - if no ProxyAuthenticateHeader exists

    setProxyAuthenticateHeader

    public void setProxyAuthenticateHeader(ProxyAuthenticateHeader proxyAuthenticateHeader)
                                    throws java.lang.IllegalArgumentException
    Sets ProxyAuthenticateHeader of ResponseMessage.
    Parameters:
    proxyAuthenticateHeader - ProxyAuthenticateHeader to set
    Throws:
    java.lang.IllegalArgumentException - if proxyAuthenticateHeader is null

    hasProxyAuthenticateHeader

    public boolean hasProxyAuthenticateHeader()
    Returns boolean value to indicate if ResponseMessage has ProxyAuthenticateHeader.
    Returns:
    boolean value to indicate if ResponseMessage has ProxyAuthenticateHeader

    removeProxyAuthenticateHeader

    public void removeProxyAuthenticateHeader()
    Removes ProxyAuthenticateHeader from ResponseMessage's Header list. Note that if no ProxyAuthenticateHeader exists the method has no effect, and if multiple ProxyAuthenticateHeaders exist they are all removed

    getWWWAuthenticateHeaders

    public WWWAuthenticateHeader[] getWWWAuthenticateHeaders()
                                                      throws HeaderNotSetException
    Gets WWWAuthenticateHeaders of ResponseMessage.
    Returns:
    WWWAuthenticateHeaders of ResponseMessage
    Throws:
    HeaderNotSetException - if no WWWAuthenticateHeaders exist

    setWWWAuthenticateHeaders

    public void setWWWAuthenticateHeaders(WWWAuthenticateHeader[] wwwAuthenticateHeaders)
                                   throws java.lang.IllegalArgumentException
    Sets WWWAuthenticateHeaders of ResponseMessage.
    Parameters:
    wwwAuthenticateHeaders - WWWAuthenticateHeaders to set
    Throws:
    java.lang.IllegalArgumentException - if wwwAuthenticateHeaders is null or empty, or if any WWWAuthenticateHeader in wwwAuthenticateHeaders is null

    hasWWWAuthenticateHeaders

    public boolean hasWWWAuthenticateHeaders()
    Returns boolean value to indicate if ResponseMessage has any WWWAuthenticateHeaders.
    Returns:
    boolean value to indicate if ResponseMessage has any WWWAuthenticateHeaders

    removeWWWAuthenticateHeaders

    public void removeWWWAuthenticateHeaders()
    Removes WWWAuthenticateHeaders from ResponseMessage's Header list. Note that if no WWWAuthenticateHeaders exist the method has no effect,

    getServerHeaders

    public ServerHeader[] getServerHeaders()
                                    throws HeaderNotSetException
    Gets ServerHeaders of ResponseMessage.
    Returns:
    ServerHeaders of ResponseMessage
    Throws:
    HeaderNotSetException - if no ServerHeaders exist

    setServerHeaders

    public void setServerHeaders(ServerHeader[] serverHeaders)
                          throws java.lang.IllegalArgumentException
    Sets ServerHeaders of ResponseMessage.
    Parameters:
    serverHeaders - ServerHeaders to set
    Throws:
    java.lang.IllegalArgumentException - if serverHeaders is null or empty, or if any ServerHeader in serverHeaders is null

    hasServerHeaders

    public boolean hasServerHeaders()
    Returns boolean value to indicate if ResponseMessage has any ServerHeaders.
    Returns:
    boolean value to indicate if ResponseMessage has any ServerHeaders

    removeServerHeaders

    public void removeServerHeaders()
    Removes all ServerHeaders from ResponseMessage's Header list. Note that if no ServerHeaders exist the method has no effect

    getUnsupportedHeaders

    public UnsupportedHeader[] getUnsupportedHeaders()
                                              throws HeaderNotSetException
    Gets UnsupportedHeaders of ResponseMessage.
    Returns:
    UnsupportedHeaders of ResponseMessage
    Throws:
    HeaderNotSetException - if no UnsupportedHeaders exist

    setUnsupportedHeaders

    public void setUnsupportedHeaders(UnsupportedHeader[] unsupportedHeaders)
                               throws java.lang.IllegalArgumentException
    Sets UnsupportedHeaders of ResponseMessage.
    Parameters:
    unsupportedHeaders - UnsupportedHeaders to set
    Throws:
    java.lang.IllegalArgumentException - if unsupportedHeaders is null or empty, or if any UnsupportedHeader in unsupportedHeaders is null

    hasUnsupportedHeaders

    public boolean hasUnsupportedHeaders()
    Returns boolean value to indicate if ResponseMessage has any UnsupportedHeaders.
    Returns:
    boolean value to indicate if ResponseMessage has any UnsupportedHeaders

    removeUnsupportedHeaders

    public void removeUnsupportedHeaders()
    Removes all UnsupportedHeaders from ResponseMessage's Header list. Note that if no UnsupportedHeaders exist the method has no effect

    getWarningHeaders

    public WarningHeader[] getWarningHeaders()
                                      throws HeaderNotSetException
    Gets WarningHeaders of ResponseMessage.
    Returns:
    WarningHeaders of ResponseMessage
    Throws:
    HeaderNotSetException - if no WarningHeaders exist

    setWarningHeaders

    public void setWarningHeaders(WarningHeader[] warningHeaders)
                           throws java.lang.IllegalArgumentException
    Sets WarningHeaders of ResponseMessage.
    Parameters:
    warningHeaders - WarningHeaders to set
    Throws:
    java.lang.IllegalArgumentException - if warningHeaders is null or empty, or if any WarningHeader in warningHeaders is null

    hasWarningHeaders

    public boolean hasWarningHeaders()
    Returns boolean value to indicate if ResponseMessage has any WarningHeaders.
    Returns:
    boolean value to indicate if ResponseMessage has any WarningHeaders

    removeWarningHeaders

    public void removeWarningHeaders()
    Removes all WarningHeaders from ResponseMessage's Header list. Note that if no WarningHeaders exist the method has no effect

    getStatusCode

    public int getStatusCode()
    Gets status code of ResponseMessage.
    Returns:
    status code of ResponseMessage

    setStatusCode

    public void setStatusCode(int statusCode)
                       throws java.lang.IllegalArgumentException
    Sets status code of ResponseMessage.
    Parameters:
    statusCode - status code to set
    Throws:
    java.lang.IllegalArgumentException - if statusCode is not a 3-digit number

    getReasonPhrase

    public java.lang.String getReasonPhrase()
    Gets reason phrase of ResponseMessage.
    Returns:
    reason phrase of ResponseMessage

    getStandardReasonPhrase

    public static java.lang.String getStandardReasonPhrase(int statusCode)
                                                    throws SipException
    Gets standard reason phrase for status code.
    Returns:
    standard reason phrase for status codee
    Throws:
    SipException - if no standard reason phrase exists for status code

    setReasonPhrase

    public void setReasonPhrase(java.lang.String reasonPhrase)
                         throws java.lang.IllegalArgumentException
    Sets reason phrase of ResponseMessage.
    Parameters:
    reasonPhrase - reason phrase to set
    Throws:
    java.lang.IllegalArgumentException - if reasonPhrase is null or zero-length

    getStartLine

    public java.lang.String getStartLine()
    Overrides:
    getStartLine in class Message


    If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


    Copyright - 2000 Sun Microsystems