<div dir="ltr"><div>Dear Team,<br><br></div>I have added traces via pasetbin<br><br>MESSAGE Stored When B is OffLine <a href="https://pastebin.com/NLwMePmf">https://pastebin.com/NLwMePmf</a><br><br><img src="cid:ii_jfsb8zbq0_162aabaf553dc704" width="414" height="180"><br><br><br><div>Next this messages should be delivered when B party REGISTER with the server<br></div><div><br><b>Issue 1</b>: Message was delivered to B-party but it didn't remove form DB and as a result MESSAGE deliver to B-party as many times it come line <a href="https://pastebin.com/7pb0wCKx">https://pastebin.com/7pb0wCKx</a><br><img src="cid:ii_jfsbfwzk1_162aabfe384df9fc" style="margin-right: 0px;"><br><br></div><div>Now next issue is<br></div><div><b>Issue 2</b>: Messages deliver to B-party when its already online without storing in DB. B-party receive MESSAGE successfully but A-party gets MESSAGE delivery failed.<br></div><div><a href="https://pastebin.com/zgDbK4F6">https://pastebin.com/zgDbK4F6</a><br><br><img src="cid:ii_jfsbo87g2_162aac5cde3c19ca" width="473" height="194"><br><br></div><div>I intentionally modified the 202 - description for better troubleshooting.<br><br></div><div>See if attachments were received properly through mailing list. <br></div><div><br>For convenience I have attached the pcap as well.<br><br></div><div>MESSAGE: 1: Accepted and Stored as expected<br>MESSAGE: 2: Server delivered Message when B comes online<br>MESSAGE: 3: Both A & B are online. A-party receives MESSAGE delivery failure where as B-party receives MESSAGE successfully<br><br></div><div><br></div><div>Modified default kamailio.cfg is <a href="https://pastebin.com/thZig5RC">https://pastebin.com/thZig5RC</a><br></div><div>It looks that mingled up the configuration.<br><br></div><div>Please see whats gone wrong here. <br></div><div><br></div></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 18:20, Abdul Basit <span dir="ltr"><<a href="mailto:basit.engg@gmail.com" target="_blank">basit.engg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><span class=""><br clear="all"><div><div class="m_3863422767061492926gmail_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></span><div class="gmail_quote"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div link="blue" vlink="purple" lang="EN-GB">
<div class="m_3863422767061492926m_-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>
<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>
<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@lists<wbr>.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="m_3863422767061492926h5">
<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_address<wbr>","<a href="http://sip:registrar@192.168.10.18:9060" target="_blank">sip:registrar@192.168.10.<wbr>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>;m<wbr>silo=yes\r\n")<br>
modparam("msilo","content_type<wbr>_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></div></div>______________________________<wbr>_________________<span class=""><br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
</span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>