Hey all,
I know Kamailio's registrar module has a max_contacts parameter that will limit the number of active contacts for an AOR. However, is there any mechanism to control what happens when that number is hit?
When using a web client where every page refresh registers a new contact with Kamailio, it would be useful to automatically roll off the oldest registrations and replace to make room for the new ones. I know this can be manually accomplished with sqlops, but I was hoping something like this already existed.
Best, Colin
Wouldn't it be more fruitful to delete and reach old bindings in such a scenario? Or are these bindings not only for web clients?
On December 1, 2016 5:54:06 PM EST, Colin Morelli colin.morelli@gmail.com wrote:
Hey all,
I know Kamailio's registrar module has a max_contacts parameter that will limit the number of active contacts for an AOR. However, is there any mechanism to control what happens when that number is hit?
When using a web client where every page refresh registers a new contact with Kamailio, it would be useful to automatically roll off the oldest registrations and replace to make room for the new ones. I know this can be manually accomplished with sqlops, but I was hoping something like this already existed.
Best, Colin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Hey Alex - not sure I'm quite following what you mean. The bindings are only for web clients. Are you suggesting the clients themselves de-register? I'd have no problem with that with the exception of the fact that there's simply no way to guarantee that happens. It's a race condition between whether the unregistration can be sent before the browser kills the websocket connection on refresh.
On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov abalashov@evaristesys.com wrote:
Wouldn't it be more fruitful to delete and reach old bindings in such a scenario? Or are these bindings not only for web clients?
On December 1, 2016 5:54:06 PM EST, Colin Morelli colin.morelli@gmail.com wrote:
Hey all,
I know Kamailio's registrar module has a max_contacts parameter that will limit the number of active contacts for an AOR. However, is there any mechanism to control what happens when that number is hit?
When using a web client where every page refresh registers a new contact with Kamailio, it would be useful to automatically roll off the oldest registrations and replace to make room for the new ones. I know this can be manually accomplished with sqlops, but I was hoping something like this already existed.
Best, Colin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
right now the rule is to reject the registrations that exceed the max_contacts limit. The main reason behind this policy is the registration mechanism in SIP which requires periodic update/refresh but also different expires intervals.
In this way it's hard to select the "old device". Can be a desktop phone registering every hour and stable connection but also a mobile phone registering every 10 minutes, changing the ip every now and then. By just relying on the oldest registration, the desktop phone is likely the candidate to remove most of the time, but keep other invalid mobile contacts.
The solution would be to use GRUU (or the instance parameter) for registration contacts. In this way each new registration from a device will replace its own old contact, even if it has a different contact address.
Cheers, Daniel
On 01/12/2016 23:59, Colin Morelli wrote:
Hey Alex - not sure I'm quite following what you mean. The bindings are only for web clients. Are you suggesting the clients themselves de-register? I'd have no problem with that with the exception of the fact that there's simply no way to guarantee that happens. It's a race condition between whether the unregistration can be sent before the browser kills the websocket connection on refresh.
On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov <abalashov@evaristesys.com mailto:abalashov@evaristesys.com> wrote:
Wouldn't it be more fruitful to delete and reach old bindings in such a scenario? Or are these bindings not only for web clients? On December 1, 2016 5:54:06 PM EST, Colin Morelli <colin.morelli@gmail.com <mailto:colin.morelli@gmail.com>> wrote: >Hey all, > >I know Kamailio's registrar module has a max_contacts parameter that >will >limit the number of active contacts for an AOR. However, is there any >mechanism to control what happens when that number is hit? > >When using a web client where every page refresh registers a new >contact >with Kamailio, it would be useful to automatically roll off the oldest >registrations and replace to make room for the new ones. I know this >can be >manually accomplished with sqlops, but I was hoping something like this >already existed. > >Best, >Colin > > >------------------------------------------------------------------------ > >_______________________________________________ >SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list >sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> >http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users <http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users> -- Alex -- Principal, Evariste Systems LLC (www.evaristesys.com <http://www.evaristesys.com>) Sent from my Google Nexus. _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users <http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hey Daniel,
This makes sense, thanks for the explanation.
While I can understand why it works the way it does now, I still think having an option here would be great. My thought is, whether the mobile phone that re-registers every 10 minutes or the desk phone is "older," the point is that they're both older than the device which is currently trying to register and is unable to. There's also some preferential logic you could try to add here - perhaps try to remove .invalid contacts first, which are generally used by browsers and likely less stable than contacts with an IP address.
All that said, I appreciate the clarification. I believe it's fairly trivial to do this with sqlops anyway so it's not a huge deal. I also may be able to do something in the edge proxy to automatically send an unregister if a websocket connection closes after a register request.
Thanks! Colin On Mon, Dec 5, 2016 at 6:02 AM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
right now the rule is to reject the registrations that exceed the max_contacts limit. The main reason behind this policy is the registration mechanism in SIP which requires periodic update/refresh but also different expires intervals.
In this way it's hard to select the "old device". Can be a desktop phone registering every hour and stable connection but also a mobile phone registering every 10 minutes, changing the ip every now and then. By just relying on the oldest registration, the desktop phone is likely the candidate to remove most of the time, but keep other invalid mobile contacts.
The solution would be to use GRUU (or the instance parameter) for registration contacts. In this way each new registration from a device will replace its own old contact, even if it has a different contact address.
Cheers, Daniel
On 01/12/2016 23:59, Colin Morelli wrote:
Hey Alex - not sure I'm quite following what you mean. The bindings are only for web clients. Are you suggesting the clients themselves de-register? I'd have no problem with that with the exception of the fact that there's simply no way to guarantee that happens. It's a race condition between whether the unregistration can be sent before the browser kills the websocket connection on refresh.
On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov abalashov@evaristesys.com wrote:
Wouldn't it be more fruitful to delete and reach old bindings in such a scenario? Or are these bindings not only for web clients?
On December 1, 2016 5:54:06 PM EST, Colin Morelli colin.morelli@gmail.com wrote:
Hey all,
I know Kamailio's registrar module has a max_contacts parameter that will limit the number of active contacts for an AOR. However, is there any mechanism to control what happens when that number is hit?
When using a web client where every page refresh registers a new contact with Kamailio, it would be useful to automatically roll off the oldest registrations and replace to make room for the new ones. I know this can be manually accomplished with sqlops, but I was hoping something like this already existed.
Best, Colin
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I didn't try to suggest that what you want won't be useful or rejected if someone wants to contribute. My explanation was for what exists now.
Also, be aware that you can have one contact per device, which is feature controlled differently than the max_contacts -- see save() documentation from registrar module.
Moreover, the usrloc module can delete unreachable contacts (if they don't respond to OPTIONS keepalives). It can also remove contacts that have the associated tcp connection closed (if the devices connect directly to registrar) -- you can implement also your idea of sending notifications from an edge proxy when a tcp connection is closed (see tcpops module for the event_route executed in such case).
Cheers, Daniel
On 05/12/2016 13:33, Colin Morelli wrote:
Hey Daniel,
This makes sense, thanks for the explanation.
While I can understand why it works the way it does now, I still think having an option here would be great. My thought is, whether the mobile phone that re-registers every 10 minutes or the desk phone is "older," the point is that they're both older than the device which is currently trying to register and is unable to. There's also some preferential logic you could try to add here - perhaps try to remove .invalid contacts first, which are generally used by browsers and likely less stable than contacts with an IP address.
All that said, I appreciate the clarification. I believe it's fairly trivial to do this with sqlops anyway so it's not a huge deal. I also may be able to do something in the edge proxy to automatically send an unregister if a websocket connection closes after a register request.
Thanks! Colin On Mon, Dec 5, 2016 at 6:02 AM Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello, right now the rule is to reject the registrations that exceed the max_contacts limit. The main reason behind this policy is the registration mechanism in SIP which requires periodic update/refresh but also different expires intervals. In this way it's hard to select the "old device". Can be a desktop phone registering every hour and stable connection but also a mobile phone registering every 10 minutes, changing the ip every now and then. By just relying on the oldest registration, the desktop phone is likely the candidate to remove most of the time, but keep other invalid mobile contacts. The solution would be to use GRUU (or the instance parameter) for registration contacts. In this way each new registration from a device will replace its own old contact, even if it has a different contact address. Cheers, Daniel On 01/12/2016 23:59, Colin Morelli wrote:
Hey Alex - not sure I'm quite following what you mean. The bindings are only for web clients. Are you suggesting the clients themselves de-register? I'd have no problem with that with the exception of the fact that there's simply no way to guarantee that happens. It's a race condition between whether the unregistration can be sent before the browser kills the websocket connection on refresh. On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov <abalashov@evaristesys.com <mailto:abalashov@evaristesys.com>> wrote: Wouldn't it be more fruitful to delete and reach old bindings in such a scenario? Or are these bindings not only for web clients? On December 1, 2016 5:54:06 PM EST, Colin Morelli <colin.morelli@gmail.com <mailto:colin.morelli@gmail.com>> wrote: >Hey all, > >I know Kamailio's registrar module has a max_contacts parameter that >will >limit the number of active contacts for an AOR. However, is there any >mechanism to control what happens when that number is hit? > >When using a web client where every page refresh registers a new >contact >with Kamailio, it would be useful to automatically roll off the oldest >registrations and replace to make room for the new ones. I know this >can be >manually accomplished with sqlops, but I was hoping something like this >already existed. > >Best, >Colin > > >------------------------------------------------------------------------ > >_______________________________________________ >SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list >sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> >http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Alex -- Principal, Evariste Systems LLC (www.evaristesys.com <http://www.evaristesys.com>) Sent from my Google Nexus. _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com <http://www.kamailioworld.com> _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users