diff --git a/UPGRADE b/UPGRADE index 251ca347..ca5799cc 100644 --- a/UPGRADE +++ b/UPGRADE @@ -400,7 +400,8 @@ OTHER CHANGES: http://www.vicidial.org/store.php#MANAGER 112. Added more logging for Asterisk AMD as well as beta AMD patch for logging - of NOAUDIODATA answered calls and more AMD stats gathering + of NOAUDIODATA answered calls and more AMD stats gathering. Also added + an AMD Log Report to the Admin Utilities page. diff --git a/www/vicidial/AST_AMD_log_report.php b/www/vicidial/AST_AMD_log_report.php new file mode 100644 index 00000000..9e96ba7f --- /dev/null +++ b/www/vicidial/AST_AMD_log_report.php @@ -0,0 +1,688 @@ + LICENSE: AGPLv2 +# +# CHANGES +# 190329-1852 - First build, based on AST_carrier_log_report.php +# + +$startMS = microtime(); + +$report_name='AMD Log Report'; + +require("dbconnect_mysqli.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["query_date_D"])) {$query_date_D=$_GET["query_date_D"];} + elseif (isset($_POST["query_date_D"])) {$query_date_D=$_POST["query_date_D"];} +if (isset($_GET["query_date_T"])) {$query_date_T=$_GET["query_date_T"];} + elseif (isset($_POST["query_date_T"])) {$query_date_T=$_POST["query_date_T"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["AMDSTATUS"])) {$AMDSTATUS=$_GET["AMDSTATUS"];} + elseif (isset($_POST["AMDSTATUS"])) {$AMDSTATUS=$_POST["AMDSTATUS"];} +if (isset($_GET["AMDRESPONSE"])) {$AMDRESPONSE=$_GET["AMDRESPONSE"];} + elseif (isset($_POST["AMDRESPONSE"])) {$AMDRESPONSE=$_POST["AMDRESPONSE"];} +if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} + elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} +if (isset($_GET["lower_limit"])) {$lower_limit=$_GET["lower_limit"];} + elseif (isset($_POST["lower_limit"])) {$lower_limit=$_POST["lower_limit"];} +if (isset($_GET["upper_limit"])) {$upper_limit=$_GET["upper_limit"];} + elseif (isset($_POST["upper_limit"])) {$upper_limit=$_POST["upper_limit"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} + elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} + +$START_TIME=date("U"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method FROM system_settings;"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$qm_conf_ct = mysqli_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $SSenable_languages = $row[4]; + $SSlanguage_method = $row[5]; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +if ($non_latin < 1) + { + $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER); + $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW); + } +else + { + $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW); + $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER); + } + +$stmt="SELECT selected_language from vicidial_users where user='$PHP_AUTH_USER';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_to_mysqli($stmt, $link); +$sl_ct = mysqli_num_rows($rslt); +if ($sl_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $VUselected_language = $row[0]; + } + +$auth=0; +$reports_auth=0; +$admin_auth=0; +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); +if ($auth_message == 'GOOD') + {$auth=1;} + +if ($auth > 0) + { + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports='1';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $admin_auth=$row[0]; + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports='1';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $reports_auth=$row[0]; + + if ($reports_auth < 1) + { + $VDdisplayMESSAGE = _QXZ("You are not allowed to view reports"); + Header ("Content-type: text/html; charset=utf-8"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; + exit; + } + if ( ($reports_auth > 0) and ($admin_auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + } +else + { + $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again"); + if ($auth_message == 'LOCK') + { + $VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes"); + Header ("Content-type: text/html; charset=utf-8"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; + exit; + } + if ($auth_message == 'IPBLOCK') + { + $VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed") . ": $ip"; + Header ("Content-type: text/html; charset=utf-8"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; + exit; + } + Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; + exit; + } + + +##### BEGIN log visit to the vicidial_report_log table ##### +$LOGip = getenv("REMOTE_ADDR"); +$LOGbrowser = getenv("HTTP_USER_AGENT"); +$LOGscript_name = getenv("SCRIPT_NAME"); +$LOGserver_name = getenv("SERVER_NAME"); +$LOGserver_port = getenv("SERVER_PORT"); +$LOGrequest_uri = getenv("REQUEST_URI"); +$LOGhttp_referer = getenv("HTTP_REFERER"); +$LOGbrowser=preg_replace("/\'|\"|\\\\/","",$LOGbrowser); +$LOGrequest_uri=preg_replace("/\'|\"|\\\\/","",$LOGrequest_uri); +$LOGhttp_referer=preg_replace("/\'|\"|\\\\/","",$LOGhttp_referer); +if (preg_match("/443/i",$LOGserver_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +if (($LOGserver_port == '80') or ($LOGserver_port == '443') ) {$LOGserver_port='';} +else {$LOGserver_port = ":$LOGserver_port";} +$LOGfull_url = "$HTTPprotocol$LOGserver_name$LOGserver_port$LOGrequest_uri"; + +$LOGhostname = php_uname('n'); +if (strlen($LOGhostname)<1) {$LOGhostname='X';} +if (strlen($LOGserver_name)<1) {$LOGserver_name='X';} + +$stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$LOGserver_name' and hostname='$LOGhostname' LIMIT 1;"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {echo "$stmt\n";} +$webserver_id_ct = mysqli_num_rows($rslt); +if ($webserver_id_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $webserver_id = $row[0]; + } +else + { + ##### insert webserver entry + $stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$LOGserver_name','$LOGhostname');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $webserver_id = mysqli_insert_id($link); + } + +$stmt="INSERT INTO vicidial_report_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$LOGip', report_name='$report_name', browser='$LOGbrowser', referer='$LOGhttp_referer', notes='$LOGserver_name:$LOGserver_port $LOGscript_name', url='$LOGfull_url', webserver='$webserver_id';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_to_mysqli($stmt, $link); +$report_log_id = mysqli_insert_id($link); +##### END log visit to the vicidial_report_log table ##### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysqli_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect_mysqli.php"); + $MAIN.="\n"; + } + +if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";} +if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";} +$NOW_DATE = date("Y-m-d"); +if (!isset($server_ip)) {$server_ip = array();} +if (!isset($AMDSTATUS)) {$AMDSTATUS = array();} +if (!isset($AMDRESPONSE)) {$AMDRESPONSE = array();} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$master_AMDSTATUS_array=array("HANGUP", "HUMAN", "MACHINE", "NOTSURE"); +$master_AMDRESPONSE_array=array("HUMAN", "INITIALSILENCE", "LONGGREETING", "MAXWORDLENGTH", "MAXWORDS", "NOAUDIODATA", "TOOLONG"); + +$AMDSTATUSes_to_print=count($master_AMDSTATUS_array); +$AMDRESPONSEs_to_print=count($master_AMDRESPONSE_array); + +$server_ip_string='|'; +$server_ip_ct = count($server_ip); +$i=0; +while($i < $server_ip_ct) + { + $server_ip_string .= "$server_ip[$i]|"; + $i++; + } + +$server_stmt="SELECT server_ip,server_description from servers where active_asterisk_server='Y' order by server_ip asc"; +if ($DB) {echo "|$server_stmt|\n";} +$server_rslt=mysql_to_mysqli($server_stmt, $link); +$servers_to_print=mysqli_num_rows($server_rslt); +$i=0; +while ($i < $servers_to_print) + { + $row=mysqli_fetch_row($server_rslt); + $LISTserverIPs[$i] = $row[0]; + $LISTserver_names[$i] = $row[1]; + if (preg_match('/\-ALL/',$server_ip_string) ) + { + $server_ip[$i] = $LISTserverIPs[$i]; + } + $i++; + } + +$i=0; +$server_ips_string='|'; +$server_ip_ct = count($server_ip); +while($i < $server_ip_ct) + { + if ( (strlen($server_ip[$i]) > 0) and (preg_match("/\|$server_ip[$i]\|/",$server_ip_string)) ) + { + $server_ips_string .= "$server_ip[$i]|"; + $server_ip_SQL .= "'$server_ip[$i]',"; + $server_ipQS .= "&server_ip[]=$server_ip[$i]"; + } + $i++; + } + +if ( (preg_match('/\-\-ALL\-\-/',$server_ip_string) ) or ($server_ip_ct < 1) ) + { + $server_ip_SQL = ""; + $server_rpt_string="- ALL servers "; + if (preg_match('/\-\-ALL\-\-/',$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} + } +else + { + $server_ip_SQL = preg_replace('/,$/i', '',$server_ip_SQL); + $server_ip_SQL = "and server_ip IN($server_ip_SQL)"; + $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); + } +if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";} + +########### AMD STATUSES +$AMDSTATUS_string='|'; +$AMDRESPONSE_string='|'; + +$AMDSTATUS_ct = count($AMDSTATUS); +$AMDRESPONSE_ct = count($AMDRESPONSE); + +$i=0; +while($i < $AMDSTATUS_ct) + { + $AMDSTATUS_string .= "$AMDSTATUS[$i]|"; + $i++; + } + +$j=0; +while($j < $AMDRESPONSE_ct) + { + $AMDRESPONSE_string .= "$AMDRESPONSE[$j]|"; + $j++; + } + +$i=0; + +$i=0; $j=0; +$AMDSTATUSes_string='|'; +$AMDRESPONSEs_string='|'; +while($i < $AMDSTATUS_ct) + { + if ( (strlen($AMDSTATUS[$i]) > 0) and (preg_match("/\|$AMDSTATUS[$i]\|/",$AMDSTATUS_string)) ) + { + $AMDSTATUSes_string .= "$AMDSTATUS[$i]|"; + $AMDSTATUSQS .= "&AMDSTATUS[]=$AMDSTATUS[$i]"; + } + $i++; + } + +while ($j < $AMDRESPONSE_ct) + { + if ( (strlen($AMDRESPONSE[$j]) > 0) and (preg_match("/\|$AMDRESPONSE[$j]\|/",$AMDRESPONSE_string)) ) + { + $AMDRESPONSEs_string .= "$AMDRESPONSE[$j]|"; + $AMDRESPONSEQS .= "&AMDRESPONSE[]=$AMDRESPONSE[$j]"; + } + $j++; + } + +$i=0; +while($i < $AMDSTATUS_ct) + { + $j=0; + while ($j < $AMDRESPONSE_ct) + { + if ( (strlen($AMDSTATUS[$i]) > 0) and (preg_match("/\|$AMDSTATUS[$i]\|/",$AMDSTATUS_string)) and (strlen($AMDRESPONSE[$j]) > 0) and (preg_match("/\|$AMDRESPONSE[$j]\|/",$AMDRESPONSE_string)) ) + { + if ( preg_match('/\-\-ALL\-\-/',$AMDSTATUS_string) ) {$HC_subclause="";} else {$HC_subclause="AMDSTATUS='$AMDSTATUS[$i]'";} + if ( preg_match('/\-\-ALL\-\-/',$AMDRESPONSE_string) ) {$DS_subclause="";} else {$DS_subclause="AMDRESPONSE='$AMDRESPONSE[$j]'";} + if ($HC_subclause=="" || $DS_subclause=="") {$conjunction="";} else {$conjunction=" and ";} + $AMDSTATUS_SQL .= "($HC_subclause$conjunction$DS_subclause) OR"; + $AMDSTATUS_SQL=preg_replace('/\(\) OR$/', '', $AMDSTATUS_SQL); + #$AMDSTATUS_SQL .= "(AMDSTATUS='$AMDSTATUS[$i]' and AMDRESPONSE='$AMDRESPONSE[$j]') OR"; + } + $j++; + } + $i++; + } + +if ( (preg_match('/\-\-ALL\-\-/',$AMDSTATUS_string) ) or ($AMDSTATUS_ct < 1) ) + { + $HC_rpt_string="- "._QXZ("ALL AMD statuses")." "; + if (preg_match('/\-\-ALL\-\-/',$AMDSTATUS_string)) {$AMDSTATUSQS="&AMDSTATUS[]=--ALL--";} + } +else + { + $AMDSTATUSes_string=preg_replace('/\!/', "-", $AMDSTATUSes_string); + $HC_rpt_string="AND AMD status(es) ".preg_replace('/\|/', ", ", substr($AMDSTATUSes_string, 1, -1)); + } + +if ( (preg_match('/\-\-ALL\-\-/',$AMDRESPONSE_string) ) or ($AMDRESPONSE_ct < 1) ) + { + $AMDRESPONSE_SQL = ""; + $DS_rpt_string="- "._QXZ("ALL AMD responses")." "; + if (preg_match('/\-\-ALL\-\-/',$AMDRESPONSE_string)) {$AMDRESPONSEQS="&AMDRESPONSE[]=--ALL--";} + } +else + { + #$AMDSTATUS_SQL=preg_replace('/ OR$/', '', $AMDSTATUS_SQL); + #$AMDSTATUS_SQL = preg_replace('/,$/i', '',$AMDSTATUS_SQL); + #$AMDSTATUS_SQL = "and ($AMDSTATUS_SQL)"; + $AMDRESPONSEs_string=preg_replace('/\!/', "-", $AMDRESPONSEs_string); + $DS_rpt_string="AND AMD respons(es) ".preg_replace('/\|/', ", ", substr($AMDRESPONSEs_string, 1, -1)); + } +$AMDSTATUS_SQL=preg_replace('/ OR$/', '', $AMDSTATUS_SQL); +$AMDSTATUS_SQL = preg_replace('/,$/i', '',$AMDSTATUS_SQL); +$AMDSTATUS_SQL = "and ($AMDSTATUS_SQL)"; + +require("screen_colors.php"); + +if (strlen($AMDSTATUS_SQL)<7) {$AMDSTATUS_SQL="";} + +######################## +$HEADER.="\n"; +$HEADER.="
\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="\n"; +$HEADER.="";
+$MAIN.="\n";
+
+
+}
+ if ($file_download>0) {
+ $FILE_TIME = date("Ymd-His");
+ $CSVfilename = "AST_AMD_log_report_$US$FILE_TIME.csv";
+ $CSV_text=preg_replace('/ +\"/', '"', $CSV_text);
+ $CSV_text=preg_replace('/\" +/', '"', $CSV_text);
+ // We'll be outputting a TXT file
+ header('Content-type: application/octet-stream');
+
+ // It will be called LIST_101_20090209-121212.txt
+ header("Content-Disposition: attachment; filename=\"$CSVfilename\"");
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Pragma: public');
+ ob_clean();
+ flush();
+
+ echo "$CSV_text";
+
+ } else {
+ echo $HEADER;
+ require("admin_header.php");
+ echo $MAIN;
+ }
+
+if ($db_source == 'S')
+ {
+ mysqli_close($link);
+ $use_slave_server=0;
+ $db_source = 'M';
+ require("dbconnect_mysqli.php");
+ }
+
+$endMS = microtime();
+$startMSary = explode(" ",$startMS);
+$endMSary = explode(" ",$endMS);
+$runS = ($endMSary[0] - $startMSary[0]);
+$runM = ($endMSary[1] - $startMSary[1]);
+$TOTALrun = ($runS + $runM);
+
+$END_TIME=date("U");
+
+#print "Total run time: ".($END_TIME-$START_TIME);
+
+$stmt="UPDATE vicidial_report_log set run_time='$TOTALrun' where report_log_id='$report_log_id';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_to_mysqli($stmt, $link);
+
+exit;
+
+?>
diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php
index 6ef005a4..fca495ff 100644
--- a/www/vicidial/admin.php
+++ b/www/vicidial/admin.php
@@ -120,9 +120,9 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
$QUERY_STRING = getenv("QUERY_STRING");
-$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Asterisk Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report';
+$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Asterisk Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report, AMD Log Report';
-$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound Email Report, Inbound Chat Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary, Report Page Servers Summary, Admin Utilities Page, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report';
+$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound Email Report, Inbound Chat Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary, Report Page Servers Summary, Admin Utilities Page, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report, AMD Log Report';
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
@@ -4485,12 +4485,13 @@ else
# 190311-2153 - Added indicators for lists being assigned to non-existing campaigns
# 190312-0928 - Added more hide_call_log_info options
# 190327-2311 - Added READ_ONLY settings container type
+# 190329-1909 - Added AMD Log Report
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
-$admin_version = '2.14-705a';
-$build = '190327-2311';
+$admin_version = '2.14-706a';
+$build = '190329-1909';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -41850,6 +41851,7 @@ if ($ADD==999994)
echo "| $outbound_cid $caller_code | $row[0] | \n";
+ $AMDSTATUS=''; $AMDRESPONSE='';
+ $stmtA="SELECT AMDSTATUS,AMDRESPONSE FROM vicidial_amd_log WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and caller_code='$caller_code';";
+ $rsltA=mysql_to_mysqli($stmtA, $link);
+ $amd_to_print = mysqli_num_rows($rslt);
+ if ($amd_to_print > 0)
+ {
+ $rowA=mysqli_fetch_row($rsltA);
+ $AMDSTATUS = $rowA[0];
+ $AMDRESPONSE = $rowA[1];
+ $call_log .= " $AMDSTATUS | $AMDRESPONSE | \n";
+ if (strlen($AMDSTATUS) > 0) {$AMDcount++;}
+ }
}
$call_log .= " |
| # | "._QXZ("DATE/TIME")." | "._QXZ("LENGTH")." | "._QXZ("STATUS")." | "._QXZ("TSR")." | "._QXZ("CAMPAIGN")." | "._QXZ("LIST")." | "._QXZ("LEAD")." | "._QXZ("HANGUP REASON")." | "._QXZ("PHONE")." | "._QXZ("CALLER ID")." | "._QXZ("UNIQUEID")." |
| # | "._QXZ("DATE/TIME")." | "._QXZ("LENGTH")." | "._QXZ("STATUS")." | "._QXZ("TSR")." | "._QXZ("CAMPAIGN")." | "._QXZ("LIST")." | "._QXZ("LEAD")." | "._QXZ("HANGUP REASON")." | "._QXZ("PHONE")." | "._QXZ("CALLER ID")." | "._QXZ("UNIQUEID")." | "; + if ($AMDcount > 0) + {echo ""._QXZ("AMD STATUS")." | "._QXZ("AMD RESPONSE")." | ";} + echo "