<div dir="ltr"><p class=""><span style="font-family:'Courier New'">branch_route[2]
{<br>
xlog("new branch at
$ru\n");<br>
<br>
# values used for t1 and t2 and
the constants c1 and c2 and the threshold value <br>
<br>
$var(t1)=1;<br>
$var(t2)=60;<br>
$var(c1)=1;<br>
$var(c2)=3;<br>
$var(ts)=500;<br>
<br>
<br>
avp_db_query("select time
from acc where caller_id=$fu and max(time)","$avp(t)");<br>
<br>
avp_db_query("select ps,pl,pt,sh
from acc where caller_id=$fu" ,"$avp(val)");<br>
<br>
avp_db_query("delete
ps,pl,pt,sh from acc where caller_id=$fu");<br>
<br>
$avp(diff)=$avp(t)-$(avp(val)[2]);<br>
<br>
# calculation of long term gray
level <br>
<br>
if ( ($var(t2) - $avp(diff) )
> 0 )<br>
$avp(l)= $(avp(val)[1]) +
$var(c2)*($(avp(val)[0])+1)*($var(t2)-$avp(diff))/$var(t2);<br>
<br>
if ( ($var(t2) - $avp(diff) )
<= 0 )<br>
$avp(l)= $(avp(val)[1]) +
$var(c2)*(1-$(avp(val)[0]))/($(avp(val)[0])+1))*($var(t2)-$avp(diff))/$var(t2);<br>
<br>
if ( $avp(l) < 0 )<br>
$avp(l) = 0;<br>
<br>
# calculation of short term gray
level #<br>
<br>
<br>
if($avp(diff) > 1)<br>
{$avp(d)=$avp(diff);} <br>
else <br>
{$avp(d)=1;})<br>
<br>
if($avp(d)<$var(t1))<br>
{$avp(r)=$avp(d);}<br>
else<br>
{$avp(r)=$var(t1);}<br>
<br>
if ($avp(l) < $var(ts))<br>
$avp(s)=
$(avp(val)[3])+$var(c1)*($var(t1)-$avp(diff))/($avp(r));<br>
<br>
if ($avp(s) < 0)<br>
$avp(s) = 0;<br>
<br>
if ($avp(s) >= $var(ts))<br>
{<br>
$avp(l)= $avp(s);<br>
$avp(s)= 0 ;<br>
}<br>
<br>
# updating spam history<br>
<br>
if
((($(avp(val)[0])+$(avp(val)[1])) < $var(ts) )&& (($avp(s)+$avp(l))
> $var(ts)))<br>
$(avp(val)[3])=
$(avp(val)[3])+1;<br>
<br>
# blocking the call<br>
<br>
$avp(sum) =$avp(l) +
$avp(s);<br>
if ($avp(sum) > $avp(ts)
)<br>
drop();<br>
<br>
#updating database<br>
<br>
avp_db_query(" insert
into acc (ps,pl,pt,sh) values
($avp(s),$avp(l),$avp(t),$(avp(val)[3]))");<br>
<br>
}<br>
</span></p><p class=""><span style="font-family:'Courier New'"><br></span></p><p class=""><span style="font-family:'Courier New'"><br></span></p><p class="" style><span style="font-family:'Courier New'">I am getting syntax error in this code...can anyone help me out here ??please...</span></p>
</div>