[asterisk-users] Time difference in CSV CDR's and MySQL CDR's

Zhang Shukun bitzsk at gmail.com
Thu Apr 22 20:41:19 CDT 2010


2010/4/22 Steve Edwards <asterisk.org at sedwards.com>:
> Un-top-posting...
>
>> 2010/4/22 Alejandro Recarey <alexrecarey at gmail.com>:
>>>
>>> I am having a curious problem. I use two cdr backends, csv and MySQL.
>>>
>>> I am finding that the calldate field varies between 3 seconds and 3
>>> minutes between the MySQL database and the CSV files! Is this expected
>>> behaviour? I thought they should both use the same timestamp.
>
> On Thu, 22 Apr 2010, Zhang Shukun wrote:
>
>> the time in the file cdr is right, as mysql. calldate is the time when
>> the record insert into mysql.
>
> I'm just a 1.2 Luddite, but...
>
> In cdr_addon_mysql.c:
>
>         localtime_r(&cdr->start.tv_sec,&tm);
>         strftime(timestr,128,DATE_FORMAT,&tm);
>
> and then timestr is used to populate the 'calldate' column when the insert
> statement is built.
>
> Which is consistent with my CDRs -- they show the time the call was
> started, not some time after the call is finished when the row is inserted
> into the database.
but in the cdr_mysql.conf, it said as following:


; Older versions of cdr_mysql set the calldate field to whenever the
; record was posted, rather than the start date of the call.  This flag
; reverts to the old (incorrect) behavior.  Note that you'll also need
; to comment out the "start=calldate" alias, below, to use this.
compat=no


i use asterisk 1.6.2.1


>
> --
> Thanks in advance,
> -------------------------------------------------------------------------
> Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
> Newline                                              Fax: +1-760-731-3000
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Thanks for your supporting,
have a nice day.
Sucan



More information about the asterisk-users mailing list