Many thanks for your help.
I followed the steps you mentioned for CNXCC. But even after making the max. calls to 0, I am still able to connect the call. Below is the excerpt from kamailio.cfg
.
.
.
#Below lines added by Rahul for Concurrent Call Restriction
route[CNXCC]
{
$var(client1) = "x.y.z.a";
#!ifdef CNXCC_CHANNEL
xlog("L_INFO", "Setting up channel based credit control");
$var(max_chan1) = 0;
$var(retcode) = cnxcc_set_max_channels("$var(client1)", "$var(max_chan)");
if ($var(retcode) == -1) {
xlog("Error setting up credit control");
return;
}
$var(count1) = -1;
if (!cnxcc_get_channel_count("$rd", "$var(count1)")) {
xlog("Error getting customer's channel count");
}
xlog("RAHUL : CNXCC ROUTE: $var(client) has $var(count) call(s)");
xlog("L_INFO", "CNXCC ROUTE: $var(client) has $var(count) call(s)");
if ($var(count1) == $var(max_chan1)) {
xlog("Too many channels for customer");
sl_send_reply(403, "Forbidden");
#if (!cnxcc_terminate_all("$var(client)")) {
# xlog("Error terminating customer's calls");
#}
exit;
}
#!endif