public class SIPResponse extends SIPMessage implements Response, ResponseExt
Modifier and Type | Field and Description |
---|---|
protected StatusLine |
statusLine |
applicationData, callIdHeader, contentLengthHeader, cSeqHeader, forkId, fromHeader, headers, headerTable, maxForwardsHeader, messageContent, messageContentBytes, messageContentObject, nullRequest, size, toHeader, unrecognizedHeaders
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation
ACCEPTED, ADDRESS_INCOMPLETE, ALTERNATIVE_SERVICE, AMBIGUOUS, BAD_EVENT, BAD_EXTENSION, BAD_GATEWAY, BAD_REQUEST, BUSY_EVERYWHERE, BUSY_HERE, CALL_IS_BEING_FORWARDED, CALL_OR_TRANSACTION_DOES_NOT_EXIST, CONDITIONAL_REQUEST_FAILED, DECLINE, DOES_NOT_EXIST_ANYWHERE, EXTENSION_REQUIRED, FORBIDDEN, GONE, INTERVAL_TOO_BRIEF, LOOP_DETECTED, MESSAGE_TOO_LARGE, METHOD_NOT_ALLOWED, MOVED_PERMANENTLY, MOVED_TEMPORARILY, MULTIPLE_CHOICES, NOT_ACCEPTABLE, NOT_ACCEPTABLE_HERE, NOT_FOUND, NOT_IMPLEMENTED, OK, PAYMENT_REQUIRED, PROXY_AUTHENTICATION_REQUIRED, QUEUED, REQUEST_ENTITY_TOO_LARGE, REQUEST_PENDING, REQUEST_TERMINATED, REQUEST_TIMEOUT, REQUEST_URI_TOO_LONG, RINGING, SERVER_INTERNAL_ERROR, SERVER_TIMEOUT, SERVICE_UNAVAILABLE, SESSION_NOT_ACCEPTABLE, SESSION_PROGRESS, TEMPORARILY_UNAVAILABLE, TOO_MANY_HOPS, TRYING, UNAUTHORIZED, UNDECIPHERABLE, UNSUPPORTED_MEDIA_TYPE, UNSUPPORTED_URI_SCHEME, USE_PROXY, VERSION_NOT_SUPPORTED
Constructor and Description |
---|
SIPResponse()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkHeaders()
Check the response structure.
|
void |
cleanUp() |
Object |
clone()
Make a clone (deep copy) of this object.
|
String |
debugDump()
Print formatting function.
|
String |
encode()
Encode the SIP Request as a string.
|
byte[] |
encodeAsBytes(String transport)
Encode this into a byte array.
|
StringBuilder |
encodeMessage(StringBuilder retval)
Encode the message except for the body.
|
boolean |
equals(Object other)
Compare for equality.
|
String |
getFirstLine()
Get the encoded first line.
|
LinkedList |
getMessageAsEncodedStrings()
Get this message as a list of encoded strings.
|
String |
getReasonPhrase()
Get the reason phrase.
|
static String |
getReasonPhrase(int rc) |
String |
getSIPVersion()
Gets the protocol version of SIP being used by this Message.
|
int |
getStatusCode()
Get the staus code (conveniance function).
|
StatusLine |
getStatusLine()
Get the status line of the response.
|
boolean |
isFinalResponse()
Is this a final response?
|
static boolean |
isFinalResponse(int rc)
Return true if the response is a final response.
|
boolean |
isRetransmission() |
boolean |
match(Object matchObj)
Match with a template.
|
void |
setReasonPhrase(String reasonPhrase)
Set the reason phrase.
|
void |
setRetransmission(boolean isRetransmission) |
void |
setSIPVersion(String sipVersion)
Sets the protocol version of SIP being used by this Message.
|
void |
setStatusCode(int statusCode)
set the status code.
|
void |
setStatusLine(StatusLine sl)
Set the status line field.
|
String |
toString()
Gets string representation of Message
|
addFirst, addHeader, addHeader, addLast, addUnparsed, attachHeader, attachHeader, encodeSIPHeaders, getApplicationData, getAuthorization, getCallId, getCallIdHeader, getCharset, getContactHeader, getContactHeaders, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getContentLengthHeader, getContentTypeHeader, getCSeq, getCSeqHeader, getDialogId, getDialogId, getErrorInfoHeaders, getExpires, getForkId, getFrom, getFromHeader, getFromTag, getHeader, getHeaderAsFormattedString, getHeaderLowerCase, getHeaderNames, getHeaders, getHeaders, getLocalAddress, getLocalPort, getMaxForwards, getMessageContent, getMultipartMimeContent, getPeerPacketSourceAddress, getPeerPacketSourcePort, getRawContent, getRecordRouteHeaders, getRemoteAddress, getRemotePort, getRouteHeaders, getSIPHeaderListLowerCase, getSize, getTo, getToHeader, getTopmostVia, getTopmostViaHeader, getToTag, getTransactionId, getUnrecognizedHeaders, getUnrecognizedHeadersList, getViaHeaders, hasContent, hasFromTag, hashCode, hasHeader, hasToTag, isNullRequest, isRequestHeader, isResponseHeader, merge, removeContent, removeFirst, removeHeader, removeHeader, removeLast, setApplicationData, setCallId, setCallId, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setCSeq, setExpires, setFrom, setFromTag, setHeader, setHeader, setHeaders, setLocalAddress, setLocalPort, setMaxForwards, setMessageContent, setMessageContent, setMessageContent, setMessageContent, setMessageContent, setNullRequest, setPeerPacketSourceAddress, setPeerPacketSourcePort, setRemoteAddress, setRemotePort, setSize, setTo, setToTag, setUnrecognizedHeadersList, setVia
dbgPrint, dbgPrint
dbgPrint, debugDump, encode, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint
finalize, getClass, notify, notifyAll, wait, wait, wait
getApplicationData, getCallIdHeader, getContentLengthHeader, getContentTypeHeader, getCSeqHeader, getFromHeader, getMultipartMimeContent, getToHeader, getTopmostViaHeader, setApplicationData
addFirst, addHeader, addLast, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getExpires, getHeader, getHeaderNames, getHeaders, getRawContent, getUnrecognizedHeaders, hashCode, removeContent, removeFirst, removeHeader, removeLast, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setExpires, setHeader
protected StatusLine statusLine
public static String getReasonPhrase(int rc)
public void setStatusCode(int statusCode) throws ParseException
setStatusCode
in interface Response
statusCode
- is the status code to set.IlegalArgumentException
- if invalid status code.ParseException
- which signals that an error has been reached
unexpectedly while parsing the statusCode value.public StatusLine getStatusLine()
public int getStatusCode()
getStatusCode
in interface Response
public void setReasonPhrase(String reasonPhrase)
setReasonPhrase
in interface Response
reasonPhrase
- the reason phrase.IllegalArgumentException
- if null stringpublic String getReasonPhrase()
getReasonPhrase
in interface Response
public static boolean isFinalResponse(int rc)
rc
- is the return code.public boolean isFinalResponse()
public void setStatusLine(StatusLine sl)
sl
- Status line to set.public String debugDump()
debugDump
in class SIPMessage
public void checkHeaders() throws ParseException
ParseException
public String encode()
encode
in class SIPMessage
public StringBuilder encodeMessage(StringBuilder retval)
encodeMessage
in class SIPMessage
public LinkedList getMessageAsEncodedStrings()
getMessageAsEncodedStrings
in class SIPMessage
public Object clone()
clone
in interface Message
clone
in class SIPMessage
public boolean equals(Object other)
equals
in interface Message
equals
in class SIPMessage
other
- other object to compare with.public boolean match(Object matchObj)
match
in class SIPMessage
matchObj
- template object to match ourselves with (null
in any position in the template object matches wildcard)public byte[] encodeAsBytes(String transport)
encodeAsBytes
in class SIPMessage
public String getFirstLine()
getFirstLine
in interface MessageExt
getFirstLine
in class SIPMessage
public void setSIPVersion(String sipVersion)
Message
setSIPVersion
in interface Message
setSIPVersion
in class SIPMessage
sipVersion
- the new String object containing the version of the SIP
Protocol of this Message.public String getSIPVersion()
Message
getSIPVersion
in interface Message
getSIPVersion
in class SIPMessage
public String toString()
Message
toString
in interface Message
toString
in class SIPMessage
public void cleanUp()
cleanUp
in class SIPMessage
public void setRetransmission(boolean isRetransmission)
isRetransmission
- the isRetransmission to setpublic boolean isRetransmission()
Copyright © 2016. All Rights Reserved.