<div dir="ltr">Hello Razvan,<div>My idea is to keep one registration per device and hence the fc1 option wouldn't work for me here. Meaning the account can register from multiple locations using multiple devices, but if the same device tries to initiate a new register when there is an existing record in the location, I want to remove the existing one and save the new one. <span style="line-height:1.5">Moreover, my clients do not support GRUU and hence thats not the right path for me currently.</span></div><div><span style="line-height:1.5">So here's the idea:</span></div><div><span style="line-height:1.5">1) On a REGISTER request, my clients come with an id that is unique to a device.</span></div><div><span style="line-height:1.5">2) On successful registration, I store in local-cache the contact and callid for this particular device-id.</span></div><div><span style="line-height:1.5">3) For all REGISTER, I check if AOR with callid is registered using the 'registered("location", "AOR", "callid")' function.</span></div><div><span style="line-height:1.5">4) If registered returns true for the current callid, I consider it to be a Re-REGISTER.</span></div><div><span style="line-height:1.5">5) If registered for current callid returns false, I fetch the contact for device_id from local-cache. If the contact exists, meaning the same device is doing a new REGISTER. In this case, I need to remove the existing contact for this AoR.</span></div><div><span style="line-height:1.5">6) This mostly happens when a client is registered and loses connectivity. The client when restarted creates a new registration with new callid without un-registering the existing one on the server.</span></div><div><span style="line-height:1.5">7) The server deletes the device-id from the location on Un-REGISTER. I identify this when Expires header is 0.</span></div><div><br></div><div>Do let me know if this is do-able in a neater way. Thanks in advance.</div><div><br></div><div>- Jayesh</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 17, 2015 at 2:48 PM Răzvan Crainea <<a href="mailto:razvan@opensips.org">razvan@opensips.org</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">
<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 href="http://www.opensips.org/html/docs/modules/2.1.x/registrar.html#id294034" target="_blank">http://www.opensips.org/html/docs/modules/2.1.x/registrar.html#id294034</a><br>
<br>
Best regards,<br>
</tt>
<pre cols="72">Răzvan Crainea
OpenSIPS Solutions
<a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre></div><div bgcolor="#FFFFFF" text="#000000">
<div>On 11/17/2015 08:37 AM, Jayesh Nambiar
wrote:<br>
</div>
</div><div bgcolor="#FFFFFF" text="#000000"><blockquote 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
<<a href="mailto:jayesh1017@gmail.com" target="_blank">jayesh1017@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 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 <<a href="mailto:jayesh1017@gmail.com" target="_blank">jayesh1017@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 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 href="mailto:sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp" target="_blank">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 href="mailto:579e08000@abc.com" target="_blank"><a href="mailto:579e08000@abc.com" target="_blank">579e08000@abc.com</a></a>",
<a href="mailto:sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp" target="_blank">"sip:579e08000@203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp"</a>)</p>
<p>2) <span>remove("location", "sip:</span><a href="mailto:579e08000@abc.com" target="_blank"><a href="mailto:579e08000@abc.com" target="_blank">579e08000@abc.com</a></a>",
"<a 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></fieldset>
<br>
</blockquote></div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite"><pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>