[SR-Users] hanging active dialog...
Carlos Ruiz Díaz
carlos.ruizdiaz at gmail.com
Fri Aug 23 14:37:13 CEST 2013
I don't know what exactly happened in your case but if you don't have time
to investigate you can try cnxcc module [1] channel control to achieve the
same goal.
Take a look at the sample configuration file located in [2]
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;
}
[1] http://kamailio.org/docs/modules/devel/modules/cnxcc.html
[2] https://github.com/caruizdiaz/cnxcc/blob/master/example/kamailio-cnxcc.cfg
Regards,
Carlos
On Fri, Aug 23, 2013 at 5:16 AM, Gertjan Wolzak <g.wolzak at foize.com> wrote:
> ** **
>
> 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 at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
--
Carlos
http://caruizdiaz.com
+595981146623
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130823/561a6b40/attachment-0001.html>
More information about the sr-users
mailing list