<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    On 3/12/12 11:29 AM, Reda Aouad wrote:
    <blockquote
cite="mid:CAA30pc6B1ozuDG6Tqw6ZzgmcZ1qgs11hucxWa-Rg5h-t1jTSUw@mail.gmail.com"
      type="cite">
      <div dir="ltr"><font color="#3366ff"><font><font
              face="tahoma,sans-serif">I think I didn't define well my
              need. Or I miss something in my comprehension of the
              modules/function.<br>
              <br>
              I need one registration per subscriber and user agent
              combination. If a new registration comes for the same
              combination, it should replace the old one.<br>
              <br>
              save("location") doesn't replace the old registration. and
              save("location", 0x04) doesn't take into account the user
              agent.<br>
              <br>
              I think I should do it manually...<br clear="all">
            </font></font></font></div>
    </blockquote>
    <br>
    You can fetch all contacts in the config and check each record there
    based on your own rules, then do save or reject registration - an
    example to start from is here:<br>
    <br>
    &nbsp; *
<a class="moz-txt-link-freetext" href="http://kamailio.org/docs/modules/stable/modules_k/registrar.html#id2498441">http://kamailio.org/docs/modules/stable/modules_k/registrar.html#id2498441</a><br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote
cite="mid:CAA30pc6B1ozuDG6Tqw6ZzgmcZ1qgs11hucxWa-Rg5h-t1jTSUw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div dir="ltr">
          <font color="#3366ff" face="tahoma, sans-serif"><br>
          </font>
          <div><font color="#3366ff" face="tahoma, sans-serif">Reda</font></div>
        </div>
        <br>
        <br>
        <br>
        <div class="gmail_quote">On Sat, Mar 3, 2012 at 12:20,
          Daniel-Constantin Mierla <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com"
              target="_blank">miconda@gmail.com</a>&gt;</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">
              <div> <br>
                <br>
                On 3/2/12 1:53 PM, Reda Aouad wrote:
                <blockquote type="cite">
                  <div dir="ltr"><font color="#3366ff"><font><font
                          face="tahoma,sans-serif">Thank you all, but I
                          already know the above params / functions.
                          They don't fulfill my need.<br>
                          I still need multiple registrations per
                          subscriber, but either one registration per
                          user agent, or new registrations overwriting
                          earliest ones.<br>
                          <br>
                          It seems I can't do that using usrloc or
                          registrar modules for that.<br clear="all">
                        </font></font></font></div>
                </blockquote>
              </div>
              you can use it for one registration per user agent, why
              you say you don't? Nobody stops you using save("location")
              or save("location", "0x4") based on user agent id, in the
              same config file.<br>
              <br>
              For removing the oldest contact, you will need a bit of
              coding, or, if you do db only mode, you can do a sql query
              to remove the oldest record.<br>
              <br>
              Cheers,<br>
              Daniel
              <div>
                <div><br>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div dir="ltr"><font color="#3366ff" face="tahoma,
                          sans-serif"><br>
                        </font>
                        <div><font color="#3366ff" face="tahoma,
                            sans-serif">Reda</font></div>
                      </div>
                      <br>
                      <br>
                      <br>
                      <div class="gmail_quote">On Fri, Mar 2, 2012 at
                        13:16, Daniel-Constantin Mierla <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:daniel@kamailio.org"
                            target="_blank">daniel@kamailio.org</a>&gt;</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"> Hello,
                            <div><br>
                              <br>
                              On 3/2/12 1:01 PM, Marius Zbihlei wrote:
                              <blockquote type="cite"> On 03/02/2012
                                12:44 PM, Reda Aouad wrote:
                                <blockquote type="cite">
                                  <div dir="ltr"><font color="#3366ff"><font><font
                                          face="tahoma,sans-serif">Hi,<br>
                                          <br>
                                          Is there a way to ensure
                                          single-registration per
                                          user-agent for a user, which
                                          overwrites previous
                                          registration ?<br>
                                          Or is there a way to limit the
                                          number of registrations per
                                          user, but overwriting the
                                          earliest registration for each
                                          new one ?<br>
                                          <br clear="all">
                                        </font></font></font></div>
                                </blockquote>
                                Hello, <br>
                                <br>
                                From the registrar module documentation
                                <a moz-do-not-send="true"
href="http://kamailio.org/docs/modules/stable/modules_k/registrar.html#id2494545"
                                  target="_blank">http://kamailio.org/docs/modules/stable/modules_k/registrar.html#id2494545</a><br>
                                <br>
                                3.12. max_contacts (integer)<br>
                                <br>
                                The parameter can be used to limit the
                                number of contacts per AOR (Address of
                                Record) in the user location database.
                                Value 0 disables the check. This
                                parameter can be modified via ser config
                                framework.<br>
                                <br>
                                Default value is 0. <br>
                                <br>
                                But this will not overwrite the previous
                                contact AFAIK.<br>
                              </blockquote>
                            </div>
                            For one contact per user, use save() with
                            flags parameter (value 4):<br>
                            <br>
                            <a moz-do-not-send="true"
href="http://kamailio.org/docs/modules/stable/modules_k/registrar.html#id2497967"
                              target="_blank">http://kamailio.org/docs/modules/stable/modules_k/registrar.html#id2497967</a><br>
                            <br>
                            Cheers,<br>
                            Daniel<br>
                            <br>
                            <blockquote type="cite">
                              <div> <br>
                                Marius<br>
                                <br>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div dir="ltr"><font color="#3366ff"
                                        face="tahoma, sans-serif">Thanks,<br>
                                      </font>
                                      <div><font color="#3366ff"
                                          face="tahoma, sans-serif">Reda</font></div>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                                <br>
                                <pre cols="72">-- 
Zbihlei Marius

Head of
Linux Development Services Romania

1&amp;1 Internet Development srl    Tel KA: 754-9152
Str Mircea Eliade 18            Tel RO: <a moz-do-not-send="true" href="tel:%2B40-31-223-9152" value="+40312239152" target="_blank">+40-31-223-9152</a>
Sect 1, Bucuresti               mailto: <a moz-do-not-send="true" href="mailto:marius.zbihlei@1and1.ro" target="_blank">marius.zbihlei@1and1.ro</a>
71295, Romania
</pre>
                                <br>
                                <fieldset></fieldset>
                                <br>
                              </div>
                              <div>
                                <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" 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>
                              </div>
                            </blockquote>
                          </div>
                          <br>
_______________________________________________<br>
                          SIP Express Router (SER) and Kamailio
                          (OpenSER) - sr-users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:sr-users@lists.sip-router.org"
                            target="_blank">sr-users@lists.sip-router.org</a><br>
                          <a moz-do-not-send="true"
                            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><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
              <span><font color="#888888">
                  <pre cols="72">-- 
Daniel-Constantin Mierla -- <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
  </body>
</html>