Hello,

just use the appropriate flag in the save function call to restrict it to one:
https://www.kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.save

Cheers,

Henning

-----Original Message-----
From: Roman Dcoz via sr-dev <sr-dev@lists.kamailio.org> 
Sent: Tuesday, August 19, 2025 7:10 AM
To: sr-dev@lists.kamailio.org
Cc: Roman Dcoz <bhavikpatel14...@gmail.com>
Subject: [sr-dev] Restricting max_contacts per transport protocol (UDP vs WSS)

Hello all,

I’m currently using the registrar module and the max_contacts parameter to 
control SIP registrations. However, I see that max_contacts works only as a 
global limit per AOR.

What I would like to achieve is:

For WSS (WebSocket Secure) registrations → allow up to 5 contacts per AOR

For UDP registrations → allow only 1 contact per AOR

In other words, the restriction should not be global, but transport-protocol 
specific.

>From what I understand, registrar only supports a global max_contacts and does 
>not differentiate per-protocol.

My questions are:

Is this possible to implement directly in Kamailio configuration with the 
current modules?

If not, what alternatives or workarounds would you recommend?

e.g. scripting with event routes (event_route[usrloc:contact-added]),

using an external database check,

or extending the registrar module to support per-protocol limits.

Has anyone implemented something similar or is there an existing patch/module 
option that I might have missed?

Thanks in advance for any guidance.
_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org To unsubscribe 
send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to