[SR-Users] Fwd: save accdb records with milisec in timestamp field

Daniel-Constantin Mierla miconda at gmail.com
Tue Apr 23 20:51:55 CEST 2013


Hello,

looking now at the patch on the tracker (which somehow was assigned to 
me), I see few issues and have some questions:

- the tm variable is declared set, but not used
- tz is also not used, gettimeofday() can take NULL as second parameter 
and iirc, tz is obsolete
- I wonder if gettimeofday() can actually fail and return code should be 
checked for error cases
- the names of the new column, respectively 'time_hires' sounds a bit 
strange to me, does it have any special meaning the word 'hires'?

Overall, wouldn't be better to keep the seconds and microseconds (as 
returned in a timeval structure) in separate columns. That means keeping 
the time column as it is and adding a new column for microsecs. Then 
people can get the precision as they want, including only down to the 
miliseconds if that is what they need.

I will add these notes on the tracker so it can be continued there for 
development.

As a quick solution for now, one can store the value of $TV(Sn) (taken 
at 200ok for INVITE or BYE, stored in avp for example) - it is string, 
but can be converted to number by billing apps.

   - http://www.kamailio.org/wiki/cookbooks/4.0.x/pseudovariables#timeval

Cheers,
Daniel

On 4/23/13 10:54 AM, Andreas Granig wrote:
> Hi Uri,
>
>
> On 04/23/2013 10:45 AM, Uri Shacked wrote:
>> can anyone tell me if it is possible to save the time and date using
>> accdb (mysql) with milisec as well? the field on the DB is set as 
>> TIMESTAMP.
>
> We've opened a ticket on the bug tracker some months ago, but it's 
> still open at 
> http://sip-router.org/tracker/index.php?do=details&task_id=163&project=1 
> and we haven't followed up on it, however we're using this patch in 
> production for months at all our deployments without any issues.
>
> Andreas
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list