<p></p>
<h3>Description</h3>
<p>From what I experience dynamic routing (drouting) module is not supporting SRV resolution if NAPTR is turned off (dns_try_naptr=no). Is this intentional to not have SRV if NAPTR is turned off? Or some special format of entry is expected for SRV records in gateways table? I've tried with just <strong>domain</strong> and <strong>_sip._udp.domain</strong> but it it the same.</p>
<h4>Reproduction</h4>
<ol>
<li>Use Dynamic routing module</li>
<li>set dns_try_naptr=no</li>
<li>insert gateway with SRV domain name in dynamic routing gateways table.</li>
<li>execute kamcmd drouting.reload</li>
<li>in the log of the kamailio is the error: ERROR: drouting [routing.c:337]: add_dst(): cannot resolve </li>
</ol>
<h3>Possible Solutions</h3>
<p>Upon reload of drouting tables, dynamic routing tries to add destinations and resolve them:<br>
<a href="https://github.com/kamailio/kamailio/blob/08a9ed3d136c861f990e4f63c2c0544e08d9078d/src/modules/drouting/routing.c#L334">https://github.com/kamailio/kamailio/blob/08a9ed3d136c861f990e4f63c2c0544e08d9078d/src/modules/drouting/routing.c#L334</a></p>
<p>But, since port that is sent is NULL, SRV is being skipped later on.  It seems that SRV would be executed if port would be 0 instead of NULL.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.1.9 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, 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_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 4.9.2
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2553">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZK4JNOCYXIEHNO345LSQJOUDANCNFSM4TYOQP2Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZN5GTCK6UAOUJVCBITSQJOUDA5CNFSM4TYOQP22YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4LDCT2RA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2553",
"url": "https://github.com/kamailio/kamailio/issues/2553",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>