[SR-Users] Call limit through shared database

Henning Westerholt hw at skalatan.de
Tue Oct 1 17:13:11 CEST 2019


Hi Joel,

Thank you, I was reading it yesterday. See this issue https://github.com/kamailio/kamailio/issues/2080#issue-499544483 – in my tests the proxies will expire the dialogs even after a restart. I just tested it again even restarting both proxies a few times.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Joel Serrano
Sent: Tuesday, October 1, 2019 4:35 PM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>; miconda at gmail.com
Subject: Re: [SR-Users] Call limit through shared database

Found it:

https://github.com/kamailio/kamailio/issues/1591#issuecomment-409205552

On Tue, Oct 1, 2019 at 07:15 Joel Serrano <joel at textplus.com<mailto:joel at textplus.com>> wrote:
Just a note, I would suggest to use htable+dmq to  do such limits, dialog+dmq has some issues when handling dialog expiration when a node for whatever reason is restarted.. (search GH issues and you will find one with a long thread where Charles explains the reasons: TL;DR: You could  end up having inconsistent dialog information with dialog+dmq)

Hope it helps!
Joel.

On Tue, Oct 1, 2019 at 01:02 Daniel-Constantin Mierla <miconda at gmail.com<mailto:miconda at gmail.com>> wrote:

On 30.09.19 14:55, Daniel Tryba wrote:
> On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
>> modparam("dialog", "profiles_with_value", "concurrent_calls")
>> modparam("dialog", "dlg_flag", 4)
>> modparam("dialog", "db_url", DBURL)
>> modparam("dialog", "db_mode", 1)
>
> Have you tested with a lower value of
> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period


The update_period should have no impact when db_mode=1 -- in this case
the records are written to database immediately. I think update_period
is intended only for db_mode=2.

Cheers,
Daniel


> I have it set to 5, but for some reason I'm not using get_profile_size
>
> For inbound:
> $var(maxchannels) = 0;
> sql_xquery("ca", "select count(id) as c from dialog where xdata like '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> For outbound:
> sql_xquery("ca", "select count(id) as c from dialog where xdata like '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> Pasting the code here I see this isn't that secure since a user foo also
> gets the number of calls for foobar counted against him! Off to put a "
> before/after the username.
>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla -- www.asipto.com<http://www.asipto.com>
www.twitter.com/miconda<http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda<http://www.linkedin.com/in/miconda>
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191001/650b8ee5/attachment.html>


More information about the sr-users mailing list