[OpenSIPS-Users] syntax error in cfg file

Pinky harish chandran pinky1349 at gmail.com
Sun Apr 28 14:10:14 CEST 2013


branch_route[2] {
      xlog("new branch at $ru\n");

        # values used for t1 and t2 and the constants c1 and c2 and the
threshold value

        $var(t1)=1;
        $var(t2)=60;
        $var(c1)=1;
        $var(c2)=3;
        $var(ts)=500;


        avp_db_query("select time from acc where caller_id=$fu and
max(time)","$avp(t)");

        avp_db_query("select ps,pl,pt,sh from acc where caller_id=$fu"
,"$avp(val)");

        avp_db_query("delete ps,pl,pt,sh from acc where caller_id=$fu");

        $avp(diff)=$avp(t)-$(avp(val)[2]);

        # calculation of long term gray level

        if ( ($var(t2) - $avp(diff) ) > 0 )
           $avp(l)= $(avp(val)[1]) +
$var(c2)*($(avp(val)[0])+1)*($var(t2)-$avp(diff))/$var(t2);

        if ( ($var(t2) - $avp(diff) ) <= 0 )
           $avp(l)= $(avp(val)[1]) +
$var(c2)*(1-$(avp(val)[0]))/($(avp(val)[0])+1))*($var(t2)-$avp(diff))/$var(t2);

        if ( $avp(l) < 0 )
           $avp(l) = 0;

        # calculation of short term gray level #


        if($avp(diff) > 1)
         {$avp(d)=$avp(diff);}
        else
         {$avp(d)=1;})

        if($avp(d)<$var(t1))
         {$avp(r)=$avp(d);}
        else
       {$avp(r)=$var(t1);}

        if ($avp(l) < $var(ts))
           $avp(s)= $(avp(val)[3])+$var(c1)*($var(t1)-$avp(diff))/($avp(r));

        if ($avp(s) < 0)
           $avp(s) = 0;

        if ($avp(s) >= $var(ts))
         {
           $avp(l)= $avp(s);
           $avp(s)= 0 ;
         }

         # updating spam history

        if ((($(avp(val)[0])+$(avp(val)[1])) < $var(ts) )&&
(($avp(s)+$avp(l)) > $var(ts)))
           $(avp(val)[3])= $(avp(val)[3])+1;

        # blocking the call

        $avp(sum) =$avp(l) + $avp(s);
        if ($avp(sum) > $avp(ts) )
           drop();

       #updating database

       avp_db_query(" insert into  acc (ps,pl,pt,sh) values
($avp(s),$avp(l),$avp(t),$(avp(val)[3]))");

}



I am getting syntax error in this code...can anyone help me out here
??please...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130428/57108778/attachment.htm>


More information about the Users mailing list