<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div dir="auto">Hi,</div></div><div dir="auto"><br></div><div dir="auto">This looks like it could be a combination of a couple of things - one being a possible bug in the DMQ code, and the other not handling the script-generated message correctly.</div><div dir="auto"><br></div><div dir="auto">If we rule out the latter first, I can take a look at the possible bug after.</div><div dir="auto"><br></div><div dir="auto">For in-script communication over DMQ you should not call dmq_handle_message() since there will not be a registered peer/handler for the message. The idea is to handle it in script on the receiver side instead.</div><div dir="auto"><br></div><div dir="auto">You do, however, need to call dmq_handle_message() for handling the built-in peer notifications and module-to-module communication.</div><div dir="auto"><br></div><div dir="auto">So in your case it may look something like:</div><div dir="auto"><br></div><div dir="auto"><font face="monospace">    if(is_method("KDMQ")){<br>        if($rU =~ "userOnline"){<br>            //user came online in cluster, resume transactions if-any suspended<br>            $avp(remoteUser) = $rb;    <br>        } else {<br>            </font><span style="font-family:monospace">dmq_handle_message();</span></div><div dir="auto"><font face="monospace">        }<br>    }<br></font></div><div dir="auto"><br></div><div dir="auto">Let me know how that goes and in the meantime I will grab the core dump and take a look into the segfault.</div><div dir="auto"><br></div><div dir="auto">All the best,</div><div dir="auto"><br></div><div dir="auto">Charles</div></div></div></div></div></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 23 Apr 2020 at 22:38, SamyGo <<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><br><div>Is there a way to broadcast KDMQ to the cluster but not expect a reply back !?as far as I've read the source code dmq_bcast_message is exactly like dmq_send_message in a way that it expects a callback to be executed on response i.e expects a reply.</div><div><br></div><div>So, the situation I'm facing is I'm broadcasting message to cluster and I do not want a reply back. The following two options result in crash & core dump.</div><div><br></div><div>1 - If my script doesn't respond back, by use of dmq_handle_message, it marks the destined servers as "inactive" and stops usrloc sync process which isn't desirable.</div><div>2 - If I respond back with the dmq_handle_message it crashes the Kamailio which just received this broadcasted message.</div><div><br></div><div>Here is how its done in script:<br></div><div><br></div><div><b>broadcasting message to cluster:</b></div><div><font face="monospace">        dmq_bcast_message("userOnline", "$fu", "text/plain");</font><br></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><b>Receiving and handling a broadcast message:</b></font></div><div><font face="monospace">route[DMQ_HANDLE] {</font></div><font face="monospace">    if(!(is_method("KDMQ") || $rm == "KDMQ")) return;<br>   <br>    if(is_method("KDMQ") || $rm == "KDMQ"){<br>            if($rU =~ "userOnline"){<br>                    //user came online in cluster, resume transactions if-any suspended<br>                    $avp(remoteUser) = $rb;    <br>            }<br>            dmq_handle_message();<br>            exit;<br>    }<br>}</font><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><b>Related log lines:</b></font></div><div><font face="monospace">Apr 23 21:15:48  kamailio[916]: ALERT: <script>: [da2c1-2f499] ------ DMQ_HANDLE: UserOnline Event Received ------<br>Apr 23 21:15:48  kamailio[916]: DEBUG: dmq [message.c:53]: ki_dmq_handle_message_rc(): dmq_handle_message [KDMQ <a href="http://sip:userOnline@9.8.7.123:5060" target="_blank">sip:userOnline@9.8.7.123:5060</a>]<br>Apr 23 21:15:48  kamailio[916]: DEBUG: dmq [message.c:66]: ki_dmq_handle_message_rc(): dmq_handle_message peer found: userOnline<br>Apr 23 21:15:48  kamailio[916]: DEBUG: <core> [core/receive.c:437]: receive_msg(): request-route executed in: 401461 usec<br>Apr 23 21:15:48  kamailio[935]: DEBUG: dmq [worker.c:87]: worker_loop(): dmq_worker [2 935] lock acquired<br></font></div><div><font face="monospace">and crash/segfault..<br><br></font></div><div><font face="monospace">Core dump: </font><a href="https://pastebin.com/S7ekCPfF" target="_blank">https://pastebin.com/S7ekCPfF</a><br><br>Any help or pointers to solve this would be really appreciated.</div><div><br></div><div>Best Regards,</div><div>Sammy</div><div><font face="monospace"></font></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>

<br>
<div><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font><span style="font-size:10pt;font-family:Helvetica,Arial,sans-serif"> </span><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></div>