Time Synch error in agent interface

Any and all non-support discussions

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

Time Synch error in agent interface

Postby ivschakravarthi » Wed Aug 14, 2013 1:22 pm

Vicdial VERSION: 2.8-403a
BUILD: 130510-1350
asterisk 1.4.21.2
single server
Centos5.5
One telephony card
No cluster

I have started backtracing the cause of time synchronisation error
Agent web page is throwing the time synch error whenever the following condition is satisfying in conf_exten_check.php
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (preg_match("/0\$/i",$StarTtime)) )
{
$Alogin='TIME_SYNC';}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Calculations are as follows
$time_diff = ($server_epoch - $db_epoch);
$web_diff = ($db_epoch - $web_epoch);

$web_epoch coming as $web_epoch = date("U");
$server_epoch and $db_epoch are comig from mysql command below
SELECT UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';

i am logging the above values one text file whenever that conditions occurs as follows


$filename="/tmp/debug.txt";
$fh = @fopen($filename, 'a+');
fputs($fh,$server_epoch."\n");
fputs($fh,$db_epoch."\n");
fputs($fh,$web_epoch."\n");
fputs($fh,$NOW_TIME."\n");
fclose($fh);

I got the output as below w

1376442122 //server_epoch
1376442122 //db_epoch
1376442140 // web_epoch
2013-08-14 03:02:20

/usr/share/astguiclient/AST_update.pl is the program which is updating the db_epoch and server_epoch as follows
$stmtU = "UPDATE $server_updater set last_update='$now_date' where server_ip='$server_ip'";

As per my understanding, suddenly the above program is not updating the fields in the mysql table and time synch error is arising.
My concern is why the above the program is not updating the tables suddenly?

I am facing the error in the low calls scenario also such as even when i have calls around 10 to 20 with 15 to 20 agents logged in maximum.
When i searched the forums,all are saying about the ntp time update of the server.
But i believe it is the error something due to either asterisk or asterisk manager interface or the perl file AST_update.pl


Regards,
chak
ivschakravarthi
 
Posts: 81
Joined: Wed Jun 20, 2012 12:47 am
Location: India

Re: Time Synch error in agent interface

Postby miike » Thu Aug 15, 2013 7:37 am

You may have a corrupt database, try repairing:

mysqlcheck -u root -ppassword --auto-repair --check --optimize --all-databases
miike
 
Posts: 4
Joined: Wed Jan 23, 2013 2:38 pm

Re: Time Synch error in agent interface

Postby DomeDan » Thu Aug 15, 2013 7:37 am

take a look at the sceen running the AST_update.pl script

screen -r ASTupdate

Been looing into this too and I wrote a one line command to get the 3 different times that you are getting in the log :) viewtopic.php?f=4&t=27605
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 36 guests