<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Hi, Stefan!<br>
      <br>
      Indeed, there is no "Deleted" state in the db, not even in
      opensips' memory.<br>
      Can you paste the records of two bindings that should not be
      there?<br>
      Since you are using db_virtual, are you experiencing any failover?<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 10/09/2017 02:48 PM, Stefan Tobé
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAA7e_wc81fv-PvqHDVFB=LTBh+b4Y=ANtND4+7e7CK6aBO_GeQ@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>Hi Razvan,<br>
              </div>
              thanks for replying<br>
              <br>
            </div>
            I notice that the bindings remain in the DB for a while (at
            least > 5min), sometimes they are deleted immediately (as
            I would expect), some other times they remain in the table.<br>
          </div>
          So reregistering returns 200OK (2 bindings or 3 , increasing).
          Re querying the DB shows an increment of equal bindings for a
          client until the limit is reached for max amount of
          registrations in the config (10 by default I believe?). <br>
          <br>
          If I decrease that setting lets say to modparam("registrar",
          "max_contacts", 2) then I will very soon get an error reply
          back. Note that this behavior (increment of bindings) is not
          consequently observed (it is intermittent).<br>
          <br>
        </div>
        The DB setting in the config (config was attached to original
        email as well as pcap) is:<br>
        <br>
        #### USeR LOCation module<br>
        loadmodule "usrloc.so"<br>
        #modparam("usrloc", "nat_bflag", "NAT")<br>
        modparam("usrloc", "db_mode",   3)<br>
        modparam("usrloc", "db_url","virtual://pmset")<br>
        <div>
          <div>
            <div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>You mention a '<i>Deleted</i>' state, but I was
                unable to find that flag . Should that be in <i>opensips.location</i>
                table?<br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Oct 9, 2017 at 11:21 AM, Răzvan
          Crainea <span dir="ltr"><<a
              href="mailto:razvan@opensips.org" target="_blank"
              moz-do-not-send="true">razvan@opensips.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> <tt>Hi, Stefan!<br>
                <br>
                Are you saying that the Contacts "leak" in the database
                (they are never deleted), or that they are not deleted
                immediately after the client is deregistering (but they
                are a bit later)?<br>
                <br>
                What is the db_mode setting[1] you are using for the
                usrloc module? Also, note that the Contacts might still
                be present in the database after they are deleted, but
                with a Deleted state. If that's the case, this is
                perfectly fine.<br>
                <br>
                [1] <a
                  class="m_-5532590333889106082moz-txt-link-freetext"
href="http://www.opensips.org/html/docs/modules/2.3.x/usrloc.html#idp5620912"
                  target="_blank" moz-do-not-send="true">http://www.opensips.org/html/<wbr>docs/modules/2.3.x/usrloc.<wbr>html#idp5620912</a><br>
                <br>
                Best regards,<br>
              </tt>
              <pre class="m_-5532590333889106082moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_-5532590333889106082moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">www.opensips-solutions.com</a></pre>
              <div>
                <div class="h5">
                  <div class="m_-5532590333889106082moz-cite-prefix">On
                    10/09/2017 11:57 AM, Stefan Tobé wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr"><br>
                      <div class="gmail_quote">
                        <div dir="ltr">
                          <div>
                            <div>
                              <div>
                                <div>Hi there,<br>
                                </div>
                                I noticed that opensips  2.2.5-1
                                intermittently does NOT flush the
                                contact when the client is
                                deregistering.</div>
                              <div>It is reproducable with multple sip
                                clients. opensips 2.3 also suffers from
                                this issue.<br>
                              </div>
                              <div><br>
                              </div>
                              When I check the mysql database backend I
                              can see that the entry is table
                              opensips.location is not consistently
                              deleted.</div>
                            <div>It works for several times and the
                              subsequently it does not flush the contact
                              showing two bindings the next time the
                              client is registered.</div>
                            <div><br>
                            </div>
                            <div><br>
                            </div>
                            I can unfortunately not monitor the sql
                            queries because opensips is using tls for
                            secure transmission.<br>
                          </div>
                          I use mysql as backend and the config is
                          attached as well as the local wireshark trace
                          I took<span
                            class="m_-5532590333889106082HOEnZb"><font
                              color="#888888"><br clear="all">
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div><br>
                                        <br>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </font></span></div>
                      </div>
                      <br>
                      <br clear="all">
                      <br>
                      -- <br>
                      <div class="m_-5532590333889106082gmail_signature"
                        data-smartmail="gmail_signature">
                        <div dir="ltr">
                          <div>
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div>
                                    <div dir="ltr">
                                      <div><span>
                                          <div>mvg<br>
                                            Stefan Tobé<br>
                                            <br>
                                          </div>
                                          <br>
                                        </span></div>
                                      <div>
                                        <div><span>PM Factory B.V.<br>
                                            Bolderweg 2<br>
                                            1332 AT Almere<br>
                                            tel: 06 21 26 59 68<br>
                                            email: <a
                                              href="mailto:stefan.tobe@privatemobility.nl"
                                              target="_blank"
                                              moz-do-not-send="true">stefan.tobe@pmfactory.nl</a><br>
                                          </span></div>
                                        <div><span>PGP public key: <a
href="https://drive.google.com/file/d/0Bzu42C2IZ1uMNDYzVnM2dkppRVE/view?usp=sharing"
                                              target="_blank"
                                              moz-do-not-send="true">click
                                              here to download</a><br>
                                          </span></div>
                                        <div><span><br>
                                          </span></div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <br>
                    <fieldset
                      class="m_-5532590333889106082mimeAttachmentHeader"></fieldset>
                    <br>
                  </div>
                </div>
                <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_-5532590333889106082moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_-5532590333889106082moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
              </blockquote>
              <br>
            </div>
            <br>
            ______________________________<wbr>_________________<br>
            Users mailing list<br>
            <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
            <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div><span>
                            <div>mvg<br>
                              Stefan Tobé<br>
                              <br>
                            </div>
                            <br>
                          </span></div>
                        <div>
                          <div><span>PM Factory B.V.<br>
                              Bolderweg 2<br>
                              1332 AT Almere<br>
                              tel: 06 21 26 59 68<br>
                              email: <a
                                href="mailto:stefan.tobe@privatemobility.nl"
                                target="_blank" moz-do-not-send="true">stefan.tobe@pmfactory.nl</a><br>
                            </span></div>
                          <div><span>PGP public key: <a
href="https://drive.google.com/file/d/0Bzu42C2IZ1uMNDYzVnM2dkppRVE/view?usp=sharing"
                                target="_blank" moz-do-not-send="true">click
                                here to download</a><br>
                            </span></div>
                          <div><span><br>
                            </span></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>