<p>I suspect, given that the server_id is not showing in the usrloc dump, this is exactly why the server_id filtering is not working.</p>
<p>We need to understand first why server_id is not present, before moving on to the keepalives.</p>
<p>I have run a test locally with two registrar nodes (server_ids 1 and 2) and two subscribers, each registering to a different node.</p>
<p>Output of ul.dump on one of the nodes:</p>
<pre><code>{
        Domains: {
                Domain: {
                        Domain: location
                        Size: 1024
                        AoRs: {
                                Info: {
                                        AoR: 123456
                                        HashID: 924664970
                                        Contacts: {
                                                Contact: {
                                                        Address: sip:123456@10.8.0.151:5066
                                                        Expires: 33
                                                        Q: -1.000000
                                                        Call-ID: 863771482-5066-1@BA.I.A.BFB
                                                        CSeq: 21177
                                                        User-Agent: Grandstream GXP2160 1.0.5.33
                                                        Received: [not set]
                                                        Path: [not set]
                                                        State: CS_NEW
                                                        Flags: 0
                                                        CFlags: 0
                                                        Socket: [not set]
                                                        Methods: 7135
                                                        Ruid: uloc-1-5a007f47-206b-11
                                                        Instance: <urn:uuid:00000000-0000-1000-8000-000B825C66C2>
                                                        Reg-Id: 4
                                                        Server-Id: 1
                                                        Tcpconn-Id: -1
                                                        Keepalive: 0
                                                        Last-Keepalive: 1510225981
                                                        Last-Modified: 1510225981
                                                }
                                        }
                                }
                                Info: {
                                        AoR: 123457
                                        HashID: 924664971
                                        Contacts: {
                                                Contact: {
                                                        Address: sip:123457@10.8.0.135:5066
                                                        Expires: 37
                                                        Q: -1.000000
                                                        Call-ID: 1296753078-5066-1@BA.I.A.BDF
                                                        CSeq: 2000
                                                        User-Agent: Grandstream GXP2100 1.0.8.4
                                                        Received: [not set]
                                                        Path: [not set]
                                                        State: CS_NEW
                                                        Flags: 0
                                                        CFlags: 0
                                                        Socket: udp:10.28.0.21:5060
                                                        Methods: 7135
                                                        Ruid: uloc-2-5a007f22-17c4-1
                                                        Instance: <urn:uuid:00000000-0000-1000-8000-000B823BB51D>
                                                        Reg-Id: 4
                                                        Server-Id: 2
                                                        Tcpconn-Id: -1
                                                        Keepalive: 0
                                                        Last-Keepalive: 1510225985
                                                        Last-Modified: 1510225985
                                                }
                                        }
                                }
                        }
                        Stats: {
                                Records: 2
                                Max-Slots: 1
                        }
                }
        }
}
</code></pre>
<p>As you can see, server_id is present in both contacts and showing the correct value(s).</p>
<p>Can you paste the output (or a snippet) of the same command on one of your nodes?</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/1299#issuecomment-343125793">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Zcwcpv4xbiQlq1zw3gnPwR9VcOxgks5s0uCZgaJpZM4QPgdU">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVmdnKG9L5CvyEt1AkhjOQbRKKVTks5s0uCZgaJpZM4QPgdU.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-343125793"></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":"@charlesrchance in #1299: I suspect, given that the server_id is not showing in the usrloc dump, this is exactly why the server_id filtering is not working.\r\n\r\nWe need to understand first why server_id is not present, before moving on to the keepalives.\r\n\r\nI have run a test locally with two registrar nodes (server_ids 1 and 2) and two subscribers, each registering to a different node.\r\n\r\nOutput of ul.dump on one of the nodes:\r\n\r\n```\r\n{\r\n\tDomains: {\r\n\t\tDomain: {\r\n\t\t\tDomain: location\r\n\t\t\tSize: 1024\r\n\t\t\tAoRs: {\r\n\t\t\t\tInfo: {\r\n\t\t\t\t\tAoR: 123456\r\n\t\t\t\t\tHashID: 924664970\r\n\t\t\t\t\tContacts: {\r\n\t\t\t\t\t\tContact: {\r\n\t\t\t\t\t\t\tAddress: sip:123456@10.8.0.151:5066\r\n\t\t\t\t\t\t\tExpires: 33\r\n\t\t\t\t\t\t\tQ: -1.000000\r\n\t\t\t\t\t\t\tCall-ID: 863771482-5066-1@BA.I.A.BFB\r\n\t\t\t\t\t\t\tCSeq: 21177\r\n\t\t\t\t\t\t\tUser-Agent: Grandstream GXP2160 1.0.5.33\r\n\t\t\t\t\t\t\tReceived: [not set]\r\n\t\t\t\t\t\t\tPath: [not set]\r\n\t\t\t\t\t\t\tState: CS_NEW\r\n\t\t\t\t\t\t\tFlags: 0\r\n\t\t\t\t\t\t\tCFlags: 0\r\n\t\t\t\t\t\t\tSocket: [not set]\r\n\t\t\t\t\t\t\tMethods: 7135\r\n\t\t\t\t\t\t\tRuid: uloc-1-5a007f47-206b-11\r\n\t\t\t\t\t\t\tInstance: \u003curn:uuid:00000000-0000-1000-8000-000B825C66C2\u003e\r\n\t\t\t\t\t\t\tReg-Id: 4\r\n\t\t\t\t\t\t\tServer-Id: 1\r\n\t\t\t\t\t\t\tTcpconn-Id: -1\r\n\t\t\t\t\t\t\tKeepalive: 0\r\n\t\t\t\t\t\t\tLast-Keepalive: 1510225981\r\n\t\t\t\t\t\t\tLast-Modified: 1510225981\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tInfo: {\r\n\t\t\t\t\tAoR: 123457\r\n\t\t\t\t\tHashID: 924664971\r\n\t\t\t\t\tContacts: {\r\n\t\t\t\t\t\tContact: {\r\n\t\t\t\t\t\t\tAddress: sip:123457@10.8.0.135:5066\r\n\t\t\t\t\t\t\tExpires: 37\r\n\t\t\t\t\t\t\tQ: -1.000000\r\n\t\t\t\t\t\t\tCall-ID: 1296753078-5066-1@BA.I.A.BDF\r\n\t\t\t\t\t\t\tCSeq: 2000\r\n\t\t\t\t\t\t\tUser-Agent: Grandstream GXP2100 1.0.8.4\r\n\t\t\t\t\t\t\tReceived: [not set]\r\n\t\t\t\t\t\t\tPath: [not set]\r\n\t\t\t\t\t\t\tState: CS_NEW\r\n\t\t\t\t\t\t\tFlags: 0\r\n\t\t\t\t\t\t\tCFlags: 0\r\n\t\t\t\t\t\t\tSocket: udp:10.28.0.21:5060\r\n\t\t\t\t\t\t\tMethods: 7135\r\n\t\t\t\t\t\t\tRuid: uloc-2-5a007f22-17c4-1\r\n\t\t\t\t\t\t\tInstance: \u003curn:uuid:00000000-0000-1000-8000-000B823BB51D\u003e\r\n\t\t\t\t\t\t\tReg-Id: 4\r\n\t\t\t\t\t\t\tServer-Id: 2\r\n\t\t\t\t\t\t\tTcpconn-Id: -1\r\n\t\t\t\t\t\t\tKeepalive: 0\r\n\t\t\t\t\t\t\tLast-Keepalive: 1510225985\r\n\t\t\t\t\t\t\tLast-Modified: 1510225985\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tStats: {\r\n\t\t\t\tRecords: 2\r\n\t\t\t\tMax-Slots: 1\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nAs you can see, server_id is present in both contacts and showing the correct value(s).\r\n\r\nCan you paste the output (or a snippet) of the same command on one of your nodes?\r\n "}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1299#issuecomment-343125793"}}}</script>