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.
We need to understand first why server_id is not present, before moving on to the keepalives.
I have run a test locally with two registrar nodes (server_ids 1 and 2) and two subscribers, each registering to a different node.
Output of ul.dump on one of the nodes:
``` { 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 } } } } ```
As you can see, server_id is present in both contacts and showing the correct value(s).
Can you paste the output (or a snippet) of the same command on one of your nodes?