xlog("L_INFO", "Setting up channel based credit control");$var(max_chan) = 2;$var(retcode) = cnxcc_set_max_channels("$var(client)", "$var(max_chan)");if ($var(retcode) == -1) {xlog("Error setting up credit control");return;}$var(count) = -1;if (!cnxcc_get_channel_count("$var(client)", "$var(count)")) {xlog("Error getting customer's channel count");}xlog("L_INFO", "CNXCC ROUTE: $var(client) has $var(count) call(s)");if ($var(retcode) < -1) {xlog("Too many channels for customer");sl_send_reply(403, "Forbidden");if (!cnxcc_terminate_all("$var(client)")) {xlog("Error terminating customer's calls");}exit;}
Goodmorning All,
I use the following route to check for concurrent calls by the same user, if a concurrent call is tried it is not allowed.
route[CONCURRENT]
{
xlog("SCRIPT: Conccurrent call check");
if(!get_profile_size("caller","$fu","$avp(nrcalls)"))
{
sl_send_reply("403", "Call not matching profile");
exit;
}
xlog("SCRIPT: caller value for $fu is $avp(nrcalls)");
if($avp(nrcalls)>= 1)
{
sl_send_reply("403", "Active calls limit exceeded");
exit;
}
dlg_manage();
if(!set_dlg_profile("caller","$fu"))
{
sl_send_reply("500", "No new channels in this profile");
exit;
}
xlog("SCRIPT: caller value for $fu is now $avp(nrcalls)");
}
Now I had a situation where a user could not call because the get_profile_size for this user gave the value 1. So another call was not allowed.
But the user did not have a call active. As no dialogs were active, checked that.
I assume there can be a lot of reasons why this happens, also I want to use the “I don’t want to know the cause” method to solve this.
So I looked at the dialog module documentation, to see if I can just clear the profile size for this specific user.
I wanted to use the profile_list_dlgs(8.6) to get the dialog details, then the dlg_terminate_dlg(8.4) to, you guessed it, terminate that dialog.
But it’s not clear to me how I can give those commands….
Is there a way to give those commands on the cli, if so can someone please write down some examples…
Would be really appreciated.
Rgds,
Gertjan
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users