public class Utils extends Object implements UtilsExt
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
String |
generateBranchId()
Generate a cryptographically random identifier that can be used to
generate a branch identifier.
|
String |
generateCallIdentifier(String address)
Generate a call identifier.
|
String |
generateTag()
Generate a tag for a FROM header or TO header.
|
static Utils |
getInstance() |
static String |
getQuotedString(String str)
Put quotes around a string and return it.
|
static String |
getSignature() |
static void |
main(String[] args) |
protected static String |
reduceString(String input)
Squeeze out all white space from a string and return the reduced string.
|
boolean |
responseBelongsToUs(SIPResponse response) |
static String |
toHexString(byte[] b)
convert an array of bytes to an hexadecimal string
|
static String |
toUpperCase(String str)
Converts the characters in this String to upper case.
|
public static Utils getInstance()
public static String toHexString(byte[] b)
b
- bytes array to convert to a hexadecimal stringpublic static String getQuotedString(String str)
str
- string to be quotedprotected static String reduceString(String input)
input
- input string to sqeeze.public static String toUpperCase(String str)
str
- the String to convert. Using english as default
as header strings are in English.
Resolves a bug in parsing and uppercase when default locale is set
to Turkish.public String generateCallIdentifier(String address)
generateCallIdentifier
in interface UtilsExt
public String generateTag()
generateTag
in interface UtilsExt
public String generateBranchId()
generateBranchId
in interface UtilsExt
public boolean responseBelongsToUs(SIPResponse response)
public static String getSignature()
public static void main(String[] args)
Copyright © 2016. All Rights Reserved.