[OpenSIPS-Users] lookup "b" flag - one registration at a time

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Jan 18 15:24:45 CET 2010


Hi Jeff,

Jeff Pyle wrote:
> Iñaki,
>
> On Jan 9, 2010, at 5:00 PM, Iñaki Baz Castillo wrote:
>
>   
>> El Sábado, 9 de Enero de 2010, Jeff Pyle escribió:
>>     
>>> Hello,
>>>
>>> The docs say that when using the "b" flag with lookup() when multiple
>>> records are present, it will load only the one with the highest q.  What
>>> if the q is the same for all?  How does it decide which to use?
>>>       
>> I've not tested it with multiple users sharing same "q". however it should 
>> fetch all the users with highest "q", not just one of them.
>>     
>
> Perhaps I'm asking the wrong question.  I'm looking to allow only one registration per user in the sense that if a second successful registration comes in it will replace tne existing one.  My approach so far is to use a max_contacts=2 and the lookup() function with the "b" flag to retrieve only one. 
maybe without the "b" flag as the "b" flag will return you all the 
registered contacts.
>  max_contacts=1 returns a 503 to the new "replacement" registration request, so that's out.
>
> Perhaps the hot ticket is to run an all-DB mode running a manual mysql query with avp_db_query after successful REGISTER authentication but before the save() so we can remove any existing registrations before the new one is saved.  Thoughts?
>   
No way - the SIP contact matching is much to complicated to do it at DB 
level.


As I found that kind of behaviour was more and more asked by people, I 
will add a new flag "f" to force at save() time the override of the 
existing contacts if the max_contacts() was exceeded.

Regards,
Bogdan
>
> - Jeff
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list