Hello,
What choices do I have to implement a feature to Kamailio which would limit calls per customer?
The environment: Two kamailio nodes sitting in different sites and they are not aware of each others sessions/dialogs and thus serving customer calls independently. Configurations on the nodes are identical excluding ip addresses. Customer call can be routed through either one of these Kam nodes. The two nodes share a common external mysql database from which all dialplan and htable entries are loaded (used in call routing for example). Customers are identified based on IP address & tel numbering and as a final result we are populating an variable which holds the customer id $var(REALM_NAME) when the identification has been done. The call limiting should be "tagged/profiled" somehow with this information if possible.
Any suggestions which way to go with this?
Initial ideas if one of these are worth of setting a starting point: -> Counting calls with htable and replicating with DMQ to other node (can the data survive from a restart?) -> Using the common mysql database to hold the counted calls from where both kam nodes could load data? (database load increasing?) -> Some new exciting module for this job?
Cheers, Olli
Hello,
you could also use dialog profile functionality (single server or also with DMQ sync), also probably also the new dlgs module (single server)
Cheers,
Henning
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Olli Attila Sent: Thursday, November 25, 2021 9:57 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: [SR-Users] Call limiting with Kamailio
Hello,
What choices do I have to implement a feature to Kamailio which would limit calls per customer?
The environment: Two kamailio nodes sitting in different sites and they are not aware of each others sessions/dialogs and thus serving customer calls independently. Configurations on the nodes are identical excluding ip addresses. Customer call can be routed through either one of these Kam nodes. The two nodes share a common external mysql database from which all dialplan and htable entries are loaded (used in call routing for example). Customers are identified based on IP address & tel numbering and as a final result we are populating an variable which holds the customer id $var(REALM_NAME) when the identification has been done. The call limiting should be "tagged/profiled" somehow with this information if possible.
Any suggestions which way to go with this?
Initial ideas if one of these are worth of setting a starting point: -> Counting calls with htable and replicating with DMQ to other node (can the data survive from a restart?) -> Using the common mysql database to hold the counted calls from where both kam nodes could load data? (database load increasing?) -> Some new exciting module for this job?
Cheers, Olli
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions * sr-users@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi,
using dialog or dlg makes your life easier.
-> Counting calls with htable and replicating with DMQ to other node (can the data survive from a restart?)
htable can write back to the database. But that solution needs a bit more (getting the data - manually or via dialog/dlg and replicate that htable, how to work with htable)?
As an untested idea - you can define two htables. One htable_nodeA the other htable_nodeB. Node A writes only into htable_nodeA and vice versa. So there should no race condition. And then you may check htable_nodeA customerX calls and htable_nodeB customerX calls (sum that) on new calls.
Many ways.
Kind regards Karsten
Am Fr., 26. Nov. 2021 um 13:26 Uhr schrieb Henning Westerholt <hw@gilawa.com
:
Hello,
you could also use dialog profile functionality (single server or also with DMQ sync), also probably also the new dlgs module (single server)
Cheers,
Henning
Hi,
DMQ is a good option and you can test if restarting one Kamailio, this kamailio sync the data with the other/s.
DMQ_USRLOC using this logic with parameter sync.
Regards
--- I'm SoCIaL, MayBe
El 26/11/2021 a las 7:38 a. m., Karsten Horsmann escribió:
Hi,
using dialog or dlg makes your life easier.
-> Counting calls with htable and replicating with DMQ to other node (can the data survive from a restart?)
htable can write back to the database. But that solution needs a bit more (getting the data - manually or via dialog/dlg and replicate that htable, how to work with htable)?
As an untested idea - you can define two htables. One htable_nodeA the other htable_nodeB. Node A writes only into htable_nodeA and vice versa. So there should no race condition. And then you may check htable_nodeA customerX calls and htable_nodeB customerX calls (sum that) on new calls.
Many ways.
Kind regards Karsten
Am Fr., 26. Nov. 2021 um 13:26 Uhr schrieb Henning Westerholt hw@gilawa.com:
Hello, you could also use dialog profile functionality (single server or also with DMQ sync), also probably also the new dlgs module (single server) Cheers, Henning
Kamailio - Users Mailing List - Non Commercial Discussions *sr-users@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: *https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users