Resources.DocsTutConcurrentCalls History

Hide minor edits - Show changes to markup

April 24, 2013, at 06:48 PM by 213.233.101.41 -
Changed lines 1-103 from:

Resources -> Documentation -> Tutorials -> Concurrent calls limitation

This page has been visited 1230 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);
	}
}

(:nl:)>>messagehead<<

Ramesh?22 October 2012, 20:35

Prepaid cards do not build your credit and don't corvnet to regular credit cards. Prepaid cards are more like gift cards. You put money on the card and when it's used up, you have to add more.What you need is a secured card you pay a deposit which is held as collateral against the line of credit. You use the card and get a monthly statement and are required to make payments just like a regular credit card. If you use the card and pay in full every month, you should be able to corvnet it to a regular account in about a year.,

(:commentboxchrono:)

to:

(:redirect Documentation.Tutorials-ConcurrentCallsLimitation quiet=1 :)

October 25, 2012, at 10:05 AM by bogdan -
Deleted lines 100-105:

(:nl:)>>messagehead<<

Acil?24 October 2012, 12:00

I thought finding this would be so aruduos but it's a breeze!

October 24, 2012, at 12:00 PM by Acil - Comment added
Added lines 101-106:

(:nl:)>>messagehead<<

Acil?24 October 2012, 12:00

I thought finding this would be so aruduos but it's a breeze!

October 23, 2012, at 03:11 PM by bogdan -
Deleted lines 100-105:

(:nl:)>>messagehead<<

Spidermann?23 October 2012, 00:01

I suppose that snuods and smells just about right.

October 23, 2012, at 12:01 AM by Spidermann - Comment added
Added lines 101-106:

(:nl:)>>messagehead<<

Spidermann?23 October 2012, 00:01

I suppose that snuods and smells just about right.

October 22, 2012, at 08:35 PM by Ramesh - Comment added
Added lines 96-101:

(:nl:)>>messagehead<<

Ramesh?22 October 2012, 20:35

Prepaid cards do not build your credit and don't corvnet to regular credit cards. Prepaid cards are more like gift cards. You put money on the card and when it's used up, you have to add more.What you need is a secured card you pay a deposit which is held as collateral against the line of credit. You use the card and get a monthly statement and are required to make payments just like a regular credit card. If you use the card and pay in full every month, you should be able to corvnet it to a regular account in about a year.,

September 30, 2011, at 12:41 PM by bogdan -
Deleted lines 95-99:

(:nl:)>>messagehead<<

user?29 September 2011, 15:37

what the hell this code does ?

September 29, 2011, at 03:37 PM by user - Comment added
Added lines 95-100:

(:nl:)>>messagehead<<

user?29 September 2011, 15:37

what the hell this code does ?

August 10, 2011, at 08:24 PM by bogdan -
Deleted lines 94-100:

(:nl:)>>messagehead<<

Laneta?10 August 2011, 14:54

Yo, good lkooin out! Gonna make it work now.

August 10, 2011, at 02:54 PM by Laneta - Comment added
Added lines 96-101:

(:nl:)>>messagehead<<

Laneta?10 August 2011, 14:54

Yo, good lkooin out! Gonna make it work now.

May 12, 2011, at 11:29 AM by bogdan -
Deleted line 2:

(:toc-float Table of Content:)

Changed lines 95-99 from:

(:nl:)>>messagehead<<

Elida?11 May 2011, 20:15

Home run! Great slgugnig with that answer!

to:
May 11, 2011, at 08:15 PM by Elida - Comment added
Added lines 96-101:

(:nl:)>>messagehead<<

Elida?11 May 2011, 20:15

Home run! Great slgugnig with that answer!

May 16, 2009, at 09:24 AM by bogdan -
Added lines 10-14:

....

  1. define the profile

modparam("dialog", "profiles_with_value", "caller") ....

March 09, 2009, at 07:33 PM by bogdan -
Added line 2:

This page has been visited 1230 times.

March 03, 2009, at 10:47 AM by bogdan -
Changed lines 87-90 from:

@]

to:

@]


(:commentboxchrono:)

February 06, 2009, at 08:12 PM by 74.228.16.5 -
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 74.228.16.5 -
Changed line 15 from:

@]

to:
Added line 86:

@]

February 06, 2009, at 08:11 PM by 74.228.16.5 -
Changed line 8 from:

[=

to:

[@

Changed line 15 from:

=]

to:

@]

February 06, 2009, at 08:11 PM by 74.228.16.5 -
Added line 8:

[=

Added line 15:

=]

February 06, 2009, at 08:10 PM by 74.228.16.5 -
Changed line 7 from:

[=

to:
Deleted line 83:

=]

February 06, 2009, at 08:09 PM by 74.228.16.5 -
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 74.228.16.5 -
Changed lines 5-82 from:

start

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.

  1. Example route block:
  2. this example should be called before the t_relay() function of an outbound invite
  3. 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);
	}

}

February 06, 2009, at 07:57 PM by 81.180.102.217 -
Added lines 1-5:

Resources -> Documentation -> Tutorials -> Concurrent calls limitation

(:toc-float Table of Content:)


start


Page last modified on April 24, 2013, at 06:48 PM