Summary:ASTERISK-17564: [patch] Timezone variables are corrupted.
Reporter:Andrew Latham (lathama)Labels:patch
Date Opened:2011-03-15 12:18:01Date Closed:
Versions:1.8.3 13.18.4 Frequency of
Environment:Attachments:( 0) 20110402__issue18980__162.diff.txt
( 1) info.html
Description:During the time change, which in Chile where the government changes the start and end every year we noticed this issue.  Some newer PBXes with res_phoneprov are reporting incorrect time settings.  The TIMEZONE var is not working at all.


example html code:
<li>Time Zone: ${TIMEZONE}</li>
<li>Time Zone Offset: ${TZOFFSET}</li>
<li>DST Enabled: ${DST_ENABLE}</li>
<li>DST End (M-D-H): ${DST_END_MONTH} - ${DST_END_MDAY} - ${DST_END_HOUR}</li>

and the output

Time Zone: 5060
Time Zone Offset: -10800
DST Enabled: -10800
DST Start (M-D-H): -10800 - -10800 - -10800
DST End (M-D-H): -10800 - -10800 - -10800
Comments:By: Andrew Latham (lathama) 2011-03-15 14:53:38

First item I notice... in http://svn.asterisk.org/svn/asterisk/trunk/res/res_phoneprov.c is never set.  the intention is there but it never happens...  I want to know how it gets the SIP port as its value...

By: Andrew Latham (lathama) 2011-03-15 16:46:12

Having trouble with time settings...  "svn praise res/res_phoneprov.c | grep -i time" says that you are the helpful person to talk to...

By: Andrew Latham (lathama) 2011-03-16 12:31:28

Quick way to reproduce this is to set the system time zone to a time zone without DST or to remove system DST...

By: Andrew Latham (lathama) 2011-04-01 07:08:23

I can reproduce this 100% of the time... Its not random.

I looked at the source and have some ideas to fix this.  One idea is to also allow timezone overrides in the phoneprov.conf

By: Andrew Latham (lathama) 2011-04-02 11:22:42

Tested tilghman's patch, no change (I see what he did and maybe it will work after the initial problem is fixed).

I changed the order of the template varibles and found different results.

Still Testing

By: Andrew Latham (lathama) 2011-04-02 12:04:42

Attached a simple test, copy file to /var/lib/asterisk/phoneprov/ and append "info.html => info.html,text/html" to phoneprov.conf, to use, simply visit http://hostnameorip:8088/phoneprov/info.html

On a test done on a server fully updated on the 1.8 branch, TIMEZONE is not set on the first table row.  On the second table row it is set to the SERVER_PORT.  All other DST values are set to the TZ_OFFSET.

Loading a clean system to test with now, The wonderful bean counters in the Chilean gov have pushed DST to May 7-8.  Most DST files are set for this weekend April 2-3.  We have hard coded the phone prov files with the change.