<p></p>
<p dir="auto">I have an scenario with two kamailios, and no databases. At the first, I authenticate one subscriber successfully and save in memory usrloc:</p>
<pre class="notranslate"><code class="notranslate"> # Handle SIP registrations
route[REGISTRAR] {
if (!is_method("REGISTER")) return;
if (!save("location","0x05")) {
sl_reply_error();
}
exit;
}
</code></pre>
<p dir="auto">--</p>
<pre class="notranslate"><code class="notranslate">/etc/kamailio # kamcmd ul.dump
{
Domains: {
Domain: {
Domain: location
Size: 1024
AoRs: {
Info: {
AoR: 1014@my.domain
HashID: -1989102610
Contacts: {
Contact: {
Address: sip:1014@10.0.0.2:7071;ob
Expires: 299
Q: -1.000000
Call-ID: d5cf6d5f293647a59ba64ba996a793b0
CSeq: 43689
User-Agent: MicroSIP/3.20.7
Received: sip:10.0.0.2:7071
Path: [not set]
State: CS_NEW
Flags: 1
CFlags: 0
Socket: [not set]
Methods: 8159
Ruid: uloc-62d95ca2-3c-1
Instance: [not set]
Reg-Id: 0
Server-Id: 0
Tcpconn-Id: -1
Keepalive: 0
Last-Keepalive: 1658412252
KA-Roundtrip: 0
Last-Modified: 1658412252
}
}
}
}
Stats: {
Records: 1
Max-Slots: 1
}
}
}
}
/etc/kamailio #
</code></pre>
<p dir="auto"><strong>The problem is</strong>: when I start the second kamailio server, the current usrloc users are not replicated to it, so in the second server the usrloc is empty:</p>
<pre class="notranslate"><code class="notranslate">/etc/kamailio # kamcmd ul.dump
{
Domains: {
Domain: {
Domain: location
Size: 1024
AoRs: {
}
Stats: {
Records: 0
Max-Slots: 0
}
}
}
}
</code></pre>
<p dir="auto"><strong>The modules loaded:</strong></p>
<ul dir="auto">
<li>dmq.so</li>
<li>dmq_usrloc.so</li>
</ul>
<p dir="auto"><strong>Params (sync enabled):</strong></p>
<p dir="auto">modparam("dmq_usrloc", "enable", 1)<br>
modparam("dmq_usrloc", "sync", 1)<br>
modparam("dmq_usrloc", "usrloc_domain", "location")<br>
modparam("dmq_usrloc", "usrloc_delete", 1)<br>
modparam("dmq_usrloc", "replicate_socket_info", 0)</p>
<p dir="auto"><strong>Obs</strong>: The DMQ replication is working perfectly. So, if I register another user in server 1, server 2 receives the KDMQ message and the new user appears on usrloc. The real problem is to load pre registered users at startup.</p>
<p dir="auto"><strong>Log messages from second server at startup:</strong></p>
<pre class="notranslate"><code class="notranslate">0(51) DEBUG: <core> [core/sr_module.c:873]: init_mod(): dmq_usrloc
0(51) INFO: dmq_usrloc [dmq_usrloc.c:81]: mod_init(): dmq usrloc replication mode = 1
0(51) DEBUG: <core> [core/sr_module.c:652]: find_mod_export_record(): found export of <ul_bind_usrloc> in module usrloc [/usr/lib/kamailio/modules/usrloc.so]
0(51) DEBUG: <core> [core/sr_module.c:652]: find_mod_export_record(): found export of <bind_dmq> in module dmq [/usr/lib/kamailio/modules/dmq.so]
0(51) DEBUG: dmq_usrloc [usrloc_sync.c:286]: usrloc_dmq_initialize(): loaded dmq api
0(51) DEBUG: dmq_usrloc [usrloc_sync.c:299]: usrloc_dmq_initialize(): dmq peer registered
0(51) DEBUG: dmq_usrloc [dmq_usrloc.c:111]: mod_init(): dmq_usrloc initialized
0(51) DEBUG: <core> [core/sr_module.c:804]: init_mod_child(): idx 0 rank -127: dmq_usrloc [main]
0(51) DEBUG: dmq_usrloc [dmq_usrloc.c:127]: child_init(): child_init PROC_INIT
7(62) DEBUG: dmq_usrloc [usrloc_sync.c:552]: usrloc_dmq_request_sync(): requesting sync from dmq peers
0(51) DEBUG: <core> [core/sr_module.c:804]: init_mod_child(): idx 0 rank 0: dialog [main]
7(62) DEBUG: dmq_usrloc [usrloc_sync.c:568]: usrloc_dmq_request_sync(): sending serialized data {"action":3}
7(62) DEBUG: dmq_usrloc [usrloc_sync.c:317]: usrloc_dmq_send(): sending dmq broadcast...
7(62) DEBUG: dmq [dmq_funcs.c:166]: bcast_dmq_message1(): skipping node sip:10.0.2.38:5090
7(62) DEBUG: dmq [dmq_funcs.c:166]: bcast_dmq_message1(): skipping node sip:10.0.2.30:5090
7(62) DEBUG: dmq [dmq_funcs.c:166]: bcast_dmq_message1(): skipping node sip:0.0.0.0:5090
</code></pre>
<p dir="auto"><strong>List nodes at SERVER 1:</strong></p>
<pre class="notranslate"><code class="notranslate">/etc/kamailio # kamcmd dmq.list_nodes
{
host: 10.0.1.36
port: 5090
resolved_ip: 10.0.1.36
status: active
last_notification: 0
local: 0
}
{
host: 10.0.1.35
port: 5090
resolved_ip: 10.0.1.35
status: active
last_notification: 0
local: 0
}
{
host: 0.0.0.0
port: 5090
resolved_ip: 0.0.0.0
status: active
last_notification: 0
local: 1
}
</code></pre>
<p dir="auto"><strong>List nodes at SERVER 2:</strong></p>
<pre class="notranslate"><code class="notranslate">/etc/kamailio # kamcmd dmq.list_nodes
{
host: 10.0.1.35
port: 5090
resolved_ip: 10.0.1.35
status: active
last_notification: 0
local: 0
}
{
host: 10.0.1.36
port: 5090
resolved_ip: 10.0.1.36
status: active
last_notification: 0
local: 0
}
{
host: 0.0.0.0
port: 5090
resolved_ip: 0.0.0.0
status: active
last_notification: 0
local: 1
}
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3195">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMTXDN3YTDCLY77CULVVFOBRANCNFSM54H4N5QQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZLEIKM47EMKII7FMNLVVFOBRA5CNFSM54H4N5Q2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4TSILM5A.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3195</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3195",
"url": "https://github.com/kamailio/kamailio/issues/3195",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>