<div dir="ltr"><div><div>Dear team,<br><br></div>Thank you for your reply.<br><br>@MS & @ Davld, Let me test again and share traces.<br><br></div>@Zaka, I will check the save() result as you suggested. Location is being saved and properly looked up because messages are being delivered (and not stored in DB ) when both parties are online. <br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)">--<br>regards,</span></span></font></div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br>abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445</span></span></font></div></div>
<br><div class="gmail_quote">On 9 April 2018 at 16:38, Muhammad Zaka <span dir="ltr"><<a href="mailto:muhammad.zaka@cloudcall.com" target="_blank">muhammad.zaka@cloudcall.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-GB">
<div class="m_-3522988228998906233WordSection1">
<p class="MsoNormal"><span>Please check the return value of save and replace the logic: -<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">$var(save_result) = save("location") ;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">if ($var(save_result) <= -1) {<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-family:"Courier New""> xlogl("L_ERROR", "[$rm] -> Unable to save user location \n");<br>
sl_reply_error();<u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="font-family:"Courier New""> exit();</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">}
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">if ($var(save_result) == 1) {<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-family:"Courier New""> xlogl("L_INFO", "[$rm] -> dumping messages with MSILO \n");<br>
# MSILO - dumping user's offline messages to user<br>
if (m_dump("$fu")) {<br>
xlogl("L_NOTICE", "MSILO: offline messages for $fu dumped - if they were \n");<br>
}<br>
else {<br>
xlogl("L_NOTICE", "MSILO: no offline messages dumped \n");<br>
};<br>
</span><span style="font-family:"Courier New"">}<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span>This means dump the message only when it is not re-registration.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Thanks<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Regards<u></u><u></u></span></p>
<p class="MsoNormal"><span>Muhammad Zaka<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> sr-users [mailto:<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@<wbr>lists.kamailio.org</a>]
<b>On Behalf Of </b>Abdul Basit<br>
<b>Sent:</b> 08 April 2018 18:43<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>>; Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><wbr>><br>
<b>Subject:</b> Re: [SR-Users] MSILO: SIP stored offline MESSAGE repetitive delivery<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Dear Team,<u></u><u></u></p>
</div>
<p class="MsoNormal">Still stuck with the issue. Kindly suggest where i did wrong.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#274e13">--<br>
regards,</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#274e13"><br>
abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 6 April 2018 at 20:50, Abdul Basit <<a href="mailto:basit.engg@gmail.com" target="_blank">basit.engg@gmail.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi team,<u></u><u></u></p>
</div>
<p class="MsoNormal">I am facing an issue while setting up IM server based on kamailio.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">SIP-SIP online messaging is fine. For offline messaging i am using msilo module which is storing offline messages in 'silo' table.<u></u><u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">As B-party come online ... it receive offline messages stored in database. But
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b>Problem is</b>.. these messages will deliver to B-party as many time it REGISTER online.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">How can I configure msilo module to mark messages delivery status?
<br>
or how can i delete the delivered messages so that there will be no chance of delivering them again on next REGISTER?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Message parts of kamailio.cfg are
<br>
....<br>
<span style="font-family:"Courier New"">/* add local domain aliases */<br>
alias="192.168.10.18"<br>
port=9060<br>
<br>
<br>
# ----- msilo params -----<br>
modparam("msilo", "db_url", DBURL)<br>
modparam("msilo", "db_table", "silo")<br>
modparam("msilo", "sc_mid", "id")<br>
modparam("msilo","from_<wbr>address","<a href="http://sip:registrar@192.168.10.18:9060" target="_blank">sip:registrar@192.<wbr>168.10.18:9060</a>")<br>
modparam("msilo","contact_hdr"<wbr>,"Contact: <a href="http://registrar@192.168.10.18:9060" target="_blank">
registrar@192.168.10.18:9060</a>;<wbr>msilo=yes\r\n")<br>
modparam("msilo","content_<wbr>type_hdr","Content-Type: text/plain\r\n")<br>
<br>
........<br>
<br>
route[MSILO_MESSAGE] {<br>
if (!is_method("MESSAGE")) return;<br>
xlogl("L_NOTICE", "[$rm] r-uri: $ru d-uri: $du \n");<br>
if (lookup("location")) {<br>
xlogl("L_NOTICE", "[$rm] -> loaction found. Relying message [[$rb]] to the UAC \n");<br>
t_relay();<br>
} else {<br>
if (!t_newtran()) {<br>
xlogl("L_ERROR", "[$rm] -> ERROR creating new transaction \n");<br>
sl_reply_error();<br>
exit;<br>
};<br>
xlogl("L_NOTICE", "[$rm] -> Storing MSILO_MESSAGE \n [$ru]-[$tu]-[$ou] \n ");<br>
if (m_store("$ru")) {<br>
xlogl("L_NOTICE", "MSILO: offline message stored! \n");<br>
if (!t_reply("202", "Accpeted and Strored")) {<br>
xlogl("L_ERROR", "MSILO: Err sending 202 reply... \n");<br>
sl_reply_error();<br>
}<br>
} else {<br>
xlogl("L_ERROR", "MSILO: offline message NOT stored... \n");<br>
if (!t_reply("503", "Service Unavailable")) {<br>
sl_reply_error();<br>
}<br>
}<br>
}<br>
exit;<br>
}<br>
<br>
.....<br>
<br>
# Handle SIP registrations<br>
route[REGISTRAR] {<br>
if (!is_method("REGISTER")) return; // discard all non-REGISTER methods<br>
<br>
if(isflagset(FLT_NATS)) {<br>
setbflag(FLB_NATB);<br>
#!ifdef WITH_NATSIPPING<br>
setbflag(FLB_NATSIPPING); //# do SIP NAT pinging<br>
#!endif<br>
}<br>
$avp(received) = "sip:" + $si + ":" + $sp + ";transport=" + $proto;<br>
xlogl("L_INFO", "[$rm] -> UAC actual location $avp(received) \n");<br>
if (!save("location",0x04)) {<br>
xlogl("L_ERROR", "[$rm] -> Unable to save user location \n");<br>
sl_reply_error();<br>
}<br>
else {<br>
xlogl("L_INFO", "[$rm] -> dumping messages with MSILO \n");<br>
# MSILO - dumping user's offline messages to user<br>
if (m_dump("$fu")) {<br>
xlogl("L_NOTICE", "MSILO: offline messages for $fu dumped - if they were \n");<br>
}<br>
else {<br>
xlogl("L_NOTICE", "MSILO: no offline messages dumped \n");<br>
};<br>
}<br>
exit;<br>
}</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Any idea?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#274e13">--<br>
regards,</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#274e13"><br>
abdul basit</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">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/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>