View Full Version : How do I set the timezone on the WARP?
rutileblue
09-20-08, 11:58 AM
My originating problem is that the time reported for voicemail messages is in UTC time, not in local time. (I would like it reported as USA (Central).) Doing a 'date' command at the WARP command line also reports the time as UTC. There is also no TZ environment variable defined. So I believe the WARP believes it is UTC -- I would like it to report time as Central Time.
Reading the PADS User Guide, section7.3.1, I do have the "Timezone Info Package" included when building. I've also added this line to my S32ntpd file on the WARP (and rebooted after the change):
export TZ=CST6CDT
That, as far as I can tell, has no effect. (ie I still get time reported as UTC at the command line and in Asterisk.)
So... What am I missing or misunderstanding?
Thanks for any direction or suggestions!
PS: I do have my Asterisk voicemail.conf configured to have a timezone for the mailbox, so I don't believe that is the issue.
rutileblue
09-27-08, 12:39 PM
I was poking around a bit more and found some interesting items (at least, they are interesting to me; you all probably knew this... :D)
First... In the S32ntpd file, I added the -d flag to see the debug info. This is the output after rebooting:
31 Dec 18:00:16 ntpdate[104]: ntpdate 4.2.0a@1.1190-r Sat Jan 20 10:34:17 MET 2007 (1)
Looking for host 0.us.pool.ntp.org and service ntp
host found : tesla.fireduck.com
transmit(69.31.13.210)
receive(69.31.13.210)
transmit(69.31.13.210)
receive(69.31.13.210)
transmit(69.31.13.210)
receive(69.31.13.210)
transmit(69.31.13.210)
receive(69.31.13.210)
transmit(69.31.13.210)
server 69.31.13.210, port 123
stratum 2, precision -20, leap 00, trust 000
refid [69.31.13.210], delay 0.09442, dispersion 0.00000
transmitted 4, in filter 4
reference time: cc88d019.d5fb4969 Sat, Sep 27 2008 10:30:33.835
originate timestamp: cc88d871.08fa88c9 Sat, Sep 27 2008 11:06:09.035
transmit timestamp: 83aa7e91.67de5082 Wed, Dec 31 1969 18:00:17.405
filter delay: 0.09937 0.09943 0.10464 0.09442
0.00000 0.00000 0.00000 0.00000
filter offset: 12225315 12225315 12225315 12225315
0.000000 0.000000 0.000000 0.000000
delay 0.09442, dispersion 0.00000
offset 1222531551.594894
31 Dec 18:00:17 ntpdate[104]: step time server 69.31.13.210 offset 1222531551.594894 sec
So I see it getting the time for the correct timezone (the green text), but it looks like the Warp believes its time is Dec 31, 1969...
So... Is there no battery on the clock? Does it really reset to 1969 after every reboot, then depends on ntp to bring it back to this century?
Second... looking at other linux distro's, they have timezone information in the /usr/share/zoneinfo folder. I'm not seeing that folder on my Warp. It's true that when I ran 'make menuconfig', I had chosen not to include all timezone information, so I imagine that's why... If I had chosen "Full timezone information", would it then create a zoneinfo folder? And, just curious... Where is the source timezone info kept otherwise?
Third... most other distros also have a /etc/localtime; I noticed my Warp did not. I went back to the PADS documentation and saw that one could run the 'timezone' command... Perhaps, I thought, that would do something? It did! It created the localtime entry in the etc directory. And, now, when the unit reboots, it has the correct Central time. Yay!
Which makes me wonder... Is it a requirement to run 'timezone' on the Warp? The documentation doesn't indicate that is so...
Lastly... Alas, Asterisk voicemail still believes it is UTC. Any ideas on that front? Anybody else have a similar problem with voicemail?
vfadmin
09-30-08, 08:00 AM
Hi,
Based on your feedback we have been able to reproduce the problem.
We are investigating and will post a solution as soon as we can.
PIKA Support
To answer your questions, ...
Yes the WARP resets to 1969 on every reboot and uses ntp to bring it to the correct time.
Yes it is a requirement to build the full timezone information in PADS and run timezone. Doing export TZ=CST6CDT will not work. The timezone info is created in /persistent/usr/share/zoneinfo
There is no battery on the WARP. That is an option being examined for the next release of the WARP hardware.
rutileblue
12-06-08, 12:07 PM
Time has passed... Can you post an update as to when I can expect a fix?
What fix are you looking for? I have tried to answer a couple of your questions. If I have missed what specifically you are looking for in a fix, please clarify it for me. Thanks.
If it is for a battery on the WARP, there is no update on when that will happen. It is on the feature list for the next spin of the WARP baseboard but there is no current date assigned to when that will occur.
If it is on the requirement to run timezone, YES it is a requirement. I personally think the option on whether to include full timezone info in PADS should always be turned on. I am not sure why timezone is even split into two pieces.
rutileblue
12-23-08, 04:16 PM
Thank you for answering the questions. But the problem still exists -- the timestamp of VoiceMail messages is UTC, while the rest of the Warp is correctly in Chicago time. Sorry, but I thought you all had recreated that problem when the 9/30 post said that Support had recreated the problem...
We never reproduced an error with wrong timezone for voicemail in asterisk, just error with timezone in general. Which version of PADS and asterisk are you using? When I test this with my FreePBX WARP the VM messages all appear with the correct time as set on the computer, EST for me.
Please post your PADS version and voicemail.conf file so we can see what may be wrong in your setup.
rutileblue
01-04-09, 04:21 PM
The PADS version is 1.0.2.8.
The voicemail.conf is currently:
/persistent/etc/asterisk # cat voicemail.conf
[general]
maxmessage=180
maxsilence=10
silencethreshold=250
format=wav
tz=central
[zonemessages]
eastern=America/New_York|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'
military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HM
[local]
2001 => 1111,Theresa Sterbis,,,tz=central
2002 => 1111,Alison McLaughlin
2003 => 1111,Kathy Weircinski
2004 => 1111,Chuck Sterbis
2005 => 1111,Laurie Flight
3001 => 1111,Home Kitchen
This was after poking and prodding a bit to try to solve this problem. The original was like so (which worked fine on the original PC-based system):
[root@fedora asterisk]# cat voicemail.conf
[general]
maxmessage=180
maxsilence=10
silencethreshold=250
format=wav
[local]
2001 => 1111,Theresa Sterbis
2002 => 1111,Alison McLaughlin
2003 => 1111,Kathy Weircinski
2004 => 1111,Chuck Sterbis
2005 => 1111,Laurie Flight
3001 => 1111,Home Kitchen
In my working voicemail configuration, I do not specify the
tz=central
in the configuration and it just pulls in the system timezone properly. You should try this. I am using version 1.2.0.67 of PADS however.
dmcmorris
02-19-09, 11:41 AM
I seem to be experiencing this issue too. The timezone is (now) set right, and `date` returns the correct local time. However, E-mail notices are similar to the following:
=BEGIN=
Just wanted to let you know you were just left a 0:02 long message (number 1) in mailbox #### from John Doe, on Thursday, February 19, 2009 at 04:42:20 PM so you might want to check it when you get a chance. Thanks!
=END=
(some snipping has occurred).
The time in this e-mail is 5 hours ahead of local (IE: UTC). I have attempted to change and remove the "tz=" line from voicemail.conf to no avail. After the change, I issue 'reload' in the asterisk console (asterisk -r).
My version_info.txt:
toolchain 1.0.2
Mon Nov 10 12:07:46 EST 2008
Kernel version 2.6.26-10
Skeleton version 1.0.0-16
Busybox 1.10.3
Zaptel version 1.4.9.2
Asterisk version 1.4.21.2
autoflash USB included
autoflash SD included
HMP version 2.5.0-69
chan_pika version http://svn.pikatech.com/chan_pika/tags/3.4.0.126
daemontools 0.76
Dropbear version 0.50
e2fsprogs 1.41.0
NTP included
ssmtp 2.61
Warploader 1.0.0
zoneinfo 1.0.0
A partially-censored copy of my voicemail.conf is at http://rafb.net/p/8YJFoV55.html
--Don
raysenez
04-01-09, 05:59 PM
Have you tried adding the line
export TZ=cst06cdt05,M3.2.0/2,M11.1.0/2
to the /etc/profile file
raysenez
04-02-09, 03:58 PM
The problem is that the Time Zone is not set in the environment that is used to start Asterisk. If you add the export TZ string to the profile, then go in and down the Asterisk service and then restart the Asterisk service, everything will be happy with the TZ for CDR and other logs.
So the trick to fixing this problem will be to have the initial script grab the TZ environment setting from a persistent location that is easily changeable (ie /etc/profile or /etc/tz) and in doing so we will not have to flash in specific Timezone information to the system image.
raysenez
04-02-09, 04:37 PM
Minutes after I posted the last message I discovered that the shell script that svc uses to start asterisk already includes a shell script called /etc/localenv
if you add
export TZ=cst06cdt05,M3.2.0/2,M11.1.0/2
to the localenv file it will set the correct environment for Warp and all the cdr
records/voicemail messages will now be in the correct time zone.
dmcmorris
04-09-09, 03:19 PM
Perfect fix! Of course, modified to suit my local timezone (Eastern), but it works well. Thanks!
raysenez
05-06-09, 12:09 PM
In order to get the timezone fully functional for voicemail messages
I also had to add the /usr/share/zoneinfo files to the system.
You can get these from any red hat install.
If you install all of these files, they are quite large, so I placed them on my
SD card and linked them back to the /usr/share location.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.