<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>I pushed some changes to the master branch trying to get to a
      solution without introducing a new column to store expires value
      for attrs records, but for the next version might be better to
      just add that column and delete using it.</p>
    <p>Try the master branch and see if it works.</p>
    <p>You can also run a rtimer with a delete on condition for last
      modified value, as you already said previously.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 29.07.19 10:16, Pintu Lohar wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAB=mOZSFtH2f2jdZ=HuQjZt49Cai-6gT0WrHqX7OyzhCJLJfiw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Daniel,<br>
        <br>
        It's about the contract expired and deleted from "location" but
        not deleted from location_attr table when expired contact is
        found. My settings are below <br>
        <br>
        1<font face="arial, sans-serif">. <span
            style="background-color:rgb(252,255,252);color:rgb(0,0,0)">modparam("usrloc",
            "timer_interval", 120)<br>
          </span>2. <span style="color:rgb(69,69,69)">modparam("tm|usrloc"</span><span
            style="color:rgb(69,69,69)">, "xavp_contact", "ulattrs")<br>
          </span>3. Usrloc is set to DB_ONLY Mode.  </font><br>
        4. //// route block when the extra location attr before saving
        . <br>
        # Handle SIP registrations<br>
        route[REGISTRAR] {<br>
        if (!is_method("REGISTER")) return;<br>
        <br>
        if(isflagset(FLT_NATS)) {<br>
        setbflag(FLB_NATB);<br>
        #!ifdef WITH_NATSIPPING<br>
        # do SIP NAT pinging<br>
        setbflag(FLB_NATSIPPING);<br>
        #!endif<br>
        }<br>
        <b>$xavp(ulattrs=>did)=$hdr(P-Asserted-Identity); # this adds
          to location_attr table.. </b><br>
        if (!save("location")) {<br>
        sl_reply_error();<br>
        }<br>
        <br>
        <br>
        <br>
        Like if Client Registered , and went offline/crashed,(expiry i.e
        3600, proto=TLS) then contact is expired after 1 hour then it's
        removed from location table but the attribute set which is added
        for location_attr(for same ruid) is not deleted from db.<br>
        Thanks & Regards<br>
        Pintu <br>
        <br>
        <br>
        -----------</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2019 at 4:32
          PM Daniel-Constantin Mierla <<a
            href="mailto:miconda@gmail.com" moz-do-not-send="true">miconda@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 bgcolor="#FFFFFF">
            <p>Hello,</p>
            <p>is the contact expired and not updated, or is about
              attributes set for a REGISTER request that should be
              deleted with the next REGISTER updating the expires for
              same contact?</p>
            <p>Cheers,<br>
              Daniel<br>
            </p>
            <div class="gmail-m_-5655893853785452362moz-cite-prefix">On
              29.07.19 08:44, Pintu Lohar wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <p class="gmail-m_-5655893853785452362gmail-p1">Hi All, </p>
                <p class="gmail-m_-5655893853785452362gmail-p2"><br>
                </p>
                <p class="gmail-m_-5655893853785452362gmail-p1">Regarding modparam("tm|usrloc",
                  "xavp_contact", "ulattrs") </p>
                <p class="gmail-m_-5655893853785452362gmail-p1"><br>
                  <span class="gmail-m_-5655893853785452362gmail-s1"
                    style="color:rgb(228,175,10)">#ref : <a
href="https://www.kamailio.org/docs/modules/devel/modules/usrloc.html#usrloc.p.xavp_contact"
                      target="_blank" moz-do-not-send="true">https://www.kamailio.org/docs/modules/devel/modules/usrloc.html#usrloc.p.xavp_contact</a></span>
                  . <br>
                  <br>
                  There is some requirement where we need to save some
                  extra location attributes to <a
href="https://kamailio.org/docs/db-tables/kamailio-db-4.3.x.html#gen-db-location-attrs"
                    target="_blank" moz-do-not-send="true"><span
                      class="gmail-m_-5655893853785452362gmail-s1"
                      style="color:rgb(228,175,10)">location_attrs</span></a> tables <br>
                  $xavp(ulattrs=>deviceIdentify)= "Some str values"<span
class="gmail-m_-5655893853785452362gmail-Apple-converted-space">  </span>and
                  calling save(“location”) , It works well and saved<span
class="gmail-m_-5655893853785452362gmail-Apple-converted-space">  </span>location
                  attribute table but<span
                    class="gmail-m_-5655893853785452362gmail-Apple-converted-space"> 
                  </span>But when contact expired callback is received,
                  udomain_contact_expired_db() does not it delete the
                  extra location attribute from database but deleting
                  the record from location table only ?<span
                    class="gmail-m_-5655893853785452362gmail-Apple-converted-space"> </span></p>
                <p class="gmail-m_-5655893853785452362gmail-p1"><span
                    class="gmail-m_-5655893853785452362gmail-Apple-converted-space"></span>If
                  not, is there any recommended approach to delete the
                  extra location attributes from the database?<span
                    class="gmail-m_-5655893853785452362gmail-Apple-converted-space"> or
                    am I missing something to set?</span></p>
                <p class="gmail-m_-5655893853785452362gmail-p1"><br>
                  Alternate I was thinking could be running timer from
                  Kamailio config and check last_modified time and
                  delete those(based on our UAC expiry setting), is it
                  the right approach.<br>
                  <br>
                  Kamailio Version: 5.2.0.<br>
                  <br>
                  Thanks for your valuable suggestion in advance.<br>
                  <br>
                  Regards<span
                    class="gmail-m_-5655893853785452362gmail-Apple-converted-space"> </span></p>
                <p class="gmail-m_-5655893853785452362gmail-p1">Pintu
                  Lohar<br>
                </p>
                <span
style="background-color:rgb(252,255,252);color:rgb(0,0,0);font-size:15px"><br>
                  <br>
                  <br>
                  <br>
                </span></div>
              <br>
              <fieldset
                class="gmail-m_-5655893853785452362mimeAttachmentHeader"></fieldset>
              <pre class="gmail-m_-5655893853785452362moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_-5655893853785452362moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a class="gmail-m_-5655893853785452362moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <pre class="gmail-m_-5655893853785452362moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="gmail-m_-5655893853785452362moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a class="gmail-m_-5655893853785452362moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="gmail-m_-5655893853785452362moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a></pre>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<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></pre>
  </body>
</html>