[SR-Users] Rate Limiting with Kamailio

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 15 16:23:50 CEST 2014


Hello,

On 14/08/14 18:49, AliReza Khoshgoftar Monfared wrote:
> Hi list,
>
> A quick question,
>
> What is the best way to limit the rate of the kamailio,
> Say I want it to process only 200 INVITEs per second
>
> I know this can be done using ratelimit module, but what if I want to 
> change this rate dynamically? say, in an overload control scenario, I 
> am getting a recommended rate piggybacked in my replies, and I read 
> it, then how can I change the messge processing rate of kamailio in 
> runtime inside my script?
>
> Is there a way to change the rate using ratelimit but inside script as 
> messages come?
>
> The RPC function (rl.set_pipe) does it, but can I call it inside my 
> script?
you can use exec module to execute an external command (kamctl ... or 
kamcmd ...). Also, utils or some embedded interpreter can be used to 
make http requests (to xmlrpc).

On the other hand, pipelimit (which is intended to be more dynamic), got 
the option to define pipes dinammicaly. Adding support to change the 
limit should be easy -- I will look into it if nobody else sends a patch 
meanwhile (and could be better to add a feature request on tracker, not 
to forget about it) -- however, it is only in devel version.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA




More information about the sr-users mailing list