<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>you have to provide the version of kamailio for each reported
      kamailio issue, otherwise is hard to match with the source code.
      Use 'kamailio -v' to get version details.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 23.04.20 23:36, SamyGo wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJUJwth44ow0J=eb9zLiRcs--ug8WE9GFVO+2dZgWLCTN+g8aQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <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"
              moz-do-not-send="true">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" moz-do-not-send="true">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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
  </body>
</html>