|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lastbamboo.common.sip.stack.message.SipMessageUtils
public class SipMessageUtils
Collection of utility methods for handling SIP messages.
| Method Summary | |
|---|---|
static Map<String,SipHeader> |
convertHeaders(Map<String,List<String>> headers)
|
static int |
extractContentLength(Map<String,SipHeader> headers)
|
static String |
extractCSeqMethod(SipHeader cseq)
|
static int |
extractCSeqNumber(SipMessage message)
|
static Map<String,String> |
extractHeaderParams(String headerValue)
|
static String |
extractName(String nameValue)
|
static InetSocketAddress |
extractNextHopFromVia(SipMessage message)
Utility method for extracting the host and port information from the topmost Via header in a SIP message. |
static InetAddress |
extractSentByFromVia(SipHeaderValue via)
Extracts the sent-by host from a Via header. |
static URI |
extractUri(SipHeader header)
Extracts the URI from a header value. |
static URI |
extractUriFromRequestLine(SipMessage request)
Extracts the URI from the request line of a SIP message. |
static String |
extractValue(String nameValue)
|
static String |
toParamString(Map paramsMap)
Creates a paramater string from the specified map of parameter names and values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String toParamString(Map paramsMap)
paramsMap - A map of parameter names to values.
public static String extractName(String nameValue)
throws IOException
IOException
public static String extractValue(String nameValue)
throws IOException
IOExceptionpublic static Map<String,SipHeader> convertHeaders(Map<String,List<String>> headers)
public static Map<String,String> extractHeaderParams(String headerValue)
throws IOException
IOExceptionpublic static String extractCSeqMethod(SipHeader cseq)
public static URI extractUri(SipHeader header)
URI from a header value. This method assumes the
URI is within an opening "<" and a closing ">".
header - The header.
URI from the header.public static int extractCSeqNumber(SipMessage message)
public static URI extractUriFromRequestLine(SipMessage request)
throws IOException
Request-Line = Method SP Request-URI SP SIP-Version CRLF
request - The SIP request.
IOException - If the request line does not match the expected
syntax.
public static InetAddress extractSentByFromVia(SipHeaderValue via)
throws UnknownHostException
via - The Via header to extract the sent-by host from.
UnknownHostException - If there's an error readin the host in
the expected format.
public static InetSocketAddress extractNextHopFromVia(SipMessage message)
throws IOException
message - The SIP message to extract the host and port from.
IOException - If there's an unexpected error reading the data.public static int extractContentLength(Map<String,SipHeader> headers)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||