public interface DNSResolver
DNSResolver dnsResolver = (DNSResolver) getServletContext().getAttribute("org.mobicents.servlet.sip.DNS_RESOLVER");
| Modifier and Type | Method and Description |
|---|---|
int |
getDnsTimeout() |
SipURI |
getSipURI(URI uri)
From the uri passed in parameter, try to find the corresponding SipURI.
|
List<SipURI> |
locateURIs(SipURI uri)
Discovers servers according to RFC 3263 and/or ENUM support for the given uri passed in parameters
|
Set<String> |
resolveHost(String host)
From the host in parameter, perform an A and AAAA Lookup and also use local host name to IP Address mapping (as DNSJava bypass the /etc/hosts)
to find the list of IP Address corresponding to that hostname
|
void |
setDnsTimeout(int timeout) |
SipURI getSipURI(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
DNSResolver dnsResolver = (DNSResolver) getServletContext().getAttribute("org.mobicents.servlet.sip.DNS_RESOLVER");
try {
URI uri = sipFactory.createURI("tel:+358-555-1234567");
SipURI sipURI = dnsResolver.getSipURI(uri);
} catch (ServletParseException e) {
logger.error("Impossible to create the tel URL", e);
}
uri - the uri used to find the corresponding SipURISet<String> resolveHost(String host)
host - hostname to resolveList<SipURI> locateURIs(SipURI uri)
uri - the uri for which the DNS lookups have to be donevoid setDnsTimeout(int timeout)
int getDnsTimeout()
Copyright © 2017. All rights reserved.