Resources.DocsTutConcurrentCalls HistoryHide minor edits - Show changes to markup April 24, 2013, at 06:48 PM
by -
Changed lines 1-103 from:
Resources -> Documentation -> Tutorials -> Concurrent calls limitationThis page has been visited 573 times. Using the new 'dialog' module released with the upcoming 1.5x branch, it is now possible to easily impose channel limits within existing routing configurations. The example included below is a sample route block that integrates outbound channel limits with call control prepaid account support. Note that the example requires an AVP variable 'channels' to be set as user preference and can be adapted for both outbound and inbound channel limits using the existing profile architecture of the dialog module.
....
# define the profile
modparam("dialog", "profiles_with_value", "caller")
....
# Example route block:
# this example should be called before the t_relay() function of an outbound invite
#
########################################################################
# Request route 'callcontrol' with channel limit
########################################################################
route[39]
{
## have we done our checking on this call?
if(!isflagset(31))
{
# user has max channel limit set as preference
if(is_avp_set("$avp(s:channels)/n") && avp_check("$avp(s:channels)", "gt/i:0"))
{
# get current calls for uuid
get_profile_size("caller","$avp(s:caller_uuid)","$var(calls)");
# check within limit
if($avp(s:channels) > $var(calls))
{
xlog("L_INFO", "Call control: user '$avp(s:caller_uuid)' currently has
'$var(calls)' of '$avp(s:channels)' active calls before this one\n");
$var(setprofile) = 1;
}
else
{
xlog("L_INFO", "Call control: user channel limit exceeded [$var(calls)/$avp(s:channels)]\n");
send_reply("487", "Request Terminated: Channel limit exceeded\n");
exit;
}
}
else
{
$var(setprofile) = 0;
}
call_control();
switch ($retcode)
{
case 2:
# Call with no limit
case 1:
# Call with a limit under callcontrol management (either prepaid or postpaid)
break;
case -1:
# Not enough credit (prepaid call)
xlog("L_INFO", "Call control: not enough credit for prepaid call\n");
acc_rad_request("402");
sl_send_reply("402", "Not enough credit");
exit;
break;
case -2:
# Locked by call in progress (prepaid call)
xlog("L_INFO", "Call control: prepaid call locked by another call in progress\n");
acc_rad_request("403");
sl_send_reply("403", "Call locked by another call in progress");
exit;
break;
default:
# Internal error (message parsing, communication, ...)
xlog("L_INFO", "Call control: internal server error\n");
acc_rad_request("500");
sl_send_reply("500", "Internal server error");
exit;
}
if($var(setprofile) > 0)
{
create_dialog();
set_dlg_profile("caller","$avp(s:caller_uuid)");
}
## mark checking done
setflag(31);
}
}
Ramesh? — 22 October 2012, 20:35(:commentboxchrono:) to:
(:redirect Documentation.Tutorials-ConcurrentCallsLimitation quiet=1 :) October 25, 2012, at 10:05 AM
by -
Deleted lines 100-105:
October 24, 2012, at 12:00 PM
by - Comment added
Added lines 101-106:
October 23, 2012, at 03:11 PM
by -
Deleted lines 100-105:
(:nl:)>>messagehead<< Spidermann? — 23 October 2012, 00:01October 23, 2012, at 12:01 AM
by - Comment added
Added lines 101-106:
(:nl:)>>messagehead<< Spidermann? — 23 October 2012, 00:01October 22, 2012, at 08:35 PM
by - Comment added
Added lines 96-101:
September 30, 2011, at 12:41 PM
by -
Deleted lines 95-99:
September 29, 2011, at 03:37 PM
by - Comment added
Added lines 95-100:
August 10, 2011, at 08:24 PM
by -
Deleted lines 94-100:
August 10, 2011, at 02:54 PM
by - Comment added
Added lines 96-101:
May 12, 2011, at 11:29 AM
by -
Deleted line 2:
(:toc-float Table of Content:) Changed lines 95-99 from:
to:
May 11, 2011, at 08:15 PM
by - Comment added
Added lines 96-101:
May 16, 2009, at 09:24 AM
by -
Added lines 10-14:
....
modparam("dialog", "profiles_with_value", "caller") .... March 09, 2009, at 07:33 PM
by -
Added line 2:
This page has been visited 573 times. March 03, 2009, at 10:47 AM
by -
Changed lines 87-90 from:
@] to:
@] (:commentboxchrono:) February 06, 2009, at 08:12 PM
by -
Changed lines 30-31 from:
xlog("L_INFO", "Call control: user '$avp(s:caller_uuid)' currently has '$var(calls)' of '$avp(s:channels)' active calls before this one\n");
to:
xlog("L_INFO", "Call control: user '$avp(s:caller_uuid)' currently has
'$var(calls)' of '$avp(s:channels)' active calls before this one\n");
February 06, 2009, at 08:11 PM
by -
Changed line 15 from:
@] to:
Added line 86:
@] February 06, 2009, at 08:11 PM
by -
Changed line 8 from:
[= to:
[@ Changed line 15 from:
=] to:
@] February 06, 2009, at 08:11 PM
by -
Added line 8:
[= Added line 15:
=] February 06, 2009, at 08:10 PM
by -
Changed line 7 from:
[= to:
Deleted line 83:
=] February 06, 2009, at 08:09 PM
by -
Changed lines 5-6 from:
Using the new 'dialog' module released with the upcoming 1.5x branch, it is now possible to easily impose channel limits within existing routing configurations. The example included below is a sample route block that integrates outbound channel limits with call control prepaid account support. Note that the example requires an AVP variable 'channels' to be set as user preference and can be adapted for both outbound and inbound channel limits using the existing profile architecture of the dialog module. to:
Using the new 'dialog' module released with the upcoming 1.5x branch, it is now possible to easily impose channel limits within existing routing configurations. The example included below is a sample route block that integrates outbound channel limits with call control prepaid account support. Note that the example requires an AVP variable 'channels' to be set as user preference and can be adapted for both outbound and inbound channel limits using the existing profile architecture of the dialog module.
[= Added line 84:
=] February 06, 2009, at 08:04 PM
by -
Changed lines 5-82 from:
startto:
Using the new 'dialog' module released with the upcoming 1.5x branch, it is now possible to easily impose channel limits within existing routing configurations. The example included below is a sample route block that integrates outbound channel limits with call control prepaid account support. Note that the example requires an AVP variable 'channels' to be set as user preference and can be adapted for both outbound and inbound channel limits using the existing profile architecture of the dialog module.
route[39] { ## have we done our checking on this call?
if(!isflagset(31))
{
# user has max channel limit set as preference
if(is_avp_set("$avp(s:channels)/n") && avp_check("$avp(s:channels)", "gt/i:0"))
{
# get current calls for uuid
get_profile_size("caller","$avp(s:caller_uuid)","$var(calls)");
# check within limit
if($avp(s:channels) > $var(calls))
{
xlog("L_INFO", "Call control: user '$avp(s:caller_uuid)' currently has '$var(calls)' of '$avp(s:channels)' active calls before this one\n");
$var(setprofile) = 1;
}
else
{
xlog("L_INFO", "Call control: user channel limit exceeded [$var(calls)/$avp(s:channels)]\n");
send_reply("487", "Request Terminated: Channel limit exceeded\n");
exit;
}
}
else
{
$var(setprofile) = 0;
}
call_control();
switch ($retcode)
{
case 2:
# Call with no limit
case 1:
# Call with a limit under callcontrol management (either prepaid or postpaid)
break;
case -1:
# Not enough credit (prepaid call)
xlog("L_INFO", "Call control: not enough credit for prepaid call\n");
acc_rad_request("402");
sl_send_reply("402", "Not enough credit");
exit;
break;
case -2:
# Locked by call in progress (prepaid call)
xlog("L_INFO", "Call control: prepaid call locked by another call in progress\n");
acc_rad_request("403");
sl_send_reply("403", "Call locked by another call in progress");
exit;
break;
default:
# Internal error (message parsing, communication, ...)
xlog("L_INFO", "Call control: internal server error\n");
acc_rad_request("500");
sl_send_reply("500", "Internal server error");
exit;
}
if($var(setprofile) > 0)
{
create_dialog();
set_dlg_profile("caller","$avp(s:caller_uuid)");
}
## mark checking done
setflag(31);
}
} February 06, 2009, at 07:57 PM
by -
Added lines 1-5:
Resources -> Documentation -> Tutorials -> Concurrent calls limitation(:toc-float Table of Content:) start |
