<div dir="ltr">Hello Henning,<div><br></div><div>I'm preparing Kamailio configuration that uses save() responce codes for additional actions so email from Lars brought my attention. This is not a problem since as Lars mentioned I can check expires value. I just was curious if this is a correct behavior or not.</div><div><br></div><div>Thank you!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 26 черв. 2019 о 23:36 Henning Westerholt <<a href="mailto:hw@skalatan.de">hw@skalatan.de</a>> пише:<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 bgcolor="#FFFFFF">
<p>Hello,</p>
<p>just briefly looked into the code, but I think the return value is like this for the following reasons:</p>
<p>- function update_contacts(..) will skip if a contact is not found and a expires=0 is given (it could be also e.g. that the Contact just expired a few seconds ago in Kamailio)</p>
<p>- this function will return 0, means success</p>
<p>- the calling function save(..) will then return 1 as the default return value</p>
<p>The main question to change this would be how to differentiate between a the valid case (just expired in Kamailio) from the other case (simply not registered at all). What issues do you experience because of this behaviour?</p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<div class="gmail-m_-3527907122528650429moz-cite-prefix">Am 26.06.19 um 16:25 schrieb Володимир Іванець:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello!
<div><br>
</div>
<div>I've just tested this on Kamailio v. 5.3.0-dev6 with <i>modparam("usrloc", "db_mode", 0)</i> setting. save() return code was 1 too. I'm also interested if this behavior is by design.</div>
<div><br>
</div>
<div>Thanks.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">ср, 26 черв. 2019 о 11:34 Lars Olsson <<a href="mailto:lars.olsson@optimobile.se" target="_blank">lars.olsson@optimobile.se</a>> пише:<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 style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
Hi,</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
I have found a behavior in the registrar module that I do have a question about. Is the current behavior correct and wanted?</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
Using the save() method in the script I see the following:</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<ul>
<li>Processing a register request for a user gives return code 1 ( or 2 )</li><li>Processing a unregister request (expires=0) for registered user gives return code 3</li><li>Processing a unregister request (expires=0) for a user which is NOT registered gives return code 1. Why?<br>
</li></ul>
<div style="margin:0px">What is the reason behind this?</div>
<div style="margin:0px">No database entry is added which is expected.</div>
<div style="margin:0px"><br>
</div>
<div style="margin:0px">Test performed on 5.1.4, using DB mode 3.</div>
<div style="margin:0px"><br>
</div>
<div style="margin:0px">For handling a late unregister request ( where registration has already expired) return code does not reflect the the action.</div>
<div style="margin:0px">I assume that manually checking $expires(max) is the option to go then if I want to detect the unregister request or?</div>
<div style="margin:0px"><br>
</div>
<div style="margin:0px">Cheers,</div>
<div style="margin:0px">Lars</div>
</div>
<br>
</div>
</div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">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/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
<br>
<fieldset class="gmail-m_-3527907122528650429mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_-3527907122528650429moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_-3527907122528650429moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="gmail-m_-3527907122528650429moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="gmail-m_-3527907122528650429moz-signature" cols="72">-- 
Henning Westerholt - <a class="gmail-m_-3527907122528650429moz-txt-link-freetext" href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a>
Kamailio services - <a class="gmail-m_-3527907122528650429moz-txt-link-freetext" href="https://skalatan.de/services" target="_blank">https://skalatan.de/services</a></pre>
</div>

</blockquote></div>