org.mitre.jsip
Clase SipMessage

public abstract class SipMessage
Detalle del método

createMessage

public static SipMessage createMessage(String inputMessage)
Create a SipMessage from a buffer

haveBody

public boolean haveBody()
Returns true if the message has a body.
Returns:
bool

setBody

public void setBody(String newbody)
Sets the body of the SIP message.
Parameters:
newbody -

getVersionString

protected String getVersionString()
Generates and returns the version string for this message.
Returns:
String

messageBody

public String messageBody()
Returns the message body.
Returns:
The body of the message

getType

public int getType()
Return the type of this message, either SipMessage.Request or SipMessage.Response

getContentLength

public int getContentLength()
Return the Content Length of the message body
Returns:
The size of the message body

getCSeqMethod

public static int getCSeqMethod(String s)
Gets the CSeq method type of the incoming message the CSeq header field has the CSeq and the Method of the current transaction
This method extracts the Method from the CSeq header.
NOTE: This should have been in org.mitre.jsip.SipMessage SRJ: does this need to be static??? are we referencing an instanciated message???

message

public String message()
Generate the full message
Returns:
The full message text

insertHeader

public void insertHeader(int id,
                         String data)
Inserts a new header into the message.
Parameters:
id -
data -

hasHeader

public boolean hasHeader(int id)
Returns true if the message contains the specified header.
Parameters:
id -
Returns:
bool

getHeaderData

public String getHeaderData(int id)
Returns the data contained in the specified header.
Parameters:
id -
Returns:
String

getViaList

public SipViaList getViaList()
Returns a reference to the via list for this message. Usually useful for getting and setting the topmost via entry.
Returns:
SipViaList

getRecordRoute

public SipUriList getRecordRoute()
Returns a reference to the Record-Route for this message.
Returns:
SipUriList &

getContactList

public SipUriList getContactList()
Returns a reference to the contact list for this message.
Returns:
SipUriList &

setViaList

public void setViaList(SipViaList copylist)
Sets the via list to be a copy of an existing via list. Useful for building responses.
Parameters:
copylist -

setContactList

public void setContactList(SipUriList newclist)
Sets the contact list for this message.
Parameters:
newclist -

setRecordRoute

public void setRecordRoute(SipUriList newrr)
Sets the record route for this message.
Parameters:
newrr -

addContact

public void addContact(SipUri contact)
Add a url to the contact list

setDefaultVars

private void setDefaultVars()
setDefaultVars

parseHeaders

protected void parseHeaders(String inbuf)
parseHeaders
Parameters:
inbuf -