<div dir="ltr">Ok, I'll do that. Thanks.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 24, 2022 at 8:56 AM Henning Westerholt <<a href="mailto:hw@gilawa.com">hw@gilawa.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="DE" style="overflow-wrap: break-word;">
<div class="gmail-m_2609856538626956635WordSection1">
<p class="MsoNormal"><span>Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">it should sync the existing records on startup, in fact it even logs some messages related to that.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Maybe just give a more recent version a try, e.g. one of the later 5.5.x releases.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt –
</span><span><a href="https://skalatan.de/blog/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services –
</span><span><a href="https://gilawa.com/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://gilawa.com</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Benedito Marques<br>
<b>Sent:</b> Thursday, July 21, 2022 8:37 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> [SR-Users] Cannot load usrloc table at startup using DMQ_USRLOC sync feature<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">I have an scenario with two kamailios, and no databases. At the first, I authenticate one subscriber successfully and save in memory usrloc:<br>
<br>
<br>
/etc/kamailio # kamailio --version<br>
version: kamailio 5.4.4 (x86_64/linux)<br>
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
 HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED<br>
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled on 16:13:18 Feb 15 2021 with gcc 9.3.0<br>
/etc/kamailio #<br>
/etc/kamailio #<br>
<br>
---<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><br>
/etc/kamailio # cat /etc/os-release<br>
NAME="Alpine Linux"<br>
ID=alpine<br>
VERSION_ID=3.12.3<br>
PRETTY_NAME="Alpine Linux v3.12"<br>
HOME_URL="<a href="https://alpinelinux.org/" target="_blank">https://alpinelinux.org/</a>"<br>
BUG_REPORT_URL="<a href="https://bugs.alpinelinux.org/" target="_blank">https://bugs.alpinelinux.org/</a>"<br>
<br>
---<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><br>
 # Handle SIP registrations<br>
route[REGISTRAR] {<br>
if (!is_method("REGISTER")) return;<br>
<br>
if (!save("location","0x05")) {<br>
sl_reply_error();<br>
}<br>
exit;<br>
}<br>
<br>
<br>
--<br>
<br>
<br>
/etc/kamailio # kamcmd ul.dump<br>
{<br>
        Domains: {<br>
                Domain: {<br>
                        Domain: location<br>
                        Size: 1024<br>
                        AoRs: {<br>
                                Info: {<br>
                                        AoR: <a href="mailto:1014@my.domain" target="_blank">1014@my.domain</a><br>
                                        HashID: -1989102610<br>
                                        Contacts: {<br>
                                                Contact: {<br>
                                                        Address: <a>
sip:1014@10.0.0.2:7071;ob</a><br>
                                                        Expires: 299<br>
                                                        Q: -1.000000<br>
                                                        Call-ID: d5cf6d5f293647a59ba64ba996a793b0<br>
                                                        CSeq: 43689<br>
                                                        User-Agent: MicroSIP/3.20.7<br>
                                                        Received: sip:<a href="http://10.0.0.2:7071" target="_blank">10.0.0.2:7071</a><br>
                                                        Path: [not set]<br>
                                                        State: CS_NEW<br>
                                                        Flags: 1<br>
                                                        CFlags: 0<br>
                                                        Socket: [not set]<br>
                                                        Methods: 8159<br>
                                                        Ruid: uloc-62d95ca2-3c-1<br>
                                                        Instance: [not set]<br>
                                                        Reg-Id: 0<br>
                                                        Server-Id: 0<br>
                                                        Tcpconn-Id: -1<br>
                                                        Keepalive: 0<br>
                                                        Last-Keepalive: 1658412252<br>
                                                        KA-Roundtrip: 0<br>
                                                        Last-Modified: 1658412252<br>
                                                }<br>
                                        }<br>
                                }<br>
                        }<br>
                        Stats: {<br>
                                Records: 1<br>
                                Max-Slots: 1<br>
                        }<br>
                }<br>
        }<br>
}<br>
/etc/kamailio # <br>
<br>
<br>
<br>
<b>The problem is</b>: 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:<br>
<br>
<br>
<br>
/etc/kamailio # kamcmd ul.dump<br>
{<br>
        Domains: {<br>
                Domain: {<br>
                        Domain: location<br>
                        Size: 1024<br>
                        AoRs: {<br>
                        }<br>
                        Stats: {<br>
                                Records: 0<br>
                                Max-Slots: 0<br>
                        }<br>
                }<br>
        }<br>
}<br>
<br>
<br>
<br>
<b>The modules loaded:</b><br>
<br>
 - dmq.so<br>
 - dmq_usrloc.so<br>
<br>
<b>Params (sync enabled):</b><br>
<br>
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)<br>
<br>
<br>
<b>Obs</b>: 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.<br>
<br>
<b>Log messages from second server at startup:</b><br>
<br>
<br>
0(51) DEBUG: <core> [core/sr_module.c:873]: init_mod(): dmq_usrloc<br>
 0(51) INFO: dmq_usrloc [dmq_usrloc.c:81]: mod_init(): dmq usrloc replication mode = 1<br>
 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]<br>
 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]<br>
 0(51) DEBUG: dmq_usrloc [usrloc_sync.c:286]: usrloc_dmq_initialize(): loaded dmq api<br>
 0(51) DEBUG: dmq_usrloc [usrloc_sync.c:299]: usrloc_dmq_initialize(): dmq peer registered<br>
 0(51) DEBUG: dmq_usrloc [dmq_usrloc.c:111]: mod_init(): dmq_usrloc initialized<br>
<br>
 0(51) DEBUG: <core> [core/sr_module.c:804]: init_mod_child(): idx 0 rank -127: dmq_usrloc [main]<br>
 0(51) DEBUG: dmq_usrloc [dmq_usrloc.c:127]: child_init(): child_init PROC_INIT<br>
<br>
 7(62) DEBUG: dmq_usrloc [usrloc_sync.c:552]: usrloc_dmq_request_sync(): requesting sync from dmq peers<br>
 0(51) DEBUG: <core> [core/sr_module.c:804]: init_mod_child(): idx 0 rank 0: dialog [main]<br>
 7(62) DEBUG: dmq_usrloc [usrloc_sync.c:568]: usrloc_dmq_request_sync(): sending serialized data {"action":3}<br>
 7(62) DEBUG: dmq_usrloc [usrloc_sync.c:317]: usrloc_dmq_send(): sending dmq broadcast...<br>
<br>
 7(62) DEBUG: dmq [dmq_funcs.c:166]: bcast_dmq_message1(): skipping node sip:<a href="http://10.0.2.38:5090" target="_blank">10.0.2.38:5090</a><br>
 7(62) DEBUG: dmq [dmq_funcs.c:166]: bcast_dmq_message1(): skipping node sip:<a href="http://10.0.2.30:5090" target="_blank">10.0.2.30:5090</a><br>
 7(62) DEBUG: dmq [dmq_funcs.c:166]: bcast_dmq_message1(): skipping node sip:<a href="http://0.0.0.0:5090" target="_blank">0.0.0.0:5090</a><br>
<br>
<br>
<br>
<br>
<b>List nodes at SERVER 1:</b><br>
<br>
<br>
/etc/kamailio # kamcmd dmq.list_nodes<br>
{<br>
        host: 10.0.1.36<br>
        port: 5090<br>
        resolved_ip: 10.0.1.36<br>
        status: active<br>
        last_notification: 0<br>
        local: 0<br>
}<br>
{<br>
        host: 10.0.1.35<br>
        port: 5090<br>
        resolved_ip: 10.0.1.35<br>
        status: active<br>
        last_notification: 0<br>
        local: 0<br>
}<br>
{<br>
        host: 0.0.0.0<br>
        port: 5090<br>
        resolved_ip: 0.0.0.0<br>
        status: active<br>
        last_notification: 0<br>
        local: 1<br>
}<br>
<br>
<br>
<br>
<b>List nodes at SERVER 2:</b><br>
<br>
<br>
/etc/kamailio # kamcmd dmq.list_nodes<br>
{<br>
        host: 10.0.1.35<br>
        port: 5090<br>
        resolved_ip: 10.0.1.35<br>
        status: active<br>
        last_notification: 0<br>
        local: 0<br>
}<br>
{<br>
        host: 10.0.1.36<br>
        port: 5090<br>
        resolved_ip: 10.0.1.36<br>
        status: active<br>
        last_notification: 0<br>
        local: 0<br>
}<br>
{<br>
        host: 0.0.0.0<br>
        port: 5090<br>
        resolved_ip: 0.0.0.0<br>
        status: active<br>
        last_notification: 0<br>
        local: 1<br>
}<br>
<br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">-- <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:12pt;font-family:"Times New Roman",serif;color:black;background:white"><br>
</span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black;background:white">Att,<br>
Benedito Marques</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:20.8px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline"><span style="font-family:"times new roman",serif"><br><font size="2"><font style="color:rgb(0,0,0)" size="2">Att,<br>Benedito Marques</font></font></span></span></div></div>