<div dir="ltr">Oh Ok. Got it. Thanks for the inputs.<div><br></div><div style>--- Jayesh</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 13, 2013 at 8:26 AM, Ovidiu Sas <span dir="ltr"><<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Make sure that the values are stored as strings in the table, not as float.<br>
<span class="HOEnZb"><font color="#888888"><br>
-ovidiu<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Mar 12, 2013 at 10:40 PM, Jayesh Nambiar <<a href="mailto:jayesh1017@gmail.com">jayesh1017@gmail.com</a>> wrote:<br>
> Hi Ovidiu,<br>
> Thanks for your reply. But I just expect them to be stored as string in my<br>
> AVPs. Even in 1.8.2, when I dumped those AVPs back into a database table, it<br>
> always put the exact value like 1.0000 or 0.0123 etc. So it was indeed<br>
> storing the entire value as string in the AVPs and not as 1 or 0. Is this<br>
> behaviour changed now?<br>
><br>
><br>
> --- Jayesh<br>
><br>
><br>
> On Tuesday, March 12, 2013, Ovidiu Sas wrote:<br>
>><br>
>> You are trying to store a float into an int. Prior to 1.9, there<br>
>> wasn't a strict check on the conversion and whatever the result was,<br>
>> it was stored (i.e. 1.000 was stored as 1 and 0.0123 was stored as 0).<br>
>> For more info: <a href="http://linux.die.net/man/3/strtol" target="_blank">http://linux.die.net/man/3/strtol</a><br>
>> Starting with 1.9, there is a strict check for invalid characters and<br>
>> therefore the conversion fails: 1.000 and 0.0123 are not a valid<br>
>> integers.<br>
>><br>
>> Regards,<br>
>> Ovidiu Sas<br>
>><br>
>> On Tue, Mar 12, 2013 at 10:36 AM, Jayesh Nambiar <<a href="mailto:jayesh1017@gmail.com">jayesh1017@gmail.com</a>><br>
>> wrote:<br>
>> > Hi,<br>
>> > I am testing out Opensips-1.9 currently. While I was using<br>
>> > opensips-1.8.2, I<br>
>> > used avp_db_query to query some values from database tables which were<br>
>> > float<br>
>> > point values and used those values to insert into acc table. Obviously<br>
>> > for<br>
>> > billing reasons. But after upgrading to 1.9 it gives error.<br>
>> > Eg: I am querying a table containing values 1.0000, 0.0123 etc. and<br>
>> > storing<br>
>> > it into AVPs. But the 1.9 version gives the following error:<br>
>> > ERROR:core:db_str2int: Unexpected characters: [.0000]<br>
>> > ERROR:db_mysql:db_mysql_str2val: error while converting integer value<br>
>> > from<br>
>> > string<br>
>> ><br>
>> > Can someone help me to take corrective actions inorder to avoid these<br>
>> > errors. Any help is much appreciated.<br>
>> ><br>
>> > Thanks,<br>
>> ><br>
>> > --- Jayesh<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>