<p>When registering to an upstream provider using the uac module, the source port of REGISTER messages alternates seemingly randomly between either 5060 or the lowest available port, e.g., 1024, 1025, 1026. All SIP providers that I tested send subsequent INVITEs of incoming calls to the originating ip/port of the prior REGISTER, which is problematic when kamilio is running behind a firewall.</p>
<p>I tested both the latest master (<a href="https://github.com/kamailio/kamailio/commit/7c03340b4b486afaf00b14a6589c13b7165240a0" class="commit-link"><tt>7c03340</tt></a>) and 4.4 (<a href="https://github.com/kamailio/kamailio/commit/df5ef6183350d99f77087dd83950ef35466e84a1" class="commit-link"><tt>df5ef61</tt></a>) on Debian unstable/amd64.</p>
<h4>/etc/kamailio/kamailio.cfg</h4>
<pre><code>#!KAMAILIO

debug=3

loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "db_text.so"
loadmodule "dialog.so"
loadmodule "uac.so"

#!define DBURL "text:///etc/kamailio/dbtext"

modparam("rr", "append_fromtag", 1)
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "track_cseq_updates", 1)
modparam("uac", "restore_dlg", 1)
modparam("uac", "reg_db_url", DBURL)
modparam("uac", "reg_timer_interval", 60)
modparam("uac", "reg_retry_interval", 60)
modparam("uac", "reg_contact_addr", "1.2.3.4:5060")

request_route {
        exit;
}
</code></pre>
<h4>/etc/kamailio/dbtext/uacreg</h4>
<pre><code>l_uuid(string) l_username(string) l_domain(string) r_username(string) r_domain(string) realm(string) auth_username(string) auth_password(string) auth_proxy(string) expires(int) flags(int) reg_delay(int) 
12345678:user:domain.local:11111111:sip.example.org:sip.example.org:11111111:XXXXXXXXXXXXXXXX:sip\:sip.example.org:600:0: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/936">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZViP0aDHa90X7QryYkXrc38SxSSAks5rTVqxgaJpZM4LmVGr">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZQT9LMvFgD82-BD_JzsXjUxow4x8ks5rTVqxgaJpZM4LmVGr.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/936"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<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://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"[uac] REGISTER source port alternates between 5060 and != 5060 (#936)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/936"}}}</script>