[SR-Users] Is there any way to remove stale registrations before expires time from usrloc ?

Alex Balashov abalashov at evaristesys.com
Mon Sep 14 00:46:28 CEST 2020


Hi,

On 2020-09-11 08:19, sagar malam wrote:

> Hello ,
> I am using the usrloc module to store registrations. I could not find 
> any way to remove stale registrations before expires time. Most of the 
> registrations are mobile app so they wont run in background to save 
> battery of phone hence we end up having lots of registrations in 
> usrloc which were not removed because app was killed in background by OS 
> without letting it send unregister request.

Are you sure that removing such registrations is the best thing to do?

You don't know what the user is going to do; maybe they will be using it 
continuously, or maybe it'll be backgrounded. It's impossible to 
determine, so you can't assume any given registration is stale, and it 
is reasonable to attempt to contact the registrant for any given inbound 
call, even if the attempt is futile because it has gone unreachable.

Meanwhile, the moment the endpoint is "woken up"[1] via a push 
notification, it will re-register and overwrite the stale contact 
binding instead of adding an additional one, provided that the match 
mode[2] is set correctly.

-- Alex

[1] 
https://www.kamailio.org/events/2015-KamailioWorld/Day2/20-Federico.Cabiddu-Kamailio-In-A-Mobile-World.pdf

[2] 
https://kamailio.org/docs/modules/5.4.x/modules/usrloc.html#usrloc.o.contact-matching-algs

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list