[OpenSIPS-Users] Performing math functions in OpenSIPs
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Thu Mar 4 20:10:20 CET 2010
Hi Brad,
The arithmetic ops do work only with integer values (no floats). Also be
sure that the assignment to the avp you use was done as integer:
$avp(i:1) = 3 ;
and not like:
$avp(i:1) = "3" ;
Regards,
Bogdan
Brad Bendy wrote:
> Hello List,
>
> Im trying to do some math functions, ive tried a few different ways
> and get either invalid string operands or no value in right
> expression, ive tried the following:
>
> $avp(i:70) is set to say .005
>
> $avp(i:55) = $avp(i:70) * (6 / 100);
> $avp(i:55) = ($avp(i:70) * (6 / 100));
> $avp(i:55) = $avp(i:70) * 6 / 100;
> $avp(i:55) = $avp(i:70) * .006;
> $avp(i:55) = ($avp(i:70) * .006);
>
> Im sure I tried a few more to, but basically i want to take a AVP then
> multiply it by a number and get a result, this will be a decimal like
> 0.00234
>
> Any suggestions?
>
> Thanks
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Bogdan-Andrei Iancu
www.voice-system.ro
More information about the Users
mailing list