<h3>Description</h3>
<p>Setting the <code>advertise</code> parameter of the <code>listen</code> option in <code>kamailio.cfg</code> has no effect on the <code>Via</code> address sent by the UAC module. I expected the <code>Via</code> header to contain the public IP. Instead, the REGISTER requests sent by the UAC module continue to use the private ip:</p>
<pre><code>listen=<private ip>:5060 advertise <public ip>:5060
</code></pre>
<pre><code>Via: SIP/2.0/UDP <private ip>:5060;branch=z9hG4bK6c7b.fc053184000000000000000000000000.0
</code></pre>
<p>This is confusing since the core cookbook recommends against using <code>advertised_address</code>.</p>
<h3>Possible Solutions</h3>
<p>With the <code>advertised_address</code> option, the IP in the Via header is set to the public IP address as expected:</p>
<pre><code>advertised_address=<public ip>:5060
listen=<private ip>:5060
</code></pre>
<pre><code>Via: SIP/2.0/UDP <public ip>:5060;branch=z9hG4bK45ba.c2851fa6000000000000000000000000.0
</code></pre>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.2.3 (x86_64/linux) c36229
flags: STATS: Off, USE_TCP, USE_TLS, 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: c36229 
compiled on 13:25:11 Jun  2 2019 with gcc 8.3.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>Linux linux 5.1.5-gentoo #1 SMP PREEMPT Mon May 27 14:42:14 CEST 2019 x86_64 AMD A6-3670 APU with Radeon(tm) HD Graphics AuthenticAMD GNU/Linux
</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/1973?email_source=notifications&email_token=ABO7UZILV4W2RUMS2XAQWZTPYO3NPA5CNFSM4HSCQ3GKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXERT4A">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNG4PQ747IRZOHJQRTPYO3NPANCNFSM4HSCQ3GA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZN55JSTHMAQAP3YJP3PYO3NPA5CNFSM4HSCQ3GKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXERT4A.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/1973?email_source=notifications\u0026email_token=ABO7UZILV4W2RUMS2XAQWZTPYO3NPA5CNFSM4HSCQ3GKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXERT4A",
"url": "https://github.com/kamailio/kamailio/issues/1973?email_source=notifications\u0026email_token=ABO7UZILV4W2RUMS2XAQWZTPYO3NPA5CNFSM4HSCQ3GKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXERT4A",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>