Documentation

Documentation.Tutorials-ConcurrentCallsLimitation History

Hide minor edits - Show changes to markup

May 16, 2013, at 06:09 PM by 109.99.235.212 -
Changed line 1 from:
to:
Documentation -> Tutorials -> Concurrent calls limitation
Changed line 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.

May 09, 2013, at 02:03 PM by 79.118.227.150 -
Added line 2:

Changed line 4 from:

to:
May 09, 2013, at 02:02 PM by 79.118.227.150 -
Changed line 1 from:

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

to:
Changed line 103 from:

(:commentboxchrono:)

to:

(:commentboxchrono:)

April 24, 2013, at 06:47 PM by 213.233.101.41 -
Added lines 1-103:

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

This page has been visited 3811 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:)


Page last modified on May 16, 2013, at 06:09 PM