2011/6/9 Iñaki Baz Castillo ibc@aliax.net:
According to NAPTR:
~$ host -t naptr oversip.net oversip.net has NAPTR record 5 50 "S" "SIPS+D2T" "" _sips._tcp.oversip.net. oversip.net has NAPTR record 10 50 "S" "SIP+D2T" "" _sip._tcp.oversip.net. oversip.net has NAPTR record 20 50 "S" "SIP+D2U" "" _sip._udp.oversip.net. oversip.net has NAPTR record 40 50 "S" "SIP+D2S" "" _sip._sctp.oversip.net. oversip.net has NAPTR record 50 50 "S" "SIPS+D2S" "" _sips._sctp.oversip.net.
So it should try TLS over TCP first, if it fails try TCP and if it fails try UDP.
However it just uses UDP, why??
This is the Kamailio's log about DNS resolution for the above request (note that I've restarted kamailio before the request in order to clean any possible DNS cache):
DEBUG: <core> [dns_cache.c:567]: dns_hash_find(oversip.net(11), 35), h=956 DEBUG: <core> [resolve.c:924]: get_record: skipping 0 NS (p=0x826fdd, end=0x826fdd) DEBUG: <core> [resolve.c:940]: get_record: parsing 0 ARs (p=0x826fdd, end=0x826fdd) DEBUG: <core> [dns_cache.c:1777]: dns_get_related(0x7f359f68db50 (oversip.net, 35), 35, *(nil)) (0) DEBUG: <core> [dns_cache.c:870]: dns_cache_add: adding oversip.net(11) 35 (flags=0) at 956 DEBUG: <core> [dns_cache.c:567]: dns_hash_find(_sip._udp.oversip.net(21), 33), h=23 DEBUG: <core> [resolve.c:924]: get_record: skipping 0 NS (p=0x826f0a, end=0x826f0a) DEBUG: <core> [resolve.c:940]: get_record: parsing 0 ARs (p=0x826f0a, end=0x826f0a) DEBUG: <core> [dns_cache.c:1777]: dns_get_related(0x7f359f68de08 (_sip._udp.oversip.net, 33), 33, *(nil)) (0) DEBUG: <core> [dns_cache.c:870]: dns_cache_add: adding _sip._udp.oversip.net(21) 33 (flags=0) at 23 DEBUG: <core> [dns_cache.c:2362]: dns_srv_get_nxt_rr(0x7f359f68de08, 0, 0, 1367445037): selected 0/1 in grp. 0 (rand_w=0, rr=0x7f359f68de60 p=0 w=0 rsum=0) DEBUG: <core> [dns_cache.c:567]: dns_hash_find(sip.oversip.net(15), 1), h=400 DEBUG: <core> [resolve.c:924]: get_record: skipping 0 NS (p=0x826ef1, end=0x826ef1) DEBUG: <core> [resolve.c:940]: get_record: parsing 0 ARs (p=0x826ef1, end=0x826ef1) DEBUG: <core> [dns_cache.c:1777]: dns_get_related(0x7f359f68def0 (sip.oversip.net, 1), 1, *(nil)) (0) DEBUG: <core> [dns_cache.c:870]: dns_cache_add: adding sip.oversip.net(15) 1 (flags=0) at 400 DEBUG: <core> [dns_cache.c:2982]: dns_a_resovle(sip.oversip.net, 0) returning 0 DEBUG: <core> [dns_cache.c:3236]: dns_srv_resolve_ip("_sip._udp.oversip.net", 0, 0), ret=0, ip=91.121.79.216 DEBUG: <core> [dns_cache.c:3358]: dns_sip_resolve(oversip.net, 0, 0), srv0, ret=0
As per these logs I understand that no NAPTR record is taking place, but just SRV for _sip._udp.oversip.net.