Parse SIP message and parts of SIP messages such as URI's etc
from memory and return a structure.
Intended use: UDP message processing.
This class is used when you have an entire SIP message or Header
or SIP URL in memory and you want to generate a parsed structure from
it. For SIP messages, the payload can be binary or String.
If you have a binary payload,
use parseMessage(byte[]) else use parseSIPMessage(String)
The payload is accessible from the parsed message using the getContent and
getContentBytes methods provided by the Message class.
Currently only eager parsing of the message is supported (i.e. the
entire message is parsed in one feld swoop).
version: JAIN-SIP-1.1 version: This code is in the public domain.
parseAddress(String address) Parses an address (nameaddr or address spec) and return and address
structure.
Parameters: address - is a String containing the address to be parsed.
parseSIPStatusLine(String statusLine) Parses the SIP Response message status line
Parameters: statusLine - a String containing the Status line to be parsed.
parseSIPUrl(String url) Parses a SIP url from a string and return a URI structure for it.
Parameters: url - a String containing the URI structure to be parsed.
parseUrl(String url) Parses a uri from a string and return a URI structure for it.
Parameters: url - a String containing the URI structure to be parsed.
protected byte[]
readBytesToEnd() Returns the bytes to the end of the message.
Returns true if the body is encoded as a string.
If the parseMessage(String) method is invoked then the body
is assumed to be a string.
true if body is a string
Parses an address (nameaddr or address spec) and return and address
structure.
Parameters: address - is a String containing the address to be parsed. a parsed address structure. since: v1.0 exception: ParseException - when the address is badly formatted.
Parses an individual SIP message header from a string.
Parameters: header - String containing the SIP header. a Header structure. exception: ParseException - if there was an error parsing the message.
Parse a host name and return a parsed structure.
Parameters: host - is a String containing the host name to be parsed a parsed address structure. since: v1.0 exception: ParseException - when the hostname is badly formatted.
Parses a host:port and return a parsed structure.
Parameters: hostport - is a String containing the host:port to be parsed a parsed address structure. since: v1.0 exception: ParseException - when the address is badly formatted.
Parses the SIP Request Line
Parameters: requestLine - a String containing the request line to be parsed. a RequestLine structure that has the parsed RequestLine exception: ParseException - if there was an error parsing the requestLine.
Parses a buffer containing a single SIP Message where the body
is an array of un-interpreted bytes. This is intended for parsing
the message from a memory buffer when the buffer.
Incorporates a bug fix for a bug that was noted by Will Sullin of
Callcast
Parameters: msgBuffer - a byte buffer containing the messages to be parsed.This can consist of multiple SIP Messages concatenated together. a Message[] structure (request or response)containing the parsed SIP message. exception: ParseException - is thrown when anillegal message has been encountered (andthe rest of the buffer is discarded). See Also:ParseExceptionListener
Parses a buffer containing one or more SIP Messages and return
an array of
Message parsed structures. Note that the current limitation is that
this does not handle content encoding properly. The message content is
just assumed to be encoded using the same encoding as the sip message
itself (i.e. binary encodings such as gzip are not supported).
Parameters: sipMessages - a String containing the messages to be parsed.This can consist of multiple SIP Messages concatenated together. a Message structure (request or response)containing the parsed SIP message. exception: ParseException - is thrown when anillegal message has been encountered (andthe rest of the buffer is discarded). See Also:ParseExceptionListener
Parses the SIP Response message status line
Parameters: statusLine - a String containing the Status line to be parsed. StatusLine class corresponding to message exception: ParseException - if there was an error parsing See Also:StatusLine
Parses a SIP url from a string and return a URI structure for it.
Parameters: url - a String containing the URI structure to be parsed. A parsed URI structure exception: ParseException - if there was an error parsing the message.
Parses a telephone number return a parsed structure.
Parameters: telephone_number - is a String containing thetelephone # to be parsed a parsed address structure. since: v1.0 exception: ParseException - when the address is badly formatted.
Parses a uri from a string and return a URI structure for it.
Parameters: url - a String containing the URI structure to be parsed. A parsed URI structure exception: ParseException - if there was an error parsing the message.
Returns the bytes to the end of the message.
This is invoked when the parser is invoked with an array of bytes
rather than with a string.
the bytes to the end of message