diff --git a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt index 552e2e83..b1064576 100644 --- a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt +++ b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt @@ -18,6 +18,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE 1 USA 218 MN -6 Y SSM-FSN Minnesota CST 1 USA 219 IN -6 Y SSM-FSN Indiana CST 1 USA 220 OH -5 Y SSM-FSN Ohio EST +1 USA 223 PA -5 Y SSM-FSN Pennsylvania EST 1 USA 224 IL -6 Y SSM-FSN Illinois CST 1 USA 225 LA -6 Y SSM-FSN Louisiana CST 1 CAN 226 ON -5 Y SSM-FSN Ontario EST @@ -273,6 +274,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE 1 NLD 721 -4 N St. Maarten AST 1 USA 724 PA -5 Y SSM-FSN Pennsylvania EST 1 USA 725 NV -8 Y SSM-FSN Nevada PST +1 USA 726 TX -6 Y SSM-FSN Texas CST 1 USA 727 FL -5 Y SSM-FSN Florida EST 1 USA 730 IL -6 Y SSM-FSN Illinois CST 1 USA 731 TN -6 Y SSM-FSN Tennessee CST @@ -333,6 +335,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE 1 USA 831 CA -8 Y SSM-FSN California PST 1 USA 832 TX -6 Y SSM-FSN Texas CST 1 USA 835 PA -5 Y SSM-FSN Pennsylvania EST +1 USA 838 NY -5 Y SSM-FSN New York EST 1 USA 843 SC -5 Y SSM-FSN South Carolina EST 1 USA 845 NY -5 Y SSM-FSN New York EST 1 USA 847 IL -6 Y SSM-FSN Illinois CST diff --git a/agc_2-X/trunk/www/agc/manager_send.php b/agc_2-X/trunk/www/agc/manager_send.php index d3e89cc1..86fd9404 100644 --- a/agc_2-X/trunk/www/agc/manager_send.php +++ b/agc_2-X/trunk/www/agc/manager_send.php @@ -132,10 +132,11 @@ # 160912-2310 - Fixed StopMonitorConf bug involving agent-invoked commands to stop recording # 161029-0845 - Added RedirectToParkXfer and RedirectFromParkXfer functions # 161102-1043 - Fixed QM partition problem +# 161117-0622 - Fixes for recording_log issue where filename is non-unique # -$version = '2.12-79'; -$build = '161102-1043'; +$version = '2.12-80'; +$build = '161117-0622'; $php_script = 'manager_send.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=142; @@ -2203,7 +2204,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; + $stmt="SELECT recording_id FROM recording_log where filename='$filename' order by start_epoch desc;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2212,7 +2213,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) } else { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; + $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename' order by start_epoch desc;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2226,7 +2227,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename' order by start_epoch desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2412,7 +2413,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $rec_searchSQL = "recording_id='$recording_id'"; } - $stmt="SELECT recording_id,start_epoch,filename FROM recording_log where $rec_searchSQL;"; + $stmt="SELECT recording_id,start_epoch,filename FROM recording_log where $rec_searchSQL order by start_epoch desc;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2427,7 +2428,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where $rec_searchSQL;"; + $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where $rec_searchSQL order by start_epoch desc;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);} diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 98f35e9d..1462dbb0 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -415,10 +415,11 @@ # 161029-1026 - Added more agent debug logging details # 161101-2103 - Added user overall new lead limit # 161102-1044 - Fixed QM partition problem +# 161117-0622 - Fixes for rare vicidial_log and recording_log issues # -$version = '2.12-309'; -$build = '161102-1044'; +$version = '2.12-310'; +$build = '161117-0622'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=658; @@ -6181,8 +6182,8 @@ if ($stage == "end") if ($manualVLexists < 1) { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmtVL="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial,called_count) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$number_dialed','$user','MANUAL','N','$user_group','$alt_dial','$called_count');"; + ##### insert log into vicidial_log for manual VICIDiaL call if not already there + $stmtVL="INSERT INTO vicidial_log SET $SQLterm end_epoch='$StarTtime',length_in_sec='$length_in_sec',uniqueid='$uniqueid',lead_id='$lead_id',list_id='$list_id',campaign_id='$campaign',call_date='$NOW_TIME',start_epoch='$StarTtime',status='DONEM',phone_code='$phone_code',phone_number='$number_dialed',user='$user',comments='MANUAL',processed='N',user_group='$user_group',alt_dial='$alt_dial',called_count='$called_count';"; if ($DB) {echo "$stmtVL\n";} $rslt=mysql_to_mysqli($stmtVL, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtVL,'00280',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6200,7 +6201,8 @@ if ($stage == "end") } else { - $stmtVL="UPDATE vicidial_log SET uniqueid='$uniqueid',alt_dial='$alt_dial',user='$user' where lead_id='$lead_id' and user IN('$user','VDAD') and phone_number='$number_dialed' and uniqueid LIKE \"$beginUNIQUEID%\" and called_count='$called_count';"; + ##### update vicidial_log record with end time, duration and other fields + $stmtVL="UPDATE vicidial_log SET $SQLterm end_epoch='$StarTtime',length_in_sec='$length_in_sec',uniqueid='$uniqueid',alt_dial='$alt_dial',user='$user' where lead_id='$lead_id' and user IN('$user','VDAD') and phone_number='$number_dialed' and uniqueid LIKE \"$beginUNIQUEID%\" and called_count='$called_count';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmtVL, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtVL,'00057',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6214,15 +6216,17 @@ if ($stage == "end") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00401',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rowsX = mysqli_affected_rows($link); - ##### update the duration and end time in the vicidial_log table - if ($VDstatus == 'INCALL') {$vl_statusSQL = ",status='$status_dispo'";} - $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec',alt_dial='$alt_dial' $vl_statusSQL where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' and called_count='$called_count' order by call_date desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); + ##### if status of call in vicidial_log is INCALL update to DISPO + if ($VDstatus == 'INCALL') + { + $stmt="UPDATE vicidial_log set status='$status_dispo' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' and called_count='$called_count' and status='INCALL' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysqli_affected_rows($link); + } - if ($affected_rows > 0) + if ($affected_rowsVL > 0) { echo "$uniqueid\n$channel\n"; } @@ -6501,7 +6505,7 @@ if ($stage == "end") echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; if (strlen($filename[$loop_count])>2) { - $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'"; + $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]' order by start_epoch desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00099',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6537,7 +6541,7 @@ if ($stage == "end") $length_in_min = ($length_in_sec / 60); $length_in_min = sprintf("%8.2f", $length_in_min); - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; + $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL order by start_epoch desc;"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00100',$user,$server_ip,$session_name,$one_mysql_log);}