My Kamailio 3.1.3 performs NATPR lookups:
use_dns_cache = yes
dns_try_naptr = yes
dns_udp_pref=1
dns_tcp_pref=1
dns_tls_pref=1
dns_sctp_pref=1
dns_use_search_list=no
dns_try_ipv6=yes
dns_retr_time=1
dns_retr_no=1
regards
Klaus
Am 09.06.2011 12:44, schrieb Iñaki Baz Castillo:
Hi, I'm testing Kamailio's NAPTR resolution:
version: kamailio 3.2.0-dev4 (x86_64/linux)
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
DNS related configuration:
dns_servers_no=2
dns_srv_lb=yes
dns_try_naptr=yes
dns_use_search_list=no
use_dns_cache=yes
use_dns_failover=yes
dns_tls_preference=1
dns_tcp_preference=1
dns_udp_preference=1
As the doc says it should respect the priorities of the NAPTR records,
see
http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#dns_sctp_pref_dns…:
"To use the remote site preferences set all dns_*_pref to the same
positive value
(e.g. dns_udp_pref=1, dns_tcp_pref=1, dns_tls_pref=1, dns_sctp_pref=1)"
So my kamailio receives an INVITE for an external domain
oversip.net
(no transport param neither port in the RURI) and does a t_relay.
Request RURI is sip:qwe@oversip.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??
Even if I set a minor value to dns_tls_preference (so higher priority
I expect) it still uses UDP.
Am I doing something wrong? Thanks a lot.