<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">That requires a bit more of reading the same doc page, but I still think you can do it.<div class=""><br class=""></div><div class="">Run reg_fetch_contacts and check how many you have. Loop through them and unregister by the ruri (id) of the one that expires first</div><div class="">if you have too many.</div><div class=""><br class=""></div><div class="">We’ve made this function to make the location database handling very transparent to the script writer that wants to go beyond </div><div class="">the ordinary and do some fun scripting :-)</div><div class=""><br class=""></div><div class=""><a href="http://kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.reg_fetch_contacts" class="">http://kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.reg_fetch_contacts</a></div><div class=""><a href="http://kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.unregister" class="">http://kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.unregister</a></div><div class=""><br class=""></div><div class="">Kamailio is cool, isn’t it? :-)</div><div class=""><br class=""></div><div class="">/O</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 01 Apr 2016, at 22:18, Bruno Emer <<a href="mailto:brunoemer@gmail.com" class="">brunoemer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">This is my problem... I want to have 2 contacts for AOR, and not only one. <div class=""><br class=""></div><div class="">When the 3rd arrives, it must remove the oldest and continue with 2...<br class=""><div class="gmail_extra"><br clear="all" class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class="">If I am using the 0x04 parameter, it will save just one contact, and the user will not be able to get the Invite both, in the mobile device and web interface.</u></strong></font></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class=""><br class=""></u></strong></font></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class="">Bruno Emer</u></strong></font></span></div><div class=""><font color="#00a1e6" style="font-size:small;font-family:sans-serif" class=""><br class=""></font></div><div class="">Mobile: <a href="tel:%2B55%2011%2096540-0044" value="+5511965400044" target="_blank" class="">+55 11 96540-0044</a> </div><div class="">email: <a href="mailto:brunoemer@gmail.com" target="_blank" class="">brunoemer@gmail.com</a></div><div class=""><span style="font-family: Helvetica, Arial, sans-serif;" class=""></span><div style="font-family: Helvetica, Arial, sans-serif; margin-top: 5px;" class=""><a href="https://www.facebook.com/bruno.emer.5" style="font-size:small;outline:none" target="_blank" class=""><img src="http://images.wisestamp.com/facebook.png" width="16" style="border:none" class=""></a><span style="font-size:small" class=""> </span><a href="https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic" style="font-size:small;outline:none" target="_blank" class=""><img src="http://images.wisestamp.com/linkedin.png" width="16" style="border:none" class=""></a><span style="font-size:small" class=""> </span><a href="https://twitter.com/brunoemer_" style="font-size:small;outline:none" target="_blank" class=""><img src="http://images.wisestamp.com/twitter.png" width="16" style="border:none" class=""></a><span style="font-size:small" class=""> </span><a href="https://www.flickr.com/photos/122070309@N03/" style="font-size:small;outline:none" target="_blank" class=""><img src="http://images.wisestamp.com/flickr.png" width="16" style="border:none" class=""></a><span style="font-size:small" class=""> </span><a href="http://google.com/+BrunoEmer" style="font-size:small;outline:none" target="_blank" class=""><img src="http://images.wisestamp.com/googleplus.png" width="16" style="border:none" class=""></a><span style="font-size:small" class=""> </span><a href="http://instagram.com/brunoemer_" style="font-size:small;outline:none" target="_blank" class=""><img src="http://images.wisestamp.com/instagram.png" width="16" style="border:none" class=""></a></div></div></div></div></div>
<br class=""><div class="gmail_quote">2016-04-01 17:07 GMT-03:00 Bruno Emer <span dir="ltr" class=""><<a href="mailto:brunoemer@gmail.com" target="_blank" class="">brunoemer@gmail.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hello, <i style="font-family: Times; font-size: inherit;" class="">Olle!</i><div class=""><font face="Times" size="3" class=""><i class=""><br class=""></i></font></div><div class=""><font face="Times" size="3" class=""><i class="">Thanks for your help in this case, and don't worry about the time (actually I wasn't even expecting to get an answer today).</i></font></div><div class=""><font face="Times" size="3" class=""><i class=""><br class=""></i></font></div><div class=""><font face="Times" size="3" class=""><i class="">I know the max_contacts parameter. But the problem is that if I set the max_contacts to 2, when the user tries to register again, he gets an error message 503. The point is that I want to get the user registered, and replace the oldest location entry for the newest one.<br class=""></i></font><div class="gmail_extra"><span class=""><br clear="all" class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class=""><br class=""></u></strong></font></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class=""><br class=""></u></strong></font></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class="">Bruno Emer</u></strong></font></span></div><div class=""><font color="#00a1e6" style="font-size:small;font-family:sans-serif" class=""><br class=""></font></div><div class="">Mobile: <a href="tel:%2B55%2011%2096540-0044" value="+5511965400044" target="_blank" class="">+55 11 96540-0044</a> </div><div class="">email: <a href="mailto:brunoemer@gmail.com" target="_blank" class="">brunoemer@gmail.com</a></div><div class=""><span style="font-family: Helvetica, Arial, sans-serif;" class=""></span><div style="font-family: Helvetica, Arial, sans-serif; margin-top: 5px;" class=""><br class=""></div></div></div></div></div></span><div class=""><div class=""><div class="gmail_quote">2016-04-01 16:31 GMT-03:00 Bruno Emer <span dir="ltr" class=""><<a href="mailto:brunoemer@gmail.com" target="_blank" class="">brunoemer@gmail.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class="">Hello all.<div class=""><br class=""></div><div class="">I have problem here and I tried to find a solution and search over internet, but without success.</div><div class=""><br class=""></div><div class="">My scenario is the following: I have an application that must be registered in Kamailio when a user logs in the web interface, so he can get calls (something like a web softphone using webrtc). At this point, we are OK, and everything is working fine.</div><div class=""><br class=""></div><div class="">To get these register functions I am using the parameter "save("location", "0x04")" as described in the REGISTRAR module documentation, so if a user logs in another web browser or computer, only the last one will continue registered and all calls will be forwarded to him.</div><div class=""><br class=""></div><div class="">The point is that now we are creating a phone app that will do almost the same thing as the web interface, allowing users to receive calls using the mobile device, and here is my problem: I want to allow my users to be registered on two devices at the same time, but if a user logs into another device, I don't want to reply with a 503. I want to allow the user to register again, deregistering the oldest contact.</div><div class=""><br class=""></div><div class="">I saw that there is a module named "<span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:1.125em;line-height:1.2" class="">ims_usrloc_scscf" and on its description it says "</span><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:19.6px" class="">implemented overwrite oldest contact behaviour", but I couldn't find any documentation about it.</span></div><div class=""><span style="font-size:14px;line-height:19.6px;font-weight:normal" class=""><br class=""></span></div><div class=""><span style="font-size:14px;line-height:19.6px;font-weight:normal" class="">So, is there a way to get this working today?</span></div><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class=""><br class=""></u></strong></font></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class=""><br class=""></u></strong></font></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font size="2" class=""><strong style="font-family:Arial" class=""><u class="">Bruno Emer</u></strong></font></span></div><div class=""><font color="#00a1e6" style="font-size:small;font-family:sans-serif" class=""><br class=""></font></div><div class="">Mobile: <a href="tel:%2B55%2011%2096540-0044" value="+5511965400044" target="_blank" class="">+55 11 96540-0044</a> </div><div class="">email: <a href="mailto:brunoemer@gmail.com" target="_blank" class="">brunoemer@gmail.com</a></div></div></div></div>
</div></div>
</blockquote></div><br class=""></div></div></div></div></div>
</blockquote></div><br class=""></div></div></div>
_______________________________________________<br class="">SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br class=""><a href="mailto:sr-users@lists.sip-router.org" class="">sr-users@lists.sip-router.org</a><br class="">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br class=""></div></blockquote></div><br class=""></div></body></html>