[Kamailio-Users] using dialog to limit concurrent call, and limit monthly limits

mayamatakeshi mayamatakeshi at gmail.com
Sun Apr 12 05:29:56 CEST 2009


On Sat, Apr 11, 2009 at 3:44 PM, Jinsong Hu <jinsong_hu at hotmail.com> wrote:
> 2. people can use a single username/password , but uses it as a trunk, so
> they run multiple channels of voice call . With this they can run up
> thousands of dollars of bills on the kamailio owner. There are suggestion
> that we use dialog module to limit it. However no sample code is given.
> this is a sample code I googled:
>   if ( avp_check("$DLG_count", "gt/i:10") ) {
>      sl_send_reply("403","no more calls accepted");
>      exit;
>   }
> but looks DLG_count is a global  variable. Does any body have a better
> example ?

Hello,
here's an example limiting the number of simultaneous calls for each user:

get_profile_size("caller", "$fu", "$var(SIZE)");
if( $var(SIZE) >= MAX_NUMBER_OF_CALLS ){
	sl_send_reply("503", "Simultaneous calls limit reached");
	exit;
}
set_dlg_profile("caller","$fu");



More information about the Users mailing list