<div dir="ltr">Hi Donat/Opensips Team,<div><br></div><div>We have tested with "working_mode_preset" as <b>sql only</b> because db_mode is deprecated. And as far as opensips logs is concerned , I am attaching opensips logs as a text file with <b>log_level=4, </b>please check if you could find anything unusual.</div><div>Will wait for your feedback.</div><div><br></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best Regards<div>Saurabh Chopra</div><div>+918861979979</div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 16, 2020 at 6:46 PM Donat Zenichev <<a href="mailto:donat.zenichev@gmail.com">donat.zenichev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Good day Sasmita and Saurabh,</div><div>that's a good question to ask and answer actually.</div><div><br></div><div>As I was mentioning at the very beginning, did you try to look into the logs with the deep log_level?</div><div><a href="https://www.opensips.org/Documentation/Script-CoreParameters-3-1#toc37" target="_blank">https://www.opensips.org/Documentation/Script-CoreParameters-3-1#toc37</a></div><div>This is highly appreciated when doing a debug of an issue.<br></div><div><br></div><div>What do "db_mysql.so" and "usrloc.so" say when you try to de-register a subscriber? (with a debug log_level)<br></div><div><br></div><div>Other than that, I want to mention that the "db_mode" parameter is kept now for backwards compatibility.</div><div>It also conflicts with "working_mode_preset" parameter: <a href="https://opensips.org/html/docs/modules/3.1.x/usrloc.html#param_working_mode_preset" target="_blank">https://opensips.org/html/docs/modules/3.1.x/usrloc.html#param_working_mode_preset</a></div><div>Try to see if "working_mode_preset" is also configured on your OpenSIPS instance.<br>And might be, this would also be a good idea to switch to usage of "working_mode_preset" instead of "db_mode", at least because it's a more actual one.<br></div><div><br></div><div>Also how about the:<br><a href="https://opensips.org/html/docs/modules/3.1.x/usrloc.html#param_restart_persistency" target="_blank">https://opensips.org/html/docs/modules/3.1.x/usrloc.html#param_restart_persistency</a></div><div><a href="https://opensips.org/html/docs/modules/3.1.x/usrloc.html#param_sql_write_mode" target="_blank">https://opensips.org/html/docs/modules/3.1.x/usrloc.html#param_sql_write_mode</a></div><div><br></div><div>Is that configured on your OpenSIPS instance? If so, what are the options set for that?</div><div>(of course, this couple should be useless in db only mode, but just in case you have inadvertently configured this as well).</div><div><br></div><div>Anyway, pay much attention to logs at the debug level.</div><div>As this can give you some insight on what happens.</div><div><br></div><div>Have a nice day!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 16, 2020 at 7:58 AM Sasmita Panda <<a href="mailto:spanda@3clogic.com" target="_blank">spanda@3clogic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Donat, <div><br></div><div>According to Saurabh , he is saying in " <b>db_mode=3 and sql-only mode</b> " that direct DB operation happens . </div><div>When a user get registered that contact immediately get populated to the DB and when the user send un-registration the entry from the DB should be deleted at that time . </div><div><b>The deletion part is not happening in his case </b>.<b> The contact from location table delete when in the expiration time</b> .</div><div><br></div><div>According to opensips documentation , the timer works when the user not able to un-registrer itself . Then data persist in the DB . That should be deleted in the timer interval . This is fine . </div><div><br></div><div>If I will explain through example . </div><div>1. Usr get register at 11.10.10 with expire 300sec . </div><div>2. User send un-register at 11.11.10 (But the data wont get deleted from the DB somehow)</div><div>3. The user was gone away in 1min only . But the data in DB is there for next 4min . <b> In this case the timer wont play any role . Even though <span style="background-color:rgb(254,254,238);color:rgb(0,0,0)">timer_interval is set to 120sec . Still the contact exists till 5min . </span></b></div><div>4. If an INVITE will come for that user . Then opensips will try to push the call to that existing contact . But I was expecting 404 Not Found . </div><div><br></div><div>This is the problem . As for the previous version of opensips this is working fine . But in 3.1 we are facing issue . </div><div><br></div><div>I have taken opensips code from </div><div><pre style="font-size:0.9em;font-family:"Lucida Console","Andale Mono","Courier New",Courier;margin-top:0px;margin-bottom:0px;color:rgb(102,102,102)"><strong><code style="font-size:11.7072px;font-family:"Lucida Console","Andale Mono","Courier New",Courier;padding:6px;border:1px solid rgb(235,235,235);background-color:rgb(251,254,250);white-space:nowrap">git clone <a href="https://github.com/OpenSIPS/opensips.git" target="_blank">https://github.com/OpenSIPS/opensips.git</a> -b 3.1 opensips-3.1</code></strong></pre></div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div><b><i>Please suggest what else we should do .</i></b></div><div dir="ltr"><b><i><br></i></b></div><div dir="ltr"><b><i>Thanks & Regards</i></b><div><i>Sasmita Panda</i></div><div><i>Senior Network Testing and Software Engineer</i></div><div><i>3CLogic , ph:07827611765</i></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 14, 2020 at 5:13 PM Donat Zenichev <<a href="mailto:donat.zenichev@gmail.com" target="_blank">donat.zenichev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Good day Saurabh, could you refer to the RFC and the particular row in that, that talks about a backend database and time in which the row should be deleted from that?<br>I just wonder if I missed this somewhere. I haven't ever seen a specification for databases backend in RFCs related to the SIP protocol.<div>Would be a good thing for me to learn something new! :)</div><div><br></div><div>I just want to mention, and focus you on the fact, that you might need to take a look at this parameter:<br><a href="https://opensips.org/html/docs/modules/3.0.x/usrloc.html#param_timer_interval" target="_blank">https://opensips.org/html/docs/modules/3.0.x/usrloc.html#param_timer_interval</a><br></div><div><br></div><div>As this plays not the last role when working in sql-only mode.</div><div>Did you read something about that?</div><div><br></div><div>One more time, a quotation:</div><div>1. "<span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">Number of seconds between two timer runs. During each run, the module will update/delete dirty/expired contacts from memory and/or mirror these operations to the database, if configured to do so."</span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">2. "</span><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">sql-only</span><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify"> - DB-Only scheme. No memory cache is kept, all operations being directly performed with the database. The timer deletes all expired contacts from database - cleans after clients that didn't un-register or re-register."</span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">This is how it works.</span></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 14, 2020 at 12:26 PM Saurabh Chopra <<a href="mailto:saurabhc@3clogic.com" target="_blank">saurabhc@3clogic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Donat/Opensips Team,<div><br></div><div>Apologies for late response, but ideally the entry should be deleted after un-registration is sent otherwise it will violate the RFC rule.</div><div>Also, this SQL Only Mode is perfectly working with opensips 2.2 and 3.0 versions with the same configuration. Could you guys try to replicate this Or confirm if I am missing anything in the configuration side.<br></div><div><br></div><div><br clear="all"><div><div dir="ltr"><div dir="ltr">Best Regards<div>Saurabh Chopra</div><div>+918861979979</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 11, 2020 at 2:22 PM Donat Zenichev <<a href="mailto:donat.zenichev@gmail.com" target="_blank">donat.zenichev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I just want to follow up with the thing that, using the sql-only mode, expired location records might not be deleted right away.<br>I just remembered all of the sudden, that the timer interval controls data clearing/updating when using sql-only mode.<br></div><div><br></div><div>Then you might also want to play with your timer interval value. How huge is that now?</div><div><a href="https://opensips.org/html/docs/modules/3.0.x/usrloc.html#param_timer_interval" target="_blank">https://opensips.org/html/docs/modules/3.0.x/usrloc.html#param_timer_interval</a></div><div><br></div><div>This one is responsible for clearing out expired contacts from the user location table.</div><div>Here is a quotation from the "sql-only" mod description:</div><div>"The timer deletes all
expired contacts from database - cleans after clients that didn't
un-register or re-register."</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 11, 2020 at 9:22 AM Donat Zenichev <<a href="mailto:donat.zenichev@gmail.com" target="_blank">donat.zenichev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Good morning Saurabh,</div><div>that sounds a bit odd, as the sql only mode supposes that usrloc.so updates the backend sql right away.</div><div><br></div><div>Do you have any warnings occurring in the OpenSIPS log?</div><div>There might be a case for an inability of OpenSIPS to reach the sql server at the moment of de-registration.</div><div>See if there are any re-connections to the database.<br></div><div><br></div><div>And also did you try to gather opensips logs with a debug level?</div><div>Try to see which log rows both "db_mysql.so" (if you are using mysql as a backend db) and "usrloc.so" are throwing out into the log, when you send a de-registration.</div><div><br></div><div>Otherwise, you might also try to use either "single-instance-sql-write-through" or "single-instance-sql-write-back", which perhaps can better fit your demands.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 11, 2020 at 9:00 AM Saurabh Chopra <<a href="mailto:saurabhc@3clogic.com" target="_blank">saurabhc@3clogic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi All,</div><div><br></div><div>I am testing a usrloc module with db_mode=3(sql only) and a strange thing is happening, when we send an unregistration request
the user entry is not deleting
from the database
. However the entry is deleted after expiry timer.</div><div><br></div><div>loadmodule "usrloc.so"<br>modparam("usrloc", "nat_bflag", "NAT")<br>modparam("usrloc", "db_mode", 3)<br>modparam("usrloc", "db_url", "mysql://root:xxxxg1c@localhost/opensips")<br></div><div><br></div><div><br></div><div>Does db_mode=3 used to work like this? Or I am missing something?</div><br clear="all"><div><div dir="ltr"><div dir="ltr">Best Regards<div>Saurabh Chopra</div><div>+918861979979</div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>