[SR-Users] How to enforce max_contacts at registration?

Olle E. Johansson oej at edvina.net
Tue Aug 16 16:13:46 CEST 2022



> On 16 Aug 2022, at 16:09, Benoit Panizzon <benoit.panizzon at imp.ch> wrote:
> 
> Hi List
> 
> After some more google research and finding this thread
> 
> https://www.mail-archive.com/sr-dev@lists.kamailio.org/msg18728.html
> 
> and some more testing, I think I can conclude that setting 
> 
> $xavp(reg=>max_contacts) = $anyvalue
> 
> is just not working as described in the documentation:
> 
> https://kamailio.org/docs/modules/5.1.x/modules/registrar.html#idp47250596
> 
> So I went ahead and pulled:
> 
> reg_fetch_contacts("location", "$var(saveuri)", "caller")
> to get $(ulc(caller=>count))
> 
> But now I face a new problem: When I get a registration, I don't know
> if this a legitimate update for a existing registration or the insertion
> of a new registration which would exceed the numbers of registration I
> want to allow for that specific AOR.
That’s something that is only handled by SIP outbound with reg-id’s.
Otherwise it’s a SIP-philosophy issue that’s been discussed since RFC 3261
was published…

> 
> Any hint how to solve that challenge or how $xavp(reg=>max_contacts)
> could be made to work as documented?
Limiting the number of contacts and throwing away existing but valid (not expired)
entries only work if you are sure there’s one account per device. If that’s
the case, then save() has an option for you.

If there are multiple devices, then it really doesn’t work. Especially if there are multiple
devices behind the same NAT.

Cheers,
/O




More information about the sr-users mailing list