public class SIPRequest extends SIPMessage implements Request, RequestExt
| Modifier and Type | Field and Description |
|---|---|
protected static Set<String> |
headersToIncludeInResponse |
protected RequestLine |
requestLine |
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, stringRepresentation| Constructor and Description |
|---|
SIPRequest()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkHeaders()
Check header for constraints.
|
void |
cleanUp() |
Object |
clone()
Make a clone (deep copy) of this object.
|
SIPRequest |
createAckRequest(To responseToHeader)
Creates a default ACK SIPRequest message for this original request.
|
SIPRequest |
createCancelRequest()
Creates a default SIPResquest message that would cancel this request.
|
SIPRequest |
createErrorAck(To responseToHeader)
Creates an ACK for non-2xx responses according to RFC3261 17.1.1.3
|
SIPResponse |
createResponse(int statusCode)
Creates a default SIPResponse message for this request.
|
SIPResponse |
createResponse(int statusCode,
String reasonPhrase)
Creates a default SIPResponse message for this request.
|
String |
debugDump()
Convert to a formatted string for pretty printing.
|
String |
encode()
Encode the SIP Request as a string.
|
byte[] |
encodeAsBytes(String transport)
Encode this into a byte array.
|
StringBuilder |
encodeMessage(StringBuilder retval)
Encode only the headers and not the content.
|
boolean |
equals(Object other)
Compare for equality.
|
static String |
getCannonicalName(String method)
Set to standard constants to speed up processing.
|
String |
getFirstLine()
Get the first line encoded.
|
Object |
getInviteTransaction() |
String |
getMergeId()
Generates an Id for checking potentially merged requests.
|
LinkedList |
getMessageAsEncodedStrings()
Get the message as a linked list of strings.
|
Object |
getMessageChannel()
Book keeping method to get the messasge channel for the request.
|
String |
getMethod()
Get the method from the request line.
|
RequestLine |
getRequestLine()
Get the Request Line of the SIPRequest.
|
URI |
getRequestURI()
A conveniance function to access the Request URI.
|
String |
getSIPVersion()
Get the SIP version.
|
Object |
getTransaction()
Book keeping method to return the current tx for the request if one exists.
|
String |
getViaHost()
Get the host from the topmost via header.
|
int |
getViaPort()
Get the port from the topmost via header.
|
static boolean |
isDialogCreating(String ucaseMethod) |
static boolean |
isTargetRefresh(String ucaseMethod) |
boolean |
match(Object matchObj)
Match with a template.
|
protected boolean |
mustCopyRR(int code) |
protected void |
setDefaults()
Set the default values in the request URI if necessary.
|
void |
setInviteTransaction(Object inviteTransaction) |
void |
setMessageChannel(Object messageChannel)
Set the message channel for the request ( bookkeeping field ).
|
void |
setMethod(String method)
Set the method.
|
void |
setRequestLine(RequestLine requestLine)
Set the request line of the SIP Request.
|
protected void |
setRequestLineDefaults()
Patch up the request line as necessary.
|
void |
setRequestURI(URI uri)
Sets the RequestURI of Request.
|
void |
setSIPVersion(String sipVersion)
Set the sip version.
|
void |
setTransaction(Object transaction)
Book keeping field to set the current tx for the request.
|
String |
toString()
ALias for encode above.
|
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 RequestLine requestLine
public static boolean isTargetRefresh(String ucaseMethod)
public static boolean isDialogCreating(String ucaseMethod)
public static String getCannonicalName(String method)
public RequestLine getRequestLine()
public void setRequestLine(RequestLine requestLine)
requestLine - is the request line to set in the SIP Request.public String debugDump()
debugDump in class SIPMessagepublic void checkHeaders()
throws ParseException
ParseExceptionprotected void setDefaults()
protected void setRequestLineDefaults()
public URI getRequestURI()
getRequestURI in interface Requestpublic void setRequestURI(URI uri)
setRequestURI in interface Requesturi - the new Request URI of this request messagepublic void setMethod(String method)
setMethod in interface Requestmethod - is the method to set.IllegalArgumentException - if the method is nullpublic String getMethod()
public String encode()
encode in class SIPMessagepublic StringBuilder encodeMessage(StringBuilder retval)
encodeMessage in class SIPMessagepublic String toString()
toString in interface MessagetoString in class SIPMessagepublic Object clone()
clone in interface Messageclone in class SIPMessagepublic boolean equals(Object other)
equals in interface Messageequals in class SIPMessageother - object to compare ourselves with.public LinkedList getMessageAsEncodedStrings()
getMessageAsEncodedStrings in class SIPMessagepublic boolean match(Object matchObj)
match in class SIPMessagematchObj - object to match ourselves with (null matches wildcard)public byte[] encodeAsBytes(String transport)
encodeAsBytes in class SIPMessagepublic SIPResponse createResponse(int statusCode)
statusCode - Status code for the response. Reason phrase is generated.public SIPResponse createResponse(int statusCode, String reasonPhrase)
statusCode - Status code for the response.reasonPhrase - Reason phrase for this response.protected final boolean mustCopyRR(int code)
public SIPRequest createCancelRequest() throws SipException
SipExceptionParseExceptionpublic SIPRequest createAckRequest(To responseToHeader)
responseToHeader - To header to use for this request.public final SIPRequest createErrorAck(To responseToHeader) throws SipException, ParseException
SipExceptionNullPointerExceptionParseExceptionpublic String getViaHost()
public int getViaPort()
public String getFirstLine()
getFirstLine in interface MessageExtgetFirstLine in class SIPMessagepublic void setSIPVersion(String sipVersion) throws ParseException
setSIPVersion in interface MessagesetSIPVersion in class SIPMessagesipVersion - the sip version to set.ParseException - which signals that an error has been reached
unexpectedly while parsing the version argument.public String getSIPVersion()
getSIPVersion in interface MessagegetSIPVersion in class SIPMessagepublic Object getTransaction()
public void setTransaction(Object transaction)
transaction - public Object getMessageChannel()
public void setMessageChannel(Object messageChannel)
messageChannel - public String getMergeId()
public void setInviteTransaction(Object inviteTransaction)
inviteTransaction - the inviteTransaction to setpublic Object getInviteTransaction()
public void cleanUp()
cleanUp in class SIPMessageCopyright © 2018. All Rights Reserved.