Thanks Andrew
I added profile_with_value module parameter and with that I am able to overcome this error.
My code looks as below.
dlg_manage();
if (is_method("INVITE")) {
if (!has_totag()) {
#$var(SIZE) = 0;
get_profile_size("caller", "$fu", "$var(SIZE)");
xlog("Number of calls present now is $var(SIZE)\n");
if( $var(SIZE) > MAX_NUMBER_OF_CALLS ) {
sl_send_reply("503", "Simultaneous calls limit reached");
xlog("Rejected calls with 503 Simultaneous calls limit reached\n");
exit;
}
else {
xlog("Allowed call. Looks max calls limit not reached. Calls= $var(SIZE)\n");
}
set_dlg_profile("caller","$fu");
}
}
Whole purpose is to limit number of active calls at any point of time. $var(SIZE) gives the number of calls are being established, but not the number of calls are already established.
So if I am making multiple calls at a point of time, it is blocking call attempts beyond limit. But after all call setup complete, again $var(SIZE) becomes zero and allows new calls.
Has anybody done this (limiting number of calls at any point of time). If so can you please share the configuration file changes.
To get $var(SIZE) working properly, do I need to enable MySql, please advice.
Regards
Austin