[OpenSIPS-Users] rl_check, limit parameter as a variable

Johan De Clercq johan at democon.be
Fri May 10 02:15:29 EDT 2019


Well, I use very often avp’s to pass values to functions. Hence, for me, migrating a >1500 lines script is quite a hassle:-).

Outlook voor iOS<https://aka.ms/o0ukef> downloaden

________________________________
Van: Users <users-bounces at lists.opensips.org> namens Bogdan-Andrei Iancu <bogdan at opensips.org>
Verzonden: vrijdag, mei 10, 2019 8:12 AM
Aan: Alexey Kazantsev; OpenSIPS users mailling list
Onderwerp: Re: [OpenSIPS-Users] rl_check, limit parameter as a variable

Hi,

Such issues, like (1) the confusion about the type of the value (string
versus int) and (2) the ability to use variables for the function
parameters, were all addressed with 3.0, hopefully making life easier
for people writing OpenSIPS cfgs :).

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Summit 2019
https://www.opensips.org/events/Summit-2019Amsterdam/

On 05/08/2019 07:35 PM, Alexey Kazantsev via Users wrote:
> Hi Ben!
>
> Sure, that was the clue! Thank you.
>
>
> NOT working:
>
> cache_fetch("local", "incoming:ratelimit", $var(rl));
> xlog("L_NOTICE", "cfg_line $cfg_line ; var(rl) is $var(rl)");
> if (!rl_check("pipe_$rU", "$var(rl{s.int})", "SBT")) {
>
> NOT working:
>
> cache_fetch("local", "incoming:ratelimit", $(var(rl){s.int}));
> xlog("L_NOTICE", "cfg_line $cfg_line ; var(rl) is $var(rl)");
> if (!rl_check("pipe_$rU", "$var(rl)", "SBT")) {
>
> NOT working:
>
> cache_fetch("local", "incoming:ratelimit", $var(rl));
> xlog("L_NOTICE", "cfg_line $cfg_line ; var(rl) is $var(rl)");
> $var(rlim) = $(var(rl){s.int});
> if (!rl_check("pipe_$rU", "$var(rl)", "SBT")) {
>
>
> WORKING:
>
> cache_fetch("local", "incoming:ratelimit", $var(rl));
> xlog("L_NOTICE", "cfg_line $cfg_line ; var(rl) is $var(rl)");
> if (!rl_check("pipe_$rU", "$(var(rl){s.int})", "SBT")) {
>
>
> -----------------------------------------------
> BR, Alexey
> http://alexeyka.zantsev.com/
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
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/20190510/99ec00f8/attachment.html>


More information about the Users mailing list