<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi, Jayesh!<br>
      <br>
      If I understood correctly, you only want to have a single contact
      in memory, right? If so, you can use the save[1] function, with
      flags c and f. Something like:<br>
      <br>
      save("location", "fc1");<br>
      <br>
      [1]
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.1.x/registrar.html#id294034">http://www.opensips.org/html/docs/modules/2.1.x/registrar.html#id294034</a><br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 11/17/2015 08:37 AM, Jayesh Nambiar
      wrote:<br>
    </div>
    <blockquote
cite="mid:CANAYozu1YFaqyMw_4Ustc4dpZKrWAVu9wQ76ZpSHWYLYU+16sw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello All,
        <div>Just bumping in to check if there's a better way to remove
          an existing contact from the location. My idea was to remove
          from the location a record with particular callid or
          particular contact on specific scenarios. So I do the
          following:</div>
        <div>On a successful registration I store the some id that my
          device has along with callid and contact. </div>
        <div>On a subsequent registration, I compare the id and callid,
          if they are different from the current registration, I need to
          remove the existing contact with this callid</div>
        <div>If the id and callid is same, I do nothing.</div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div><br>
        </div>
        <div>- Jayesh</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Tue, Nov 10, 2015 at 6:59 PM Jayesh Nambiar
          &lt;<a moz-do-not-send="true"
            href="mailto:jayesh1017@gmail.com">jayesh1017@gmail.com</a>&gt;
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">Forgot to mention. I'm using version 2.1.
            <div><br>
            </div>
            <div>Thanks,</div>
            <div><br>
            </div>
            <div>- Jayesh</div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr">On Tue, Nov 10, 2015 at 6:01 PM Jayesh
              Nambiar &lt;<a moz-do-not-send="true"
                href="mailto:jayesh1017@gmail.com" target="_blank">jayesh1017@gmail.com</a>&gt;
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">Hello,
                <div>I've been trying to delete specific contact for AOR
                  using the remove function in the registrar module, but
                  somehow it doesn't remove it from the location.</div>
                <div>My db_mode is 0 as I only want to store it in
                  opensips memory. I hav the "use_domain" param as 1. On
                  register, the contact gets stored in the following
                  format:</div>
                <div>
                  <p><span><a class="moz-txt-link-abbreviated" href="mailto:sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp">sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp</a></span></p>
                  <p><span>I tried multiple ways to remove this:</span></p>
                  <p><span>1) remove("location", "sip:</span><a
                      moz-do-not-send="true"
                      href="mailto:579e08000@abc.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:579e08000@abc.com">579e08000@abc.com</a></a>",
<a class="moz-txt-link-rfc2396E" href="mailto:sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp">"sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp"</a>)</p>
                  <p>2) <span>remove("location", "sip:</span><a
                      moz-do-not-send="true"
                      href="mailto:579e08000@abc.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:579e08000@abc.com">579e08000@abc.com</a></a>",
                    "<a moz-do-not-send="true"
                      href="http://sip:579e08000@203.153.53.130:49612"
                      target="_blank">sip:579e08000@203.153.53.130:49612</a>")</p>
                  <p>Also, I'd like to mention that I have an edge proxy
                    in the middle who proxies the REGISTER to this
                    Registrar and I use the PATH module to route back
                    reliably. I'm essentially trying to remove location
                    entry for particular endpoints based on some
                    conditions.</p>
                  <p>Any help is appreciated. Thanks,</p>
                  <p>- Jayesh</p>
                </div>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </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>