date and asterisk time differs

3,243 views
Skip to first unread message

Carlos Rey-Moreno

unread,
Aug 14, 2012, 6:05:04 AM8/14/12
to village-telco-dev
Good morning, I'm trying to get the cdr logs from asterisk with the correct timing, however I'm not managing to do so.

I've set up my computer as a time server and modified the /etc/init.d/ntpdate file in the MPs to get my reference. After changing the /etc/config/system file to SAST-2 the time zone here in South Africa, I got the same time in both devices.

However, in the cdr log file it kept on reporting the time as if UTC was used. I found that I had to change the "usegmtime" to no in  /etc/asterisk/cdr.conf. I did it and rebooted, but still the timestamps are showing UTC timing.

If I log on the Asterisk CLI modifying the prompt to give me the time. It's not only CDR that reports with UTC timing, but asterisk too.

root@MP-42:~# date
Tue Aug 14 12:06:50 SAST 2012
root@MP-42:~# ASTERISK_PROMPT='[%d %t]%H*> '
root@MP-42:~# export ASTERISK_PROMPT
root@MP-42:~# asterisk -r
Asterisk 1.4.11, Copyright (C) 1999 - 2007 Digium, Inc. and others.
Created by Mark Spencer <mark...@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.4.11 currently running on MP-42 (pid = 765)
[2012-08-14 10:07:08]MP-42*>

I've been reading around but I couldn't find the solution. Do you know how can I solve this issue?

Thanks a lot

Carlos



Glen Steedman

unread,
Aug 14, 2012, 6:49:14 AM8/14/12
to village-...@googlegroups.com
Did you make the changes under both cdr and csv ? for usegmtime=no
--
Cheers, Glen
> --
> You received this message because you are subscribed to the Google Groups
> "village-telco-dev" group.
> To post to this group, send email to village-...@googlegroups.com.
> To unsubscribe from this group, send email to
> village-telco-...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Carlos Rey-Moreno

unread,
Aug 14, 2012, 7:28:08 AM8/14/12
to village-...@googlegroups.com
Hi Glen, thank you for your answer,

I didn't have a cdr section in cdr.conf, I added and rebooted, but nothing changed. any other hint?

Thanks

Carlos

root@MP-42:~# cat /etc/asterisk/cdr.conf
; Asterisk Call Detail Record engine configuration

[general]

[csv]
usegmtime=no    ; log date/time in GMT.  Default is "no"
loguniqueid=yes  ; log uniqueid.  Default is "no
loguserfield=yes ; log user field.  Default is "no
root@MP-42:~#

[cdr]
usegmtime=no    ;



2012/8/14 Glen Steedman <gste...@gmail.com>

Carlos Rey-Moreno

unread,
Aug 16, 2012, 7:27:23 AM8/16/12
to village-...@googlegroups.com
Ok, we solved it. It looks like you need to have a file in /usr/share/zoneinfo with the information about your timezone and another file /etc/localtime linked to the previous one that is from where asterisk takes the information.

we're going to prepare an entry for the wiki in case anyone runs into the same problem

Best,

Carlos

2012/8/14 Carlos Rey-Moreno <cr...@ehas.org>

Song, Stephen

unread,
Aug 16, 2012, 7:32:35 AM8/16/12
to village-...@googlegroups.com
Nice one Carlos!  Seems like something we should add to the configuration UI.

-Steve

pyaephyo zaw

unread,
Sep 13, 2017, 7:14:52 AM9/13/17
to Village Telco Development Community
Dear Bro,

    In my asterisk server cdr.csv file time is show GMT.I want to change local time bro.
    I already check local time and  zone-info configuration.That are correct.Now i would like to know your answer bro.
   Please share this error issue to me.let me know answer about this case.

 Best Regards
 Pyae Phyo

pyaephyo zaw

unread,
Sep 15, 2017, 6:26:44 AM9/15/17
to Village Telco Development Community
Dear Bro,

    In my asterisk server cdr.csv file time is show GMT.I want to change local time bro.
    I already check local time and  zone-info configuration.That are correct.Now i would like to know your answer bro.
   Please share this error issue to me.let me know answer about this case.

 Best Regards
 Pyae Phyo
- show quoted text -
> To post to this group, send email to village-telco-dev@googlegroups.com.
> To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages