Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bootstrap.php(430) : eval()'d code on line 123
Asterisk. Incorrect time in CDR
Results 1 to 7 of 7

Thread: Asterisk. Incorrect time in CDR

  1. #1

    Asterisk. Incorrect time in CDR

    Although the date and time is correct on my wl500gp, the time in the Call Detail Records (CDR) is always 2 hours behind.

    My setup:
    Zyxel 2602H router(with analog phone connected)->Wl500gp(asterisk server)->voipbuster.com
    asterisk 1.4

    What i tried:
    -It doesn't matter if i dial from the console or from the phone.
    -tried installing 'tz' timezone utilities and make symbolic link.
    -ran asterisk in verbose mode. I only see correct date/time here..

    I don't understand what's going on. Google was not my friend


    Who has a clue?
    Anyone seen this problem before?
    Last edited by avberk; 26-06-2008 at 08:36.

  2. #2
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Not sure about......
    but I suggest to have a closer look for function STRPTIME() .
    http://www.asteriskdocs.org/

  3. #3
    Thanks Newbiefan! I did see this command. i'll have another look at it.

    I am starting to believe it might have to with a missing hardware clock on the wl500gp, but i haven't convinced myself

    Could this be??

  4. #4
    Quote Originally Posted by avberk View Post
    Although the date and time is correct on my wl500gp, the time in the Call Detail Records (CDR) is always 2 hours behind.
    I have exactly the same problem since i am running asterisk. Tried myself like crazy to solve it but never made it.
    Whats weired is that everywhere in the internet people claim that asterisk is looking at the unix system time. But for my experience that cant be even if i change my system time the difference of 2 hours in the asterisk is allways the same.
    I would integrate this in my Asterisk tutorial (german part of this board) if anyone finds a solution.

    BTW. I think in the wintertime its just a 1 hour difference.

  5. #5
    Seems that if you persist on finding a solution you will find one

    Hereby the steps you need to take:

    -Open /opt/etc/asterisk/cdr.conf and change 'usegmtime'
    to 'no'. e.g.:
    [csv]
    usegmtime=no ; log date/time in GMT. Default is "no"
    loguniqueid=no ; log uniqueid. Default is "no"
    loguserfield=no ; log user field. Default is "no"

    -ipkg update
    -ipkg install tz

    -Goto the /opt/share/zoneinfo folder and find
    your timezone location. Copy this location to the
    folder /etc/localtime. e.g.:
    cp /opt/share/zoneinfo/Europe/Amsterdam /etc/localtime

    -Open '/usr/local/.files' and add this line:
    /etc/localtime

    -To make the change permanent, save it to flash:
    flashfs save && flashfs commit && flashfs enable

    -Restart Asterisk.


    See also this link for some background info:
    http://www.nslu2-linux.org/wiki/Unslung/TimeZoneUpdate

  6. #6
    wow that did work!!!!!!!
    thx avberk for sharing your solution, that abolutely made my day!
    Now my asterisk server feels like its perfect.

  7. #7
    Sorry to revive an old topic but these steps may be outdated. At least they don't seem to be valid in my case.

    I installed my zoneinfo package. Copied my zone to /etc/localtime.

    I'm running into a problem opening /usr/local/.files

    The file doesn't exist and I've been unsuccessful in creating it. I could maybe figure this out for myself but I've no clue what /usr/local/.files is supposed to do.

    And the next step: I don't have flashfs. Something I need to install or is there a different way to make this permanent?

    Thanks

    EDIT: [SOLVED] I added the following line to my /jffs/scripts/services-start script. I did it before the wait for unslung to start so the localtime file would be there before asterisk starts.

    Code:
    #!/bin/sh
    
    cp /opt/share/zoneinfo/US/Eastern /etc/localtime
    
    sleep 10
    /opt/etc/init.d/rc.unslung start
    I guess that's easier than the /usr/local/.files and flashfs save && commit && reboot stuffs. Anyway, I'm happy.

    Quote Originally Posted by avberk View Post
    Seems that if you persist on finding a solution you will find one

    Hereby the steps you need to take:

    -Open /opt/etc/asterisk/cdr.conf and change 'usegmtime'
    to 'no'. e.g.:
    [csv]
    usegmtime=no ; log date/time in GMT. Default is "no"
    loguniqueid=no ; log uniqueid. Default is "no"
    loguserfield=no ; log user field. Default is "no"

    -ipkg update
    -ipkg install tz

    -Goto the /opt/share/zoneinfo folder and find
    your timezone location. Copy this location to the
    folder /etc/localtime. e.g.:
    cp /opt/share/zoneinfo/Europe/Amsterdam /etc/localtime

    -Open '/usr/local/.files' and add this line:
    /etc/localtime

    -To make the change permanent, save it to flash:
    flashfs save && flashfs commit && flashfs enable

    -Restart Asterisk.


    See also this link for some background info:
    http://www.nslu2-linux.org/wiki/Unslung/TimeZoneUpdate
    Last edited by leetwanker; 03-02-2014 at 01:33.

Similar Threads

  1. Daylight savings time (summer time)
    By Tellus1 in forum WL-500gP Q&A
    Replies: 5
    Last Post: 06-04-2008, 11:28
  2. Asus WL-500G Premium V1 и qwerty (Нео сеть)
    By telnet76 in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 18
    Last Post: 24-02-2008, 16:44
  3. python time module bug
    By gfreney in forum WL-500g Custom Development
    Replies: 0
    Last Post: 18-01-2008, 16:22
  4. WL-500gP with a WD my book pro II 1TB I/O errors
    By golem in forum WL-500gP Q&A
    Replies: 1
    Last Post: 14-06-2007, 21:14

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •