public final class SipAddressUtil
extends java.lang.Object
Constructor and Description |
---|
SipAddressUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
extractImeiFromAddress(Address address,
javax.slee.facilities.Tracer tracer)
Extract the IMEI from a SIP address if present
|
static SipAddressString |
getAddressString(Address address)
Extract an address string from an address header in a SIP message (such as From or To), or return null if this address is not a phone number
|
static SipAddressString |
getAddressString(Address address,
boolean forceSipUserEqualsPhone)
Extract an address string from an address header in a SIP message (such as From or To), or return null if this address is not a phone number
|
static SipAddressString |
getAddressString(URI uri)
Extract an address string from a SIP URI, or return null if this URI is not a phone number
|
static SipAddressString |
getAddressString(URI uri,
boolean forceSipUserEqualsPhone)
Extract an address string from a SIP URI, or return null if this URI is not a phone number
|
static SipAddressString |
getDigits(URI uri)
Extract an address string from a SIP or Tel URI, or return null if this URI is not a phone number.
|
static java.lang.String |
getUserPartParameters(SipURI uri,
boolean removePhoneContext)
Gets any parameters with a SIP URI's user part optionally removing a phone-context parameter.
|
static boolean |
isEquivalent(URI left,
URI right)
Compare user part if both are tel URI or tel URI and SIP URI with user=phone;
Otherwise compare user and host part
|
static boolean |
isEquivalent(URI left,
URI right,
boolean requireUserEqualsPhone)
Compare user part if both are tel URI or tel URI and SIP URI (where the user-part is a phone number);
Otherwise compare user and host part
|
static boolean |
isPhoneNumber(SipURI uri)
Test a SIP URI to see if it represents a phone number.
|
static boolean |
isValidGlobalPhoneNumber(java.lang.String digits)
Checks that a digit string is a valid global phone number in accordance with RFC 2806.
|
static java.lang.String |
percentDecodeHashChars(java.lang.String dialstring)
Decodes all instances of '%23' to the '#' character in the given dialstring.
|
static java.lang.String |
percentEncodeHashChars(java.lang.String dialstring)
Encodes all instances of the '#' character to '%23' in the given dialstring.
|
static Address |
updateAddress(Address originalAddress,
boolean international,
java.lang.String newAddress)
Updates a URI with a new address.
|
static Address |
updateAddress(Address originalAddress,
SipAddressString extractedAddress,
java.lang.String newAddress)
Updates a URI with a new address.
|
static URI |
updateURI(URI originalURI,
boolean international,
java.lang.String newAddress)
Updates a URI with a new address.
|
static URI |
updateURI(URI originalURI,
SipAddressString extractedAddress,
java.lang.String newAddress)
Updates a URI with a new address.
|
public static boolean isPhoneNumber(SipURI uri)
uri
- the SIP URIpublic static SipAddressString getAddressString(URI uri, boolean forceSipUserEqualsPhone)
uri
- the URIforceSipUserEqualsPhone
- force treating the URI user part as a potential phone number even when user=phone is not presentpublic static SipAddressString getAddressString(Address address, boolean forceSipUserEqualsPhone)
address
- the addressforceSipUserEqualsPhone
- force treating the URI user part as a potential phone number even when user=phone is not presentpublic static SipAddressString getAddressString(Address address)
address
- the addresspublic static SipAddressString getAddressString(URI uri)
uri
- the URIpublic static SipAddressString getDigits(URI uri)
uri
- the URIpublic static URI updateURI(URI originalURI, boolean international, java.lang.String newAddress)
originalURI
- the received URIinternational
- if the updated address is internationalnewAddress
- the new address to usepublic static java.lang.String getUserPartParameters(SipURI uri, boolean removePhoneContext)
uri
- the URI to extract parameters fromremovePhoneContext
- whether to remove phone-context parameter if containedpublic static URI updateURI(URI originalURI, SipAddressString extractedAddress, java.lang.String newAddress)
originalURI
- the received URIextractedAddress
- the address extracted from the URInewAddress
- the new address to usepublic static Address updateAddress(Address originalAddress, boolean international, java.lang.String newAddress)
originalAddress
- the received addressinternational
- if the updated address is internationalnewAddress
- the new address to usepublic static Address updateAddress(Address originalAddress, SipAddressString extractedAddress, java.lang.String newAddress)
originalAddress
- the received addressextractedAddress
- the address extracted from the URInewAddress
- the new address to usepublic static java.lang.String extractImeiFromAddress(Address address, javax.slee.facilities.Tracer tracer)
address
- the address to extract the imei fromtracer
- tracerpublic static java.lang.String percentEncodeHashChars(java.lang.String dialstring)
dialstring
- The string to encodepublic static java.lang.String percentDecodeHashChars(java.lang.String dialstring)
dialstring
- The string to decodepublic static boolean isEquivalent(URI left, URI right)
left
- The first URI to compareright
- The second URI to comparepublic static boolean isEquivalent(URI left, URI right, boolean requireUserEqualsPhone)
left
- The first URI to compareright
- The second URI to comparerequireUserEqualsPhone
- if user=phone is required to treat sip URIs as phone numberspublic static boolean isValidGlobalPhoneNumber(java.lang.String digits)
digits
- The digit string to checkCopyright © OpenCloud. All Rights Reserved.