On Thursday 24 June 2010, Stagg Shelton wrote:
I would like to limit on a subscriber by subscriber
basis the amount of
outgoing calls per second that they can do. I am reading through the
ratelimit module documentation, but haven't been able to determine if I
can use it to limit one particular subscriber outgoing activity. I have
also looked at the pike module, and think that I may be able to use it
in order to limit calls per second by IP. Does anyone have any
recommendations, suggestions, or examples that can be used to control
the calls per second based on the kamailio subscriber name.
Hi Stagg,
another idea to throttle specific/ all customers to a certain load would be to
use the dialog profiles functionality. This would allows you to limit
concurrent dialogs, albeit its more heavywight (on CPU and RAM terms) then the
mentioned modules.
An example (taken from an old mail), limit to two concurrent calls per user:
modparam("dialog","profiles_with_value","caller")
....
/* do some checking */
get_dialog_size("caller","$fu","$avp(cnt)");
if ( $avp(cnt) > 2 ) {
sl_send_reply("403","Not allowed");
exit;
}
set_dlg_profile("caller","$fu");
/* route the call */
Cheers,
Henning