Recording filename one hour offset

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Recording filename one hour offset

Postby ekaftan » Fri Sep 26, 2014 9:31 am

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,
ekaftan
 
Posts: 126
Joined: Fri Nov 17, 2006 8:23 pm

Re: Recording filename one hour offset

Postby ekaftan » Mon Sep 29, 2014 11:45 am

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') )
ekaftan
 
Posts: 126
Joined: Fri Nov 17, 2006 8:23 pm

Re: Recording filename one hour offset

Postby geoff3dmg » Tue Sep 30, 2014 3:13 am

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.
Vicibox 5.03 from .iso | VERSION: 2.10-451a BUILD: 140902-0816 | Asterisk 1.8.28.2-vici | Multi-Server | Amfeltec H/W Timing Cards | No Extra Software After Installation | Dell PowerEdge 1850 | Pentium 4 'Prescott' Xenon Quad @ 3.40GHz
geoff3dmg
 
Posts: 403
Joined: Tue Jan 29, 2013 4:35 am
Location: Lancashire, UK

Re: Recording filename one hour offset

Postby ekaftan » Tue Sep 30, 2014 3:32 am

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'
ekaftan
 
Posts: 126
Joined: Fri Nov 17, 2006 8:23 pm

Re: Recording filename one hour offset

Postby ekaftan » Tue Sep 30, 2014 3:41 am

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);
ekaftan
 
Posts: 126
Joined: Fri Nov 17, 2006 8:23 pm

Re: Recording filename one hour offset

Postby geoff3dmg » Tue Sep 30, 2014 5:03 am

You should open a ticket on the issue tracker.
Vicibox 5.03 from .iso | VERSION: 2.10-451a BUILD: 140902-0816 | Asterisk 1.8.28.2-vici | Multi-Server | Amfeltec H/W Timing Cards | No Extra Software After Installation | Dell PowerEdge 1850 | Pentium 4 'Prescott' Xenon Quad @ 3.40GHz
geoff3dmg
 
Posts: 403
Joined: Tue Jan 29, 2013 4:35 am
Location: Lancashire, UK


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 135 guests