[OpenSIPS-Users] Performing math functions in OpenSIPs

Brad Bendy brad.bendy at benganetworks.com
Thu Mar 4 21:05:20 CET 2010


Hi,

That makes since now, we had a float actually. At this time no way to
work with floats at all right?

Thanks

On Thu, 2010-03-04 at 21:10 +0200, Bogdan-Andrei Iancu wrote:

> 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
> >   
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100304/a0ae5db9/attachment.htm 


More information about the Users mailing list