<h3>Description</h3>
<p>The <code>advertise</code> option in a <code>listen</code> parameter seems to only allow the following syntax:<br>
<code>advertise ip_or_host:port</code><br>
The <code>advertise ip_or_host</code> syntax is not allowed and gives the following error:</p>
<blockquote>
<p>CRITICAL:  [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 49, column 1-6: ip address, interface name or hostname expected</p>
</blockquote>
<p>This can be blocking when using DNS SRV features in order to retrieve both host and port to send the SIP messages: when a port is present in the record-route/via headers no DNS SRV are done.<br>
So it prevents from doing some DNS-based load-balancing / failover things.</p>
<h3>Troubleshooting</h3>
<p>We get the same behaviour with using the deprecated <code>advertised_address</code> parameter: default port is set by Kamailio (because it is not possible to force a <em>null</em> value for  <code>advertised_port</code>) in the <em>Via</em> header (but does not seem to affect the <em>R-R</em> header).<br>
The advertised address can only be forced for the <em>Record-Route</em> header using the <code>record_route_advertised_address</code> function in the script.</p>
<h3>Additional Information</h3>
<p>Tested with last Kamailio release on Debian 9.8</p>
<pre><code>version: kamailio 5.2.1 (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 6.3.0
</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/1884">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZXwSuN1QSAWYl3GyMLEHGCnDtV5Eks5vUiStgaJpZM4bk69p">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZSqerhuoN9VFAfkbHjcko-EwFY_zks5vUiStgaJpZM4bk69p.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Hostname only (no ports) in the advertise parameter should be allowed (#1884)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1884"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1884",
"url": "https://github.com/kamailio/kamailio/issues/1884",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>