<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Hi,<br>
<br>
Before the channel limit test, print via xlog the value you loaded
(the limit) and the current size (from profile). See what you get
there for your calls.<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 10/23/2012 11:43 AM, Engineer voip wrote:
<blockquote
cite="mid:CAA-=Tf_piJPtQET4ECM_ksx5FYU_-F=K=RM29C1vACxS54_d3w@mail.gmail.com"
type="cite">Hi,<br>
I'm trying to limit a calls of an user by using the script above <br>
<br>
route[39]<br>
{<br>
if(!isflagset(31))<br>
{<br>
if( avp_db_load("$fu/username","a") &&
avp_check("$avp(channels)", "ge/0"))<br>
{<br>
# get current calls for user<br>
get_profile_size("caller","$fu","$var(calls)");<br>
<br>
# check within limit<br>
if($avp(channels) > $var(calls))<br>
{<br>
xlog("L_INFO", "Call control: user
'$fU' currently has '$var(calls)' of '$avp(channels)' active calls
before this one\n");<br>
$var(setprofile) = 1;<br>
}<br>
else<br>
{<br>
xlog("L_INFO", "Call control: user
channel limit exceeded [$var(calls)/$avp(channels)]\n");<br>
send_reply("487", "Request
Terminated: Channel limit exceeded\n");<br>
exit;<br>
}<br>
}<br>
else<br>
{<br>
$var(setprofile) = 0;<br>
}<br>
if($var(setprofile) > 0)<br>
{<br>
xlog("L_INFO", "Call control, setprofile:
$var(setprofile)\n");<br>
create_dialog();<br>
set_dlg_profile("caller","$fu");<br>
<br>
}<br>
setflag(31);<br>
}<br>
}<br>
But if i limit the max calls at 1 i can make more than one calls.<br>
<br>
can you help me please ??<br clear="all">
<br>
-- <br>
<font color="#663300"><font face="comic sans ms,sans-serif"><br>
<span style="color: rgb(0, 0, 0);">Best Regards.</span><br>
</font></font><br>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>