[OpenSIPS-Users] New usage for the ratelimit rl_check function

Răzvan Crainea razvan at opensips.org
Fri May 31 09:37:38 CEST 2013


Hi, Ximena!

In 1.7, the *queue* parameter was used to map a queue with a certain SIP 
message. Basically this is no longer needed/supported, since you can do 
this "mapping" directly from the script.
The *pipe* parameter was a static mapping between a "pipe", the 
algorithm used for ratelimiting and the limit. These have been replaced 
by the rl_check() function, which now instead of the index of the pipe, 
receives all the parameters that would have given in the static mapping. 
For example, the following config in 1.7:

modparam("ratelimit", "queue", "0:REGISTER")
modparam("ratelimit", "pipe", "0:TAILDROP:200")

route {
     ...
     rl_check("0");
     ...
}

can be translated something like:

route {
     ...
     if (is_method("REGISTER"))
         rl_check("0", "200", "TAILDROP");
     ...
}

Note that you no longer have a static number of pipes, but rather they 
can be created dynamically during runtime. Simply assinging a different 
name (the first parameter of rl_check function), will result in creating 
a new pipe (at runtime).

I hope my explanations facilitate your migration.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 05/30/2013 08:23 PM, Ximena Velasco Melo wrote:
> Hi all!
> I'm triying to migrate an opensips configuration script from opensips
> 1.4.2 version to the opensips 1.9.1 version.
>
> I have found an issue regarding to the new usage of the *rl_check
> *function in the ratelimit module.
>
> Until opensips 1.7.x version we could use that function easily as follows:
>
>
>       |rl_check([pvar])|
>
> Until 1.7.x opensips version we could  also configure:
>
>
>       |queue| (integer:string)
>
>
>       |pipe| (integer:string:integer)
>
>
> But from opensips 1.8.x version I'm finding a new usage for that function:
>
>
>       |rl_check(name, limit[, algorithm])|
>
> And I can't configure anymore the *queue *and *pipe *parameters.
>
>
> My question is how can I use the new definition of the *rl_check
> *function, since I don't understand where I can save the information
> that I previously saved using the missing queue and pipe parameters, and
> now the function needs more parameters to be used.
>
> Many Thanks!
>
>
>
>
>
> --
> Ximena Velasco Melo
> Ing. Electrónica y de Telecomunicaciones
> Msc. en Ingeniería, Área Telemática
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list