<p>I apologize for the incomplete report so far. I was tracing the SIP traffic with <code>sngrep</code> and unfortunately did not save the pcap file while I was testing something else. The registrations with an alternate source port are in fact hard to reproduce and appear to occur, if at all, only right after (re)starting kamailio. kamailio sends out one (or multiple, in the configured interval of 600-60 seconds) registrations with sport != 5060 and eventually switches to sport 5060 for all subsequent registrations.</p>
<p>The registration dialogs were absolutely normal apart from the source port, e.g.,</p>
<pre><code>1.2.3.4:1026 -> 5.6.7.8:5060
REGISTER sip:sip.example.org SIP/2.0.

5.6.7.8:5060 -> 1.2.3.4:1026
SIP/2.0 401 Unauthorized.

1.2.3.4:1026 -> 5.6.7.8:5060
REGISTER sip:sip.example.org SIP/2.0.

5.6.7.8:5060 -> 1.2.3.4:1026
SIP/2.0 200 OK.
</code></pre>
<p>Can there be a race between obtaining the listening sockets and sending out the first registration?</p>

<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#issuecomment-273688137">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZTXRYvYwrIR2nowxN3c5WaPCejZEks5rTvmKgaJpZM4LmVGr">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZWV3Y4KVVMmv1rLv2Dc9YYKBpVevks5rTvmKgaJpZM4LmVGr.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#issuecomment-273688137"></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":"PERSON","message":"@petercolberg in #936: I apologize for the incomplete report so far. I was tracing the SIP traffic with `sngrep` and unfortunately did not save the pcap file while I was testing something else. The registrations with an alternate source port are in fact hard to reproduce and appear to occur, if at all, only right after (re)starting kamailio. kamailio sends out one (or multiple, in the configured interval of 600-60 seconds) registrations with sport != 5060 and eventually switches to sport 5060 for all subsequent registrations.\r\n\r\nThe registration dialogs were absolutely normal apart from the source port, e.g.,\r\n```\r\n1.2.3.4:1026 -\u003e 5.6.7.8:5060\r\nREGISTER sip:sip.example.org SIP/2.0.\r\n\r\n5.6.7.8:5060 -\u003e 1.2.3.4:1026\r\nSIP/2.0 401 Unauthorized.\r\n\r\n1.2.3.4:1026 -\u003e 5.6.7.8:5060\r\nREGISTER sip:sip.example.org SIP/2.0.\r\n\r\n5.6.7.8:5060 -\u003e 1.2.3.4:1026\r\nSIP/2.0 200 OK.\r\n```\r\n\r\nCan there be a race between obtaining the listening sockets and sending out the first registration?"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/936#issuecomment-273688137"}}}</script>