[OpenSIPS-Users] Getting RateLimit Config From Database
Răzvan Crainea
razvan at opensips.org
Tue Nov 7 04:04:32 EST 2017
Hi, Alexander!
You can pull the limits per user either by using the load_credentials
mechanism[1], which automatically pulls user information after
authentication, or by doing a "manual" DB query using the avp_db_query()
function[2]. After you have the limit value in an AVP, you can pass that
pseudo-variable to the rl_check() function[3].
[1] http://www.opensips.org/html/docs/modules/2.4.x/auth_db#idp5578480
[2] http://www.opensips.org/html/docs/modules/2.4.x/avpops.html#idp5619104
[3] http://www.opensips.org/html/docs/modules/2.4.x/ratelimit#idp5577136
Best regards,
Răzvan Crainea
OpenSIPS Developer
www.opensips-solutions.com
On 11/07/2017 03:35 AM, Alexander Perkins wrote:
> Hi All. I have been researching OpenSIPs for quite some time now and
> have implemented a deployment successfully with it. However, I was
> never able to successfully pull the RateLimit configuration from a
> database. For example, if I want to limit a SIP client to only one
> call per second and have that information pull from MySQL, how would I
> do that? I have tried searching Google, but cannot find much
> information. If I cannot pull it in from MySQL, can I reload the
> RateLimit config without restarting OpenSIPs?
>
> Any help is appreciated,
> Alex
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171107/19fb5613/attachment.html>
More information about the Users
mailing list