org.mobicents.javax.servlet.sip.dns
Interface DNSResolver


public interface DNSResolver

Allows for an application to perform DNS queries to modify the SIP Message before it is sent out.
To get the DNSResolver from your application just use

 DNSResolver dnsResolver = (DNSResolver) getServletContext().getAttribute("org.mobicents.servlet.sip.DNS_RESOLVER");
 

Author:
jean.deruelle@gmail.com

Method Summary
 SipURI getSipURI(URI uri)
          From the uri passed in parameter, try to find the corresponding SipURI.
 

Method Detail

getSipURI

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);
 }
 

Parameters:
uri - the uri used to find the corresponding SipURI
Returns:
the SipURI found through ENUM methods or the uri itself if the uri is already a SipURI without a user=phone param


Copyright © 2011. All Rights Reserved.