|
|
||
Binod's BlogFebruary 2008 ArchivesLocating SIP servers using DNS in SailFinPosted by binod on February 22, 2008 at 02:58 AM | Permalink | Comments (2)As per RFC 3263, there are two new kind of records that are important for SIP. They are Naming Authority Pointer (NAPTR) Record and Service Record (SRV). In this example, NAPTR is used as a mechanism to specify the protocol (TCP or UDP) where as SRV records will be used locate the server and port from SailFin. Example snippet from DNS zone file _sip._udp.test.com. 3600 IN SRV 10 0 5090 sailfinserver.test.com. _sip._tcp.test.com. 3600 IN SRV 10 0 5090 sailfinserver.test.com. _sips._tcp.test.com. 3600 IN SRV 10 0 5061 sailfinserver.test.com. _sips._udp.test.com. 3600 IN SRV 10 0 5061 sailfinserver.test.com. ; order pref flags service regexp replacement test.com. IN NAPTR 0 0 "s" "SIPS+D2T" "" _sips._tcp.test.com. test.com. IN NAPTR 1 0 "s" "SIP+D2T" "" _sip._tcp.test.com. test.com. IN NAPTR 2 0 "s" "SIP+D2U" "" _sip._udp.test.com. sailfinserver.test.com. IN A 192.168.1.100Lets take the NAPTR record shown above, the third column, in these records suggest that the server support TLS over TCP, TCP and UDP protocols and are preferred in that order. Now, if the client support TCP and UDP, then the preference will be given to TCP as that has the lower order compared to UDP. The SRV records suggest that the port used by the server for TCP and UDB communication is 5090 and not the usual 5060 and the actual server is sailfinserver.test.com. Finally we have an A record that resolves the sailfinserver.test.com to the computer's IP address. SailFin uses dnsjava apis for name resolution. It allows the user to configure a JVM option called dns.server for specifying the name server. We could specify that as a jvm-option in domain.xml
If this is not specified, dnsjava also searches /etc/resolve.conf to find the name server. For experimenting that was better for me, as I always have a local name server running in the laptop. (For a moment forget Sip/SailFin, local name server (bind) performs much better for me than BSNL or opendns. That itself is a reason to run a local name server). Here is my /etc/resolve.conf file content. nameserver 127.0.0.1 Once these are configured, SailFin will be able to resolve the domain "test.com" and find correct SIP server, protocol, port etc. Here is the example of the INVITE message that I tried.
With these settings, SailFin will resolve "To" address to 192.168.1.100:5090 and will use TCP protocol. | ||
|
|