Thanks Daniel for the suggestions. To make the script manageable, I am thinking of implementing last option.<div>Have another flag to &quot;save&quot;. May be 0x8?</div><div><br></div><div>We will still use max_contacts = 2 in mod params.</div>
<div>And when the save(&quot;location&quot;, &quot;0x08&quot;) is called, the oldest contact is removed and the new contact is</div><div>added. This can apply to any number of max_contacts...</div><div><br></div><div>This way everything else remains the same.</div>
<div><br></div><div>Krish Kura<br><br><div class="gmail_quote">On Sat, Mar 24, 2012 at 3:48 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">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">
Hello,<div><div class="h5"><br>
<br>
On 3/23/12 3:21 PM, Krishna Kurapati wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Is there a way to set up maximum of 2 active roll over contacts per user? Currently when I setup max contacts param as 2,<br>
The third one is responding with 503 error for 3rd Register. How can we remove one of the contacts and replace it with the<br>
new one.<br>
<br>
I need it when the device is switching over from Wifi to 3G and back. or Wifi network to Wifi network switching.<br>
</blockquote></div></div>
the master branch support setting number of contacts per registration, but it is the old fashion of rejecting new contacts.<br>
<br>
Some ideas coming in my mind, not sure if all get to a proper solution:<br>
- play with two tables for usrloc, like location1 and location2, each with save(...) last registration and you do round robing with the registration (use htable to keep which location table to use next). Then do lookup/append_branch over the table one, revert the uri and do lookup over the second table -- combine these operations as you need<br>

- use database mode only and then sqlops to remove entries that are no longer useful for you. defining location table in memory (possible with mysql), gives you good performances<br>
<br>
Of course, an extension to c code to have such functionality would be another option, contributions will be accepted as usual.<br>
<br>
Cheers,<br>
Daniel<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Daniel-Constantin Mierla<br>
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany<br>
<a href="http://www.asipto.com/index.php/kamailio-advanced-training/" target="_blank">http://www.asipto.com/index.<u></u>php/kamailio-advanced-<u></u>training/</a><br>
<br>
</font></span></blockquote></div><br></div>