[sr-dev] storing DOUBLE in mysql

Aymeric Moizard jack at atosc.org
Wed Feb 10 20:50:06 CET 2010



On Wed, 10 Feb 2010, Daniel-Constantin Mierla wrote:

> Hello,
>
> On 2/10/10 5:08 PM, Aymeric Moizard wrote:
>> 
>> Hi,
>> 
>> I'm using kamailio release 3.0 (from git branch3 of sip router)
>> and I'm trying to store a double value in my mysql database:
>> 
>> I discovered that existing code only allow 2 decimal digit precision
>> in file "db_ut.c":
>> 
>> ret = snprintf(_s, *_l, "%-10.2f", _v);
>> 
>> I don't clearly understand the reason,
>
> the pseudo-variables have support only for integer or string values (no 
> doubles in cfg operations).

I'm using double in modules I'm working on.

> Double is used internally only for contact q value, and I guess that has 2 
> digits precision. It is fine for me to increase the precision. I cannot think 
> now of any drawback.

I tried to compile with 7 digit and it's working fine for my module.
However, I haven't tested anything else.

Tks,
Aymeric MOIZARD / ANTISIP
amsip - http://www.antisip.com
osip2 - http://www.osip.org
eXosip2 - http://savannah.nongnu.org/projects/exosip/


> Cheers,
> Daniel
>
>> but would like to
>> know if you wouldn't mind extending it? I would need 7 digits.
>> 
>> Regards,
>> Aymeric MOIZARD / ANTISIP
>> amsip - http://www.antisip.com
>> osip2 - http://www.osip.org
>> eXosip2 - http://savannah.nongnu.org/projects/exosip/
>> 
>> 
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>> 
>
> -- 
> Daniel-Constantin Mierla
> eLearning class for Kamailio 3.0.0
> * http://www.asipto.com/
>
>



More information about the sr-dev mailing list