org.cafesip.sipunit
Class SipResponse

java.lang.Object
  extended by org.cafesip.sipunit.SipMessage
      extended by org.cafesip.sipunit.SipResponse

public class SipResponse
extends SipMessage

The SipResponse class provides static response status code definitions and text, and it also provides high level getter methods for a response received from the network. With regard to the latter, this class is primarily used for SipTestCase assertions dealing with SIP message body and headers. The test program passes this object to these assert methods. The test program can obtain this object by calling the getLastReceivedResponse() on the MessageListener object (such as SipCall or Subscription) when using the high-level API or it can create this object using the Response contained within the ResponseEvent object returned by a waitXyz() method (such as SipSession.waitResponse()) when using the low-level SipUnit API. For further low level processing, a test program may call this object's getMessage() method to get the underlying javax.sip.message.Message object. Knowledge of JAIN SIP API is required at this level.


Field Summary
static int ACCEPTED
           
static int ADDRESS_INCOMPLETE
           
static int ALTERNATIVE_SERVICE
           
static int AMBIGUOUS
           
static int BAD_EVENT
           
static int BAD_EXTENSION
           
static int BAD_GATEWAY
           
static int BAD_REQUEST
           
static int BUSY_EVERYWHERE
           
static int BUSY_HERE
           
static int CALL_IS_BEING_FORWARDED
           
static int CALL_OR_TRANSACTION_DOES_NOT_EXIST
           
static int DECLINE
           
static int DOES_NOT_EXIST_ANYWHERE
           
static int EXTENSION_REQUIRED
           
static int FORBIDDEN
           
static int GONE
           
static int INTERVAL_TOO_BRIEF
           
static int LOOP_DETECTED
           
static int MESSAGE_TOO_LARGE
           
static int METHOD_NOT_ALLOWED
           
static int MOVED_PERMANENTLY
           
static int MOVED_TEMPORARILY
           
static int MULTIPLE_CHOICES
           
static int NOT_ACCEPTABLE
           
static int NOT_ACCEPTABLE_HERE
           
static int NOT_FOUND
           
static int NOT_IMPLEMENTED
           
static int OK
           
static int PAYMENT_REQUIRED
           
static int PROXY_AUTHENTICATION_REQUIRED
           
static int QUEUED
           
static int REQUEST_ENTITY_TOO_LARGE
           
static int REQUEST_PENDING
           
static int REQUEST_TERMINATED
           
static int REQUEST_TIMEOUT
           
static int REQUEST_URI_TOO_LONG
           
static int RINGING
           
static int SERVER_INTERNAL_ERROR
           
static int SERVER_TIMEOUT
           
static int SERVICE_UNAVAILABLE
           
static int SESSION_NOT_ACCEPTABLE
           
static int SESSION_PROGRESS
           
static java.util.HashMap<java.lang.Integer,java.lang.String> statusCodeDescription
          Comment for statusCodeDescription This map yields a reason phrase, given a SIP network response message status code.
static int TEMPORARILY_UNAVAILABLE
           
static int TOO_MANY_HOPS
           
static int TRYING
          Response status codes **********
static int UNAUTHORIZED
           
static int UNDECIPHERABLE
           
static int UNSUPPORTED_MEDIA_TYPE
           
static int UNSUPPORTED_URI_SCHEME
           
static int USE_PROXY
           
static int VERSION_NOT_SUPPORTED
           
 
Constructor Summary
SipResponse(javax.sip.message.Response response)
          A constructor for this class, applicable when using the low-level SipUnit API.
 
Method Summary
 java.lang.String getReasonPhrase()
          Obtains the reason phrase of this response message.
 int getStatusCode()
          Obtains the status code of this response message.
 
Methods inherited from class org.cafesip.sipunit.SipMessage
getContent, getContentLength, getExpiry, getMessage, getRawContent, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRYING

public static final int TRYING
Response status codes **********

See Also:
Constant Field Values

RINGING

public static final int RINGING
See Also:
Constant Field Values

CALL_IS_BEING_FORWARDED

public static final int CALL_IS_BEING_FORWARDED
See Also:
Constant Field Values

QUEUED

public static final int QUEUED
See Also:
Constant Field Values

SESSION_PROGRESS

public static final int SESSION_PROGRESS
See Also:
Constant Field Values

OK

public static final int OK
See Also:
Constant Field Values

ACCEPTED

public static final int ACCEPTED
See Also:
Constant Field Values

MULTIPLE_CHOICES

public static final int MULTIPLE_CHOICES
See Also:
Constant Field Values

MOVED_PERMANENTLY

public static final int MOVED_PERMANENTLY
See Also:
Constant Field Values

MOVED_TEMPORARILY

public static final int MOVED_TEMPORARILY
See Also:
Constant Field Values

USE_PROXY

public static final int USE_PROXY
See Also:
Constant Field Values

ALTERNATIVE_SERVICE

public static final int ALTERNATIVE_SERVICE
See Also:
Constant Field Values

BAD_REQUEST

public static final int BAD_REQUEST
See Also:
Constant Field Values

UNAUTHORIZED

public static final int UNAUTHORIZED
See Also:
Constant Field Values

PAYMENT_REQUIRED

public static final int PAYMENT_REQUIRED
See Also:
Constant Field Values

FORBIDDEN

public static final int FORBIDDEN
See Also:
Constant Field Values

NOT_FOUND

public static final int NOT_FOUND
See Also:
Constant Field Values

METHOD_NOT_ALLOWED

public static final int METHOD_NOT_ALLOWED
See Also:
Constant Field Values

NOT_ACCEPTABLE

public static final int NOT_ACCEPTABLE
See Also:
Constant Field Values

PROXY_AUTHENTICATION_REQUIRED

public static final int PROXY_AUTHENTICATION_REQUIRED
See Also:
Constant Field Values

REQUEST_TIMEOUT

public static final int REQUEST_TIMEOUT
See Also:
Constant Field Values

GONE

public static final int GONE
See Also:
Constant Field Values

REQUEST_ENTITY_TOO_LARGE

public static final int REQUEST_ENTITY_TOO_LARGE
See Also:
Constant Field Values

REQUEST_URI_TOO_LONG

public static final int REQUEST_URI_TOO_LONG
See Also:
Constant Field Values

UNSUPPORTED_MEDIA_TYPE

public static final int UNSUPPORTED_MEDIA_TYPE
See Also:
Constant Field Values

UNSUPPORTED_URI_SCHEME

public static final int UNSUPPORTED_URI_SCHEME
See Also:
Constant Field Values

BAD_EXTENSION

public static final int BAD_EXTENSION
See Also:
Constant Field Values

EXTENSION_REQUIRED

public static final int EXTENSION_REQUIRED
See Also:
Constant Field Values

INTERVAL_TOO_BRIEF

public static final int INTERVAL_TOO_BRIEF
See Also:
Constant Field Values

TEMPORARILY_UNAVAILABLE

public static final int TEMPORARILY_UNAVAILABLE
See Also:
Constant Field Values

CALL_OR_TRANSACTION_DOES_NOT_EXIST

public static final int CALL_OR_TRANSACTION_DOES_NOT_EXIST
See Also:
Constant Field Values

LOOP_DETECTED

public static final int LOOP_DETECTED
See Also:
Constant Field Values

TOO_MANY_HOPS

public static final int TOO_MANY_HOPS
See Also:
Constant Field Values

ADDRESS_INCOMPLETE

public static final int ADDRESS_INCOMPLETE
See Also:
Constant Field Values

AMBIGUOUS

public static final int AMBIGUOUS
See Also:
Constant Field Values

BUSY_HERE

public static final int BUSY_HERE
See Also:
Constant Field Values

REQUEST_TERMINATED

public static final int REQUEST_TERMINATED
See Also:
Constant Field Values

NOT_ACCEPTABLE_HERE

public static final int NOT_ACCEPTABLE_HERE
See Also:
Constant Field Values

BAD_EVENT

public static final int BAD_EVENT
See Also:
Constant Field Values

REQUEST_PENDING

public static final int REQUEST_PENDING
See Also:
Constant Field Values

UNDECIPHERABLE

public static final int UNDECIPHERABLE
See Also:
Constant Field Values

SERVER_INTERNAL_ERROR

public static final int SERVER_INTERNAL_ERROR
See Also:
Constant Field Values

NOT_IMPLEMENTED

public static final int NOT_IMPLEMENTED
See Also:
Constant Field Values

BAD_GATEWAY

public static final int BAD_GATEWAY
See Also:
Constant Field Values

SERVICE_UNAVAILABLE

public static final int SERVICE_UNAVAILABLE
See Also:
Constant Field Values

SERVER_TIMEOUT

public static final int SERVER_TIMEOUT
See Also:
Constant Field Values

VERSION_NOT_SUPPORTED

public static final int VERSION_NOT_SUPPORTED
See Also:
Constant Field Values

MESSAGE_TOO_LARGE

public static final int MESSAGE_TOO_LARGE
See Also:
Constant Field Values

BUSY_EVERYWHERE

public static final int BUSY_EVERYWHERE
See Also:
Constant Field Values

DECLINE

public static final int DECLINE
See Also:
Constant Field Values

DOES_NOT_EXIST_ANYWHERE

public static final int DOES_NOT_EXIST_ANYWHERE
See Also:
Constant Field Values

SESSION_NOT_ACCEPTABLE

public static final int SESSION_NOT_ACCEPTABLE
See Also:
Constant Field Values

statusCodeDescription

public static java.util.HashMap<java.lang.Integer,java.lang.String> statusCodeDescription
Comment for statusCodeDescription This map yields a reason phrase, given a SIP network response message status code.

Constructor Detail

SipResponse

public SipResponse(javax.sip.message.Response response)
A constructor for this class, applicable when using the low-level SipUnit API. Call this method to create a SipResponse object after calling SipSession.waitResponse(), so that you can use the SipTestCase assert methods pertaining to SIP message body and headers (by passing in this object).

Parameters:
response - the Response object contained within the ResponseEvent object returned by SipSession.waitResponse()
Method Detail

getReasonPhrase

public java.lang.String getReasonPhrase()
Obtains the reason phrase of this response message.

Returns:
the reason phrase associated with the status code of this response message

getStatusCode

public int getStatusCode()
Obtains the status code of this response message.

Returns:
the status code


http://www.cafesip.org