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.
|
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 resolvevoid setDnsTimeout(int timeout)
int getDnsTimeout()
Copyright © 2016. All Rights Reserved.