public interface DNSServerLocator
| Modifier and Type | Method and Description |
|---|---|
void |
addLocalHostName(String localHostName)
Adds a local host name for which the DNS lookups can be bypassed, by example if an URI is targeted at the local server
|
void |
addSupportedTransport(String supportedTransport)
Add a supported transport (UDP, TCP, TLS, SCTP) to the set of supported transports.
|
DNSLookupPerformer |
getDnsLookupPerformer()
Retrieve the
DNSLookupPerformer performing the DNS lookups |
javax.sip.address.SipURI |
getSipURI(javax.sip.address.URI uri)
From the uri passed in parameter, try to find the corresponding SipURI.
|
Queue<javax.sip.address.Hop> |
locateHops(javax.sip.address.URI uri)
Discovers servers according to RFC 3263 and/or ENUM support for the given uri passed in parameters
|
void |
mapLocalHostNameToIP(String localHostName,
Set<String> ipAddresses)
Adds a local host name for which the DNS lookups that are bypassed DNSJava can resolve to a set of IP Addresses
|
void |
removeLocalHostName(String localHostName)
Removes a local host name for which the DNS lookups can be bypassed, by example if an URI is targeted at the local server
|
void |
removeSupportedTransport(String supportedTransport)
Remove a supported transport (UDP, TCP, TLS, SCTP) to the set of supported transports.
|
Queue<javax.sip.address.Hop> |
resolveHostByAandAAAALookup(String hopHost,
int hopPort,
String hopTransport)
Resolve Hostname to lookup IPAddresses corresponding to a given host including local Host Names as DNSJava is bypassing /etc/hosts
|
void |
setDnsLookupPerformer(DNSLookupPerformer dnsLookupPerformer)
Sets the
DNSLookupPerformer to perform the DNS lookups |
void |
unmapLocalHostNameToIP(String localHostName)
Removes a local host name to ip addresses mapping
|
Queue<javax.sip.address.Hop> locateHops(javax.sip.address.URI uri)
uri - the uri for which the DNS lookups have to be doneQueue<javax.sip.address.Hop> resolveHostByAandAAAALookup(String hopHost, int hopPort, String hopTransport)
hopHost - hostname to lookuphopPort - port if any (not useful for lookup, will just be added in the resulting Hop from the Queue)hopTransport - transport if any (not useful for lookup, will just be added in the resulting Hop from the Queue)javax.sip.address.SipURI getSipURI(javax.sip.address.URI uri)
From the uri passed in parameter, try to find the corresponding SipURI. If the uri in parameter is already a SipURI without a user=phone param, it is just returned If the uri in parameter is a TelURL or SipURI with a user=phone param, the phone number is converted to a domain name then a corresponding NAPTR DNS lookup is done to find the SipURI
Usage Example
try {
URI uri = addressFactory.createTelURL("+12153208617");
SipURI sipURI = dnsServerLocator.getSipURI(uri);
} catch (ServletParseException e) {
logger.error("Impossible to create the tel URL", e);
}
uri - the uri used to find the corresponding SipURIvoid addLocalHostName(String localHostName)
localHostName - the name of the local host to addvoid removeLocalHostName(String localHostName)
localHostName - the name of the local host to removevoid mapLocalHostNameToIP(String localHostName, Set<String> ipAddresses)
localHostName - the name of the local host to addipAddresses - the list of ip addresses to map to that hostnamevoid unmapLocalHostNameToIP(String localHostName)
localHostName - the name of the local host to removevoid addSupportedTransport(String supportedTransport)
supportedTransport - the supported transport to addvoid removeSupportedTransport(String supportedTransport)
supportedTransport - the supported transport to removevoid setDnsLookupPerformer(DNSLookupPerformer dnsLookupPerformer)
DNSLookupPerformer to perform the DNS lookupsdnsLookupPerformer - the dnsLookupPerformer to setDNSLookupPerformer getDnsLookupPerformer()
DNSLookupPerformer performing the DNS lookupsCopyright © 2016. All Rights Reserved.