From miconda@gmail.com Fri Apr 24 08:33:14 2020 From: Daniel-Constantin Mierla To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] DMQ broadcasting crashes kamailio Date: Fri, 24 Apr 2020 08:33:06 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1247384453==" --===============1247384453== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, 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. Cheers, Daniel On 23.04.20 23:36, SamyGo wrote: > Hi, > > 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. > > 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. > > 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=C2=A0desirable. > 2 - If I respond back with the dmq_handle_message it crashes the > Kamailio which just received this broadcasted message. > > Here is how its done in script: > > *broadcasting message to cluster:* > =C2=A0 =C2=A0 =C2=A0 =C2=A0 dmq_bcast_message("userOnline", "$fu", "text/pl= ain"); > > *Receiving and handling a broadcast message:* > route[DMQ_HANDLE] { > =C2=A0 =C2=A0 if(!(is_method("KDMQ") || $rm =3D=3D "KDMQ")) return; > =C2=A0 =C2=A0 > =C2=A0 =C2=A0 if(is_method("KDMQ") || $rm =3D=3D "KDMQ"){ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if($rU =3D~ "userOnline"){ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //use= r came online in cluster, resume transactions > if-any suspended > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $avp(= remoteUser) =3D $rb; =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dmq_handle_message(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit; > =C2=A0 =C2=A0 } > } > > *Related log lines:* > Apr 23 21:15:48=C2=A0 kamailio[916]: ALERT: