<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>I didn't try to suggest that what you want won't be useful or
      rejected if someone wants to contribute. My explanation was for
      what exists now.</p>
    <p>Also, be aware that you can have one contact per device, which is
      feature controlled differently than the max_contacts -- see save()
      documentation from registrar module.</p>
    <p>Moreover, the usrloc module can delete unreachable contacts (if
      they don't respond to OPTIONS keepalives). It can also remove
      contacts that have the associated tcp connection closed (if the
      devices connect directly to registrar) -- you can implement also
      your idea of sending notifications from an edge proxy when a tcp
      connection is closed (see tcpops module for the event_route
      executed in such case).</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 05/12/2016 13:33, Colin Morelli
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPtU-UpdjJPQnZCK2jLgP88nAA=HwQ-CNx5h3FFvZ9ymd=5X1w@mail.gmail.com"
      type="cite">Hey Daniel,<br>
      <br>
      This makes sense, thanks for the explanation.<br>
      <br>
      While I can understand why it works the way it does now, I still
      think having an option here would be great. My thought is, whether
      the mobile phone that re-registers every 10 minutes or the desk
      phone is "older," the point is that they're both older than the
      device which is currently trying to register and is unable to.
      There's also some preferential logic you could try to add here -
      perhaps try to remove .invalid contacts first, which are generally
      used by browsers and likely less stable than contacts with an IP
      address.<br>
      <br>
      All that said, I appreciate the clarification. I believe it's
      fairly trivial to do this with sqlops anyway so it's not a huge
      deal. I also may be able to do something in the edge proxy to
      automatically send an unregister if a websocket connection closes
      after a register request.<br>
      <br>
      Thanks!<br>
      Colin<br>
      <div class="gmail_quote">
        <div dir="ltr">On Mon, Dec 5, 2016 at 6:02 AM Daniel-Constantin
          Mierla <<a moz-do-not-send="true"
            href="mailto:miconda@gmail.com">miconda@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
            <p class="gmail_msg">Hello,</p>
            <p class="gmail_msg">right now the rule is to reject the
              registrations that exceed the max_contacts limit. The main
              reason behind this policy is the registration mechanism in
              SIP which requires periodic update/refresh but also
              different expires intervals.</p>
            <p class="gmail_msg">In this way it's hard to select the
              "old device". Can be a desktop phone registering every
              hour and stable connection but also a mobile phone
              registering every 10 minutes, changing the ip every now
              and then. By just relying on the oldest registration, the
              desktop phone is likely the candidate to remove most of
              the time, but keep other invalid mobile contacts.</p>
            <p class="gmail_msg">The solution would be to use GRUU (or
              the instance parameter) for registration contacts. In this
              way each new registration from a device will replace its
              own old contact, even if it has a different contact
              address.</p>
            <p class="gmail_msg">Cheers,<br class="gmail_msg">
              Daniel<br class="gmail_msg">
            </p>
          </div>
          <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"> <br
              class="gmail_msg">
            <div class="m_-703750670859093938moz-cite-prefix gmail_msg">On
              01/12/2016 23:59, Colin Morelli wrote:<br
                class="gmail_msg">
            </div>
            <blockquote type="cite" class="gmail_msg">
              <div dir="ltr" class="gmail_msg">Hey Alex - not sure I'm
                quite following what you mean. The bindings are only for
                web clients. Are you suggesting the clients themselves
                de-register? I'd have no problem with that with the
                exception of the fact that there's simply no way to
                guarantee that happens. It's a race condition between
                whether the unregistration can be sent before the
                browser kills the websocket connection on refresh.</div>
              <div class="gmail_extra gmail_msg"><br class="gmail_msg">
                <div class="gmail_quote gmail_msg">On Thu, Dec 1, 2016
                  at 5:57 PM, Alex Balashov <span dir="ltr"
                    class="gmail_msg"><<a moz-do-not-send="true"
                      href="mailto:abalashov@evaristesys.com"
                      class="gmail_msg" target="_blank">abalashov@evaristesys.com</a>></span>
                  wrote:<br class="gmail_msg">
                  <blockquote class="gmail_quote gmail_msg"
                    style="margin:0 0 0 .8ex;border-left:1px #ccc
                    solid;padding-left:1ex">Wouldn't it be more fruitful
                    to delete and reach old bindings in such a scenario?
                    Or are these bindings not only for web clients?<br
                      class="gmail_msg">
                    <div class="gmail_msg">
                      <div class="m_-703750670859093938h5 gmail_msg"><br
                          class="gmail_msg">
                        On December 1, 2016 5:54:06 PM EST, Colin
                        Morelli <<a moz-do-not-send="true"
                          href="mailto:colin.morelli@gmail.com"
                          class="gmail_msg" target="_blank">colin.morelli@gmail.com</a>>
                        wrote:<br class="gmail_msg">
                        >Hey all,<br class="gmail_msg">
                        ><br class="gmail_msg">
                        >I know Kamailio's registrar module has a
                        max_contacts parameter that<br class="gmail_msg">
                        >will<br class="gmail_msg">
                        >limit the number of active contacts for an
                        AOR. However, is there any<br class="gmail_msg">
                        >mechanism to control what happens when that
                        number is hit?<br class="gmail_msg">
                        ><br class="gmail_msg">
                        >When using a web client where every page
                        refresh registers a new<br class="gmail_msg">
                        >contact<br class="gmail_msg">
                        >with Kamailio, it would be useful to
                        automatically roll off the oldest<br
                          class="gmail_msg">
                        >registrations and replace to make room for
                        the new ones. I know this<br class="gmail_msg">
                        >can be<br class="gmail_msg">
                        >manually accomplished with sqlops, but I was
                        hoping something like this<br class="gmail_msg">
                        >already existed.<br class="gmail_msg">
                        ><br class="gmail_msg">
                        >Best,<br class="gmail_msg">
                        >Colin<br class="gmail_msg">
                        ><br class="gmail_msg">
                        ><br class="gmail_msg">
                      </div>
                    </div>
>------------------------------------------------------------------------<br
                      class="gmail_msg">
                    ><br class="gmail_msg">
                    >_______________________________________________<br
                      class="gmail_msg">
                    >SIP Express Router (SER) and Kamailio (OpenSER)
                    - sr-users mailing list<br class="gmail_msg">
                    ><a moz-do-not-send="true"
                      href="mailto:sr-users@lists.sip-router.org"
                      class="gmail_msg" target="_blank">sr-users@lists.sip-router.org</a><br
                      class="gmail_msg">
                    ><a moz-do-not-send="true"
                      href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                      rel="noreferrer" class="gmail_msg" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br
                      class="gmail_msg">
                    <br class="gmail_msg">
                    <br class="gmail_msg">
                    -- Alex<br class="gmail_msg">
                    <br class="gmail_msg">
                    --<br class="gmail_msg">
                    Principal, Evariste Systems LLC (<a
                      moz-do-not-send="true"
                      href="http://www.evaristesys.com" rel="noreferrer"
                      class="gmail_msg" target="_blank">www.evaristesys.com</a>)<br
                      class="gmail_msg">
                    <br class="gmail_msg">
                    Sent from my Google Nexus.<br class="gmail_msg">
                    <br class="gmail_msg">
                    <br class="gmail_msg">
                    _______________________________________________<br
                      class="gmail_msg">
                    SIP Express Router (SER) and Kamailio (OpenSER) -
                    sr-users mailing list<br class="gmail_msg">
                    <a moz-do-not-send="true"
                      href="mailto:sr-users@lists.sip-router.org"
                      class="gmail_msg" target="_blank">sr-users@lists.sip-router.org</a><br
                      class="gmail_msg">
                    <a moz-do-not-send="true"
                      href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                      rel="noreferrer" class="gmail_msg" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br
                      class="gmail_msg">
                  </blockquote>
                </div>
                <br class="gmail_msg">
              </div>
              <br class="gmail_msg">
              <fieldset class="m_-703750670859093938mimeAttachmentHeader
                gmail_msg"></fieldset>
              <br class="gmail_msg">
              <pre class="gmail_msg">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="m_-703750670859093938moz-txt-link-abbreviated gmail_msg" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="m_-703750670859093938moz-txt-link-freetext gmail_msg" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <br class="gmail_msg">
          </div>
          <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
            <pre class="m_-703750670859093938moz-signature gmail_msg" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="m_-703750670859093938moz-txt-link-abbreviated gmail_msg" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a moz-do-not-send="true" class="m_-703750670859093938moz-txt-link-abbreviated gmail_msg" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a moz-do-not-send="true" class="m_-703750670859093938moz-txt-link-abbreviated gmail_msg" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
          </div>
          _______________________________________________<br
            class="gmail_msg">
          SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
          mailing list<br class="gmail_msg">
          <a moz-do-not-send="true"
            href="mailto:sr-users@lists.sip-router.org"
            class="gmail_msg" target="_blank">sr-users@lists.sip-router.org</a><br
            class="gmail_msg">
          <a moz-do-not-send="true"
            href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
            rel="noreferrer" class="gmail_msg" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br
            class="gmail_msg">
        </blockquote>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>