<p>Hmm, just seen one happen now.</p>
<pre><code>U 2017/11/09 13:25:56.263541 10.6.0.189:5060 -> 10.7.0.186:5062

OPTIONS sip:example_user@78.143.152.30:59947 SIP/2.0.
Via: SIP/2.0/UDP 10.6.0.189:5060;branch=z9hG4bK5844925.
Route: <sip:10.7.0.186:5062;lr;received=sip:78.143.152.30:59947>.
From: sip:keepalive@example.com;tag=uloc-1-5a042966-4d55-1-6821c98a-af4da324.
To: sip:example_user@78.143.152.30:59947.
Call-ID: 8ad70ab7-8e92721-ffcfa07@10.6.0.189.
CSeq: 1 OPTIONS.
Content-Length: 0.
.
</code></pre>
<p>What looks like happened here is that the server_id is set to 1, but the socket is not set, so nathelper is getting the default interface from the os and sending the ping on the wrong interface.</p>
<p>Here's the aor on registrar_1:</p>
<pre><code>{
  "jsonrpc":  "2.0",
  "result": {
    "AoR":  "example_user@example.com",
    "Contacts": [{
        "Contact":  {
          "Address":  "sip:example_user@78.143.152.30:59947",
          "Expires":  58,
          "Q":  -1,
          "Call-ID":  "1af6284f-59888f215eb1ff0e91850080f0808080@KX-HDV430X",
          "CSeq": 1288,
          "User-Agent": "BF/IE/KX-HDV430X/06.001/BCC3422AAF2C",
          "Received": "sip:78.143.152.30:59947",
          "Path": "<sip:10.7.0.186:5062;lr;received=sip:78.143.152.30:59947>",
          "State":  "CS_NEW",
          "Flags":  2,
          "CFlags": 64,
          "Socket": "[not set]",
          "Methods":  8095,
          "Ruid": "uloc-1-5a042966-4d55-1",
          "Instance": "[not set]",
          "Reg-Id": 0,
          "Server-Id":  1,
          "Tcpconn-Id": -1,
          "Keepalive":  1,
          "Last-Keepalive": 1510233939,
          "Last-Modified":  1510233939
        }
      }]
  },
  "id": 20508
}
</code></pre>
<p>This contact is serviced by registrar_2 and it looks like it has its socket set to its local interface, but the server_id is still that of registrar_1 so registrar_1 is trying to ping it.</p>
<p>here's the aor on registrar_2 (this one "saved" the location, why is it's server_id still 1?).</p>
<pre><code>{
  "jsonrpc":  "2.0",
  "result": {
    "AoR":  "example_user@example.com",
    "Contacts": [{
        "Contact":  {
          "Address":  "sip:example_user@78.143.152.30:59947",
          "Expires":  68,
          "Q":  -1,
          "Call-ID":  "1af6284f-59888f215eb1ff0e91850080f0808080@KX-HDV430X",
          "CSeq": 1290,
          "User-Agent": "BF/IE/KX-HDV430X/06.001/BCC3422AAF2C",
          "Received": "sip:78.143.152.30:59947",
          "Path": "<sip:10.7.0.186:5062;lr;received=sip:78.143.152.30:59947>",
          "State":  "CS_NEW",
          "Flags":  0,
          "CFlags": 64,
          "Socket": "udp:10.7.0.190:5060",
          "Methods":  8095,
          "Ruid": "uloc-1-5a042966-4d55-1",
          "Instance": "[not set]",
          "Reg-Id": 0,
          "Server-Id":  1,
          "Tcpconn-Id": -1,
          "Keepalive":  1,
          "Last-Keepalive": 1510234052,
          "Last-Modified":  1510234052
        }
      }]
  },
  "id": 20758
}
</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/1299#issuecomment-343155712">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZX14vGXsDV3Mk5lZ6LdvyVT7Mut7ks5s0v94gaJpZM4QPgdU">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZUUdhE5L4G3GFsWZTRPlMEgdXz5Cks5s0v94gaJpZM4QPgdU.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/1299#issuecomment-343155712"></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":"@00Asgaroth00 in #1299: Hmm, just seen one happen now.\r\n```\r\nU 2017/11/09 13:25:56.263541 10.6.0.189:5060 -\u003e 10.7.0.186:5062\r\n\r\nOPTIONS sip:example_user@78.143.152.30:59947 SIP/2.0.\r\nVia: SIP/2.0/UDP 10.6.0.189:5060;branch=z9hG4bK5844925.\r\nRoute: \u003csip:10.7.0.186:5062;lr;received=sip:78.143.152.30:59947\u003e.\r\nFrom: sip:keepalive@example.com;tag=uloc-1-5a042966-4d55-1-6821c98a-af4da324.\r\nTo: sip:example_user@78.143.152.30:59947.\r\nCall-ID: 8ad70ab7-8e92721-ffcfa07@10.6.0.189.\r\nCSeq: 1 OPTIONS.\r\nContent-Length: 0.\r\n.\r\n```\r\n\r\nWhat looks like happened here is that the server_id is set to 1, but the socket is not set, so nathelper is getting the default interface from the os and sending the ping on the wrong interface.\r\n\r\nHere's the aor on registrar_1:\r\n```\r\n{\r\n  \"jsonrpc\":  \"2.0\",\r\n  \"result\": {\r\n    \"AoR\":  \"example_user@example.com\",\r\n    \"Contacts\": [{\r\n        \"Contact\":  {\r\n          \"Address\":  \"sip:example_user@78.143.152.30:59947\",\r\n          \"Expires\":  58,\r\n          \"Q\":  -1,\r\n          \"Call-ID\":  \"1af6284f-59888f215eb1ff0e91850080f0808080@KX-HDV430X\",\r\n          \"CSeq\": 1288,\r\n          \"User-Agent\": \"BF/IE/KX-HDV430X/06.001/BCC3422AAF2C\",\r\n          \"Received\": \"sip:78.143.152.30:59947\",\r\n          \"Path\": \"\u003csip:10.7.0.186:5062;lr;received=sip:78.143.152.30:59947\u003e\",\r\n          \"State\":  \"CS_NEW\",\r\n          \"Flags\":  2,\r\n          \"CFlags\": 64,\r\n          \"Socket\": \"[not set]\",\r\n          \"Methods\":  8095,\r\n          \"Ruid\": \"uloc-1-5a042966-4d55-1\",\r\n          \"Instance\": \"[not set]\",\r\n          \"Reg-Id\": 0,\r\n          \"Server-Id\":  1,\r\n          \"Tcpconn-Id\": -1,\r\n          \"Keepalive\":  1,\r\n          \"Last-Keepalive\": 1510233939,\r\n          \"Last-Modified\":  1510233939\r\n        }\r\n      }]\r\n  },\r\n  \"id\": 20508\r\n}\r\n```\r\n\r\nThis contact is serviced by registrar_2 and it looks like it has its socket set to its local interface, but the server_id is still that of registrar_1 so registrar_1 is trying to ping it.\r\n\r\nhere's the aor on registrar_2 (this one \"saved\" the location, why is it's server_id still 1?).\r\n```\r\n{\r\n  \"jsonrpc\":  \"2.0\",\r\n  \"result\": {\r\n    \"AoR\":  \"example_user@example.com\",\r\n    \"Contacts\": [{\r\n        \"Contact\":  {\r\n          \"Address\":  \"sip:example_user@78.143.152.30:59947\",\r\n          \"Expires\":  68,\r\n          \"Q\":  -1,\r\n          \"Call-ID\":  \"1af6284f-59888f215eb1ff0e91850080f0808080@KX-HDV430X\",\r\n          \"CSeq\": 1290,\r\n          \"User-Agent\": \"BF/IE/KX-HDV430X/06.001/BCC3422AAF2C\",\r\n          \"Received\": \"sip:78.143.152.30:59947\",\r\n          \"Path\": \"\u003csip:10.7.0.186:5062;lr;received=sip:78.143.152.30:59947\u003e\",\r\n          \"State\":  \"CS_NEW\",\r\n          \"Flags\":  0,\r\n          \"CFlags\": 64,\r\n          \"Socket\": \"udp:10.7.0.190:5060\",\r\n          \"Methods\":  8095,\r\n          \"Ruid\": \"uloc-1-5a042966-4d55-1\",\r\n          \"Instance\": \"[not set]\",\r\n          \"Reg-Id\": 0,\r\n          \"Server-Id\":  1,\r\n          \"Tcpconn-Id\": -1,\r\n          \"Keepalive\":  1,\r\n          \"Last-Keepalive\": 1510234052,\r\n          \"Last-Modified\":  1510234052\r\n        }\r\n      }]\r\n  },\r\n  \"id\": 20758\r\n}\r\n```"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1299#issuecomment-343155712"}}}</script>