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, unrecognizedHeadersAND, 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, stringRepresentationACCEPTED, 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, setViadbgPrint, dbgPrintdbgPrint, debugDump, encode, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprintfinalize, getClass, notify, notifyAll, wait, wait, waitgetApplicationData, getCallIdHeader, getContentLengthHeader, getContentTypeHeader, getCSeqHeader, getFromHeader, getMultipartMimeContent, getToHeader, getTopmostViaHeader, setApplicationDataaddFirst, addHeader, addLast, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getExpires, getHeader, getHeaderNames, getHeaders, getRawContent, getUnrecognizedHeaders, hashCode, removeContent, removeFirst, removeHeader, removeLast, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setExpires, setHeaderprotected StatusLine statusLine
public static String getReasonPhrase(int rc)
public void setStatusCode(int statusCode)
throws ParseException
setStatusCode in interface ResponsestatusCode - 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 Responsepublic void setReasonPhrase(String reasonPhrase)
setReasonPhrase in interface ResponsereasonPhrase - the reason phrase.IllegalArgumentException - if null stringpublic String getReasonPhrase()
getReasonPhrase in interface Responsepublic 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 SIPMessagepublic void checkHeaders()
throws ParseException
ParseExceptionpublic String encode()
encode in class SIPMessagepublic StringBuilder encodeMessage(StringBuilder retval)
encodeMessage in class SIPMessagepublic LinkedList getMessageAsEncodedStrings()
getMessageAsEncodedStrings in class SIPMessagepublic Object clone()
clone in interface Messageclone in class SIPMessagepublic boolean equals(Object other)
equals in interface Messageequals in class SIPMessageother - other object to compare with.public boolean match(Object matchObj)
match in class SIPMessagematchObj - template object to match ourselves with (null
in any position in the template object matches wildcard)public byte[] encodeAsBytes(String transport)
encodeAsBytes in class SIPMessagepublic String getFirstLine()
getFirstLine in interface MessageExtgetFirstLine in class SIPMessagepublic void setSIPVersion(String sipVersion)
MessagesetSIPVersion in interface MessagesetSIPVersion in class SIPMessagesipVersion - the new String object containing the version of the SIP
Protocol of this Message.public String getSIPVersion()
MessagegetSIPVersion in interface MessagegetSIPVersion in class SIPMessagepublic String toString()
MessagetoString in interface MessagetoString in class SIPMessagepublic void cleanUp()
cleanUp in class SIPMessagepublic void setRetransmission(boolean isRetransmission)
isRetransmission - the isRetransmission to setpublic boolean isRetransmission()
Copyright © 2018. All Rights Reserved.