Page 1 of 1
Recording filename one hour offset
Posted:
Fri Sep 26, 2014 9:31 am
by ekaftan
Hi,
We have one customer that has a custom recording search page that browses through the recording
files directly instead of referencing mysql/recording_log. Problem is, since we moved to DST 2 weeks
ago, recording filenames are one hour wrong and for his custom app it matters.
Where is that filename generated? Vicidial is 2.2.0-236 over asterisk 1.4
Thanks,
Re: Recording filename one hour offset
Posted:
Mon Sep 29, 2014 11:45 am
by ekaftan
I found the 'problem'. Its not a problem with Vicidial, but we decided to modify the section where it takes the time from the server to the browser anyway, to avoid problems with badly setup browsers on our clients.
This is what we modified in vicidial.php. Commented old lines, patch starts at line 3344, file version 2.2.0-258 build 100413-1347.
var check_time_array=check_ALL_array[0].split("|");
//var Time_array = check_time_array[1].split("UnixTime: ");
//UnixTime = Time_array[1];
//UnixTime = parseInt(UnixTime);
// UnixTimeMS = (UnixTime * 1000);
//t.setTime(UnixTimeMS);
var Time_array = check_time_array[0].split("DateTime: ");
UnixTime = Date.parse(Time_array[1]);
t.setTime(UnixTime);
if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') )
Re: Recording filename one hour offset
Posted:
Tue Sep 30, 2014 3:13 am
by geoff3dmg
If you have machines with their time set wrong, really bad things happen (tm). You should fix the root cause really rather than use a kludge like this.
Re: Recording filename one hour offset
Posted:
Tue Sep 30, 2014 3:32 am
by ekaftan
geoff3dmg wrote:If you have machines with their time set wrong, really bad things happen (tm). You should fix the root cause really rather than use a kludge like this.
I have no control over the Windows machines my customers use to connect to my services. This kludge makes the timezone and localtime settings
of those machines irrelevant. I tested it with a client machine using a timezone from anywhere in the world and they now always see server time
in their agc screens and the recording filenames are also always in server-localtime.
I think it should at least be a config option. 'Ignore timezone setting on agc client machine?: Y/N'
Re: Recording filename one hour offset
Posted:
Tue Sep 30, 2014 3:41 am
by ekaftan
Previous version of the patch/kludge was not working with Firefox. Also, the variable UnixTime needs to be in
seconds and in UTC in other parts of the code, so we restored that part of the code.
Final running version of the code is now running for almost 12 hours and survived the night shifts.
Code:
(around line 4304 for version 2.4-345c, build 120427-1726 of vicidial.php and line 3344 for
version 2.2.0-258, build 100413-1347)
var check_time_array=check_ALL_array[0].split("|");
var Time_array = check_time_array[1].split("UnixTime: ");
UnixTime = Time_array[1];
UnixTime = parseInt(UnixTime);
//UnixTimeMS = (UnixTime * 1000);
Time_array = check_time_array[0].split("DateTime: ");
var EKArray = Time_array[1].split(" ");
var EKDate = EKArray[0].split("-");
var EKTime = EKArray[1].split(":");
UnixTimeMS = new Date(EKDate[0],EKDate[1]-1,EKDate[2],EKTime[0],EKTime[1],EKTime[2]).getTime();
t.setTime(UnixTimeMS);
Re: Recording filename one hour offset
Posted:
Tue Sep 30, 2014 5:03 am
by geoff3dmg
You should open a ticket on the issue tracker.