Hi, OK, thanks for the clarification. Maybe we will check the load_db_contacts("userid") way with Victor.
Regards, Andrew
On 09/15/2014 12:04 PM, Daniel-Constantin Mierla wrote:
Hello,
On 12/09/14 15:42, Andrew Pogrebennyk wrote:
Hi, let's say I'm running two proxies/registrars that need to access Shared location DB in db_mode=1 (all changes to usrloc are immediately reflected in database too). I have observed that if the UAC re-registers before the previous registration's expiry and the new REGISTER reaches the other proxy than the one that processed the registration originally, this new proxy is going to insert the second record for the same username into location table instead of updating the existing registration.
I assume the problem is the ruid calculation,
if the proxy doesn't have the record in memory, it will not matter if it is with same ruid or not, it will create a new record. If it is the same ruid, it will be a failure when inserting in database, not updating it there, leaving the old record in place.
Also, even if this one will overwrite in database, the other proxy will still have in memory and will route calls to it.
Alex mentioned in a separate email the db only mode - that could be a solution.
Also, you can try deleting the record from db via sqlops based on username, domain, contact uri if the registered() returns false for that user, before doing save().
If looking at writing C code to get it done, maybe it can be achieved with a new function to load_db_contacts("userid") to be called before save().
Back on ruid, just for sake of clarifications, by the way ruid is generated, is unlikely to get it the same across many systems, because it uses pid and local counters.
Cheers, Daniel