Added agent debug logging and report

git-svn-id: svn://192.168.202.10@2355 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2015-07-24 14:31:34 +00:00
parent ed73e7c992
commit 79a4605fa1
17 changed files with 1159 additions and 257 deletions
+5
View File
@@ -103,6 +103,11 @@ OTHER CHANGES:
versions 1.8 and higher. If upgrading, you will need to add "dtmf" to
the listencron user in manager.conf and reload asterisk.
19. Added agent screen debug logging, which will log almost all mouse clicks
and AJAX calls on the agent screen. Can be enabled for all agents or
only one agent. Also added report to display logs by date/time. These
agent debug logs are deleted after 7 days.
+33 -1
View File
@@ -99,9 +99,10 @@
# 141227-0957 - Changed to clear out old unavail voicemail greetings before copying custom greeting
# 150112-2018 - Added flag to delete voicemail greeting when changed from an audio file to empty
# 150307-1738 - Added custom meetme enter sounds(only works with Asterisk 1.8)
# 150724-0835 - Added purge of vicidial_ajax_log records older than 7 days to end of day process
#
$build = '150307-1738';
$build = '150724-0835';
$DB=0; # Debug flag
@@ -154,6 +155,19 @@ if ($RMsec < 10) {$RMsec = "0$RMsec";}
$RMSQLdate = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec";
$RMdate = "$RMyear-$RMmon-$RMmday";
### calculate the date and time for 7 days ago
$secX = time();
$SDtarget = ($secX - 604800); # 7 days ago
($SDsec,$SDmin,$SDhour,$SDmday,$SDmon,$SDyear,$SDwday,$SDyday,$SDisdst) = localtime($SDtarget);
$SDyear = ($SDyear + 1900);
$SDmon++;
if ($SDmon < 10) {$SDmon = "0$SDmon";}
if ($SDmday < 10) {$SDmday = "0$SDmday";}
if ($SDhour < 10) {$SDhour = "0$SDhour";}
if ($SDmin < 10) {$SDmin = "0$SDmin";}
if ($SDsec < 10) {$SDsec = "0$SDsec";}
$SDSQLdate = "$SDyear-$SDmon-$SDmday $SDhour:$SDmin:$SDsec";
$SDdate = "$SDyear-$SDmon-$SDmday";
### begin parsing run-time options ###
@@ -1256,6 +1270,24 @@ if ($timeclock_end_of_day_NOW > 0)
##### BEGIN vicidial_ajax_log end of day process removing records older than 7 days #####
$stmtA = "DELETE from vicidial_ajax_log where db_time < \"$SDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_ajax_log records older than 7 days purged|\n";}
$stmtA = "optimize table vicidial_ajax_log;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
##### END vicidial_ajax_log end of day process removing records older than 7 days #####
$dbhC = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_custom_user", "$VARDB_custom_pass")
or die "Couldn't connect to database: " . DBI->errstr;
+17 -2
View File
@@ -1599,7 +1599,8 @@ meetme_enter_leave3way_filename VARCHAR(255) default '',
enable_did_entry_list_id ENUM('0','1') default '0',
enable_third_webform ENUM('0','1') default '0',
chat_url VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL,
chat_timeout INT(3) unsigned DEFAULT NULL
chat_timeout INT(3) unsigned DEFAULT NULL,
agent_debug_logging VARCHAR(20) default '0'
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -3280,6 +3281,20 @@ PRIMARY KEY (dtmf_id),
KEY vicidial_dtmf_uniqueid_key (uniqueid)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE vicidial_ajax_log (
user VARCHAR(20) default '',
start_time DATETIME NOT NULL,
db_time DATETIME NOT NULL,
run_time VARCHAR(20) default '0',
php_script VARCHAR(40) NOT NULL,
action VARCHAR(100) default '',
lead_id INT(10) UNSIGNED default '0',
stage VARCHAR(100) default '',
session_name VARCHAR(40) default '',
last_sql TEXT,
KEY ajax_dbtime_key (db_time)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
@@ -3529,4 +3544,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1420',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1421',db_schema_update_date=NOW(),reload_timestamp=NOW();
+18
View File
@@ -217,3 +217,21 @@ KEY vicidial_dtmf_uniqueid_key (uniqueid)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
UPDATE system_settings SET db_schema_version='1420',db_schema_update_date=NOW() where db_schema_version < 1420;
CREATE TABLE vicidial_ajax_log (
user VARCHAR(20) default '',
start_time DATETIME NOT NULL,
db_time DATETIME NOT NULL,
run_time VARCHAR(20) default '0',
php_script VARCHAR(40) NOT NULL,
action VARCHAR(100) default '',
lead_id INT(10) UNSIGNED default '0',
stage VARCHAR(100) default '',
session_name VARCHAR(40) default '',
last_sql TEXT,
KEY ajax_dbtime_key (db_time)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE system_settings ADD agent_debug_logging VARCHAR(20) default '0';
UPDATE system_settings SET db_schema_version='1421',db_schema_update_date=NOW() where db_schema_version < 1421;
+19 -6
View File
@@ -1,7 +1,7 @@
<?php
# active_list_refresh.php version 2.10
# active_list_refresh.php version 2.12
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to serve updates of the live data to the display scripts
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -45,10 +45,14 @@
# 140811-0850 - Changed to use QXZ function for echoing text
# 141128-0901 - Code cleanup for QXZ functions
# 141216-2119 - Added language settings lookups and user/pass variable standardization
# 150723-1715 - Added ajax logging
#
$version = '0.0.16';
$build = '141216-2119';
$version = '0.0.17';
$build = '150723-1715';
$php_script = 'active_list_refresh.php';
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -142,7 +146,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -153,6 +157,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -161,6 +166,13 @@ if ($non_latin < 1)
{
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$auth=0;
$auth_message = user_authorization($user,$pass,'',0,1,0);
@@ -511,7 +523,8 @@ $ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
if ($format=='table') {echo "\n<!-- script runtime: $RUNtime seconds -->";}
if ($format=='table') {echo "\n</body>\n</html>\n";}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
?>
+24 -11
View File
@@ -1,7 +1,7 @@
<?php
# call_log_display.php version 2.10
# call_log_display.php version 2.12
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send the inbound and outbound calls for a specific phone
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -37,10 +37,14 @@
# 141118-1232 - Formatting changes for QXZ output
# 141128-0852 - Code cleanup for QXZ functions
# 141216-2113 - Added language settings lookups and user/pass variable standardization
# 150723-1714 - Added ajax logging
#
$version = '0.0.11';
$build = '141216-2113';
$version = '0.0.12';
$build = '150723-1714';
$php_script = 'call_log_display.php';
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -52,14 +56,14 @@ if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
$user=preg_replace("/\'|\"|\\\\|;| /","",$user);
$pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
@@ -94,7 +98,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -105,6 +109,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -113,6 +118,13 @@ if ($non_latin < 1)
{
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$auth=0;
$auth_message = user_authorization($user,$pass,'',0,1,0);
@@ -236,7 +248,8 @@ if ($format=='debug')
echo "\n<!-- script runtime: $RUNtime seconds -->";
echo "\n</body>\n</html>\n";
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
?>
+45 -5
View File
@@ -1,7 +1,7 @@
<?php
# conf_exten_check.php version 2.10
# conf_exten_check.php version 2.12
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -67,14 +67,18 @@
# 141128-0853 - Code cleanup for QXZ functions
# 141216-2111 - Added language settings lookups and user/pass variable standardization
# 141228-0053 - Found missing phrase for QXZ
# 150723-1708 - Added ajax logging and agent screen click logging
#
$version = '2.10-42';
$build = '141228-0053';
$version = '2.12-43';
$build = '150723-1708';
$php_script = 'conf_exten_check.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=40;
$one_mysql_log=0;
$DB=0;
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -108,6 +112,8 @@ if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"
elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];}
if (isset($_GET["bcrypt"])) {$bcrypt=$_GET["bcrypt"];}
elseif (isset($_POST["bcrypt"])) {$bcrypt=$_POST["bcrypt"];}
if (isset($_GET["clicks"])) {$clicks=$_GET["clicks"];}
elseif (isset($_POST["clicks"])) {$clicks=$_POST["clicks"];}
if ($bcrypt == 'OFF')
{$bcrypt=0;}
@@ -134,7 +140,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -145,6 +151,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -161,6 +168,13 @@ $server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($client)) {$client="agc";}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$Alogin='N';
$RingCalls='N';
@@ -792,7 +806,33 @@ if ($format=='debug')
echo "\n<!-- script runtime: $RUNtime seconds -->";
echo "\n</body>\n</html>\n";
}
if ($SSagent_debug_logging > 0)
{
vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);
### log the clicks that are sent from the agent screen
if (strlen($clicks) > 1)
{
$cd=0;
$clicks = preg_replace("/\|$/",'',$clicks);
$clicks_details = explode('|',$clicks);
$clicks_details_ct = count($clicks_details);
while($cd < $clicks_details_ct)
{
$click_data = explode('-----',$clicks_details[$cd]);
$click_time = $click_data[0];
$click_function_data = explode('---',$click_data[1]);
$click_function = $click_function_data[0];
$click_options = $click_function_data[1];
$stmtA="INSERT INTO vicidial_ajax_log set user='$user',start_time='$click_time',db_time=NOW(),run_time='0',php_script='vicidial.php',action='$click_function',lead_id='$lead_id',stage='$cd|$click_options',session_name='$session_name',last_sql='';";
$rslt=mysql_to_mysqli($stmtA, $link);
$cd++;
}
}
}
exit;
?>
+25
View File
@@ -27,6 +27,7 @@
# 150108-1647 - removed phones count as part of validation, can cause problems when there are many phones
# 150111-1541 - Added lists option: local call time(Issue #812)
# 150512-0615 - Fix for non-latin customer data
# 150724-0843 - Added vicidial_ajax_log function
#
# $mysql_queries = 20
@@ -2026,6 +2027,30 @@ function dialable_gmt($DB,$link,$local_call_time,$gmt_offset,$state)
##### AJAX process logging #####
function vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt)
{
$endMS = microtime();
$startMSary = explode(" ",$startMS);
$endMSary = explode(" ",$endMS);
$runS = ($endMSary[0] - $startMSary[0]);
$runM = ($endMSary[1] - $startMSary[1]);
$TOTALrun = ($runS + $runM);
$stmt = preg_replace('/;/', '', $stmt);
$stmt = addslashes($stmt);
$stmtA="INSERT INTO vicidial_ajax_log set user='$user',start_time='$NOW_TIME',db_time=NOW(),run_time='$TOTALrun',php_script='$php_script',action='$ACTION',lead_id='$lead_id',stage='$stage',session_name='$session_name',last_sql=\"$stmt\";";
$rslt=mysql_to_mysqli($stmtA, $link);
# $ajx = fopen ("./vicidial_ajax_log.txt", "a");
# fwrite ($ajx, $stmtA . "\n");
# fclose($ajx);
return 1;
}
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
+19 -6
View File
@@ -1,7 +1,7 @@
<?php
# live_exten_check.php version 2.10
# live_exten_check.php version 2.12
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the client channel is live and to what channel it is connected
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -38,10 +38,14 @@
# 141118-1236 - Formatting changes for QXZ output
# 141128-0854 - Code cleanup for QXZ functions
# 141216-2109 - Added language settings lookups and user/pass variable standardization
# 150723-1713 - Added ajax logging
#
$version = '2.10-15';
$build = '141216-2109';
$version = '2.10-16';
$build = '150723-1713';
$php_script = 'live_exten_check.php';
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -94,7 +98,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -105,6 +109,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -113,6 +118,13 @@ if ($non_latin < 1)
{
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$auth=0;
$auth_message = user_authorization($user,$pass,'',0,1,0);
@@ -318,7 +330,8 @@ if ($format=='debug')
echo "\n<!-- script runtime: $RUNtime seconds -->";
echo "\n</body>\n</html>\n";
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
?>
+20 -4
View File
@@ -125,13 +125,17 @@
# 141216-2107 - Added language settings lookups and user/pass variable standardization
# 150307-1837 - Added leave 3way custom sound context
# 150701-1208 - Modified mysqli_error() to mysqli_connect_error() where appropriate
# 150723-1643 - Added ajax logging
#
$version = '2.12-72';
$build = '150701-1208';
$version = '2.12-73';
$build = '150723-1643';
$php_script = 'manager_send.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=129;
$one_mysql_log=0;
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -264,7 +268,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,allow_sipsak_messages,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename FROM system_settings;";
$stmt = "SELECT use_non_latin,allow_sipsak_messages,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -278,6 +282,7 @@ if ($qm_conf_ct > 0)
$SSlanguage_method = $row[3];
$meetme_enter_login_filename = $row[4];
$meetme_enter_leave3way_filename = $row[5];
$SSagent_debug_logging = $row[6];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -287,6 +292,13 @@ if ($non_latin < 1)
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
$secondS = preg_replace("/[^0-9]/","",$secondS);
}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$threeway_context = $ext_context;
if (strlen($meetme_enter_leave3way_filename) > 0)
@@ -476,6 +488,7 @@ if ($ACTION=="Originate")
if ( (preg_match('/MANUAL/i',$agent_dialed_type)) and ( (preg_match("/^\d860\d\d\d\d$/i",$exten)) or (preg_match("/^860\d\d\d\d$/i",$exten)) ) )
{
echo "ERROR"._QXZ(" You are not allowed to dial into other agent sessions")." $exten\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
@@ -1578,6 +1591,7 @@ if ($ACTION=="RedirectXtraCXNeW")
echo "NeWSessioN|$exten|\n";
echo "|$stmtG|\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -1792,6 +1806,7 @@ if ($ACTION=="RedirectXtraNeW")
echo "NeWSessioN|$exten|\n";
echo "|$stmtB|\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -2280,7 +2295,8 @@ $ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
if ($format=='debug') {echo "\n<!-- script runtime: $RUNtime seconds -->";}
if ($format=='debug') {echo "\n</body>\n</html>\n";}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
+19 -6
View File
@@ -1,7 +1,7 @@
<?php
# park_calls_display.php version 2.10
# park_calls_display.php version 2.12
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send the details on the parked calls on the server
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -29,10 +29,14 @@
# 140811-0839 - Changed to use QXZ function for echoing text
# 141118-1237 - Formatting changes for QXZ output
# 141216-2105 - Added language settings lookups and user/pass variable standardization
# 150723-1712 - Added ajax logging
#
$version = '0.0.11';
$build = '141216-2105';
$version = '0.0.12';
$build = '150723-1712';
$php_script = 'park_calls_display.php';
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -82,7 +86,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -93,6 +97,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -101,6 +106,13 @@ if ($non_latin < 1)
{
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$auth=0;
@@ -186,7 +198,8 @@ if ($format=='debug')
echo "\n<!-- script runtime: $RUNtime seconds -->";
echo "\n</body>\n</html>\n";
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
?>
+66 -9
View File
@@ -383,14 +383,18 @@
# 150701-1205 - Modified mysqli_error() to mysqli_connect_error() where appropriate
# 150706-0903 - Added user lead filter option for no-hopper dialing
# 150711-0815 - Changed to allow for multiple Dispo Call URLs
# 150723-1705 - Added ajax logging
#
$version = '2.12-278';
$build = '150711-0815';
$version = '2.12-279';
$build = '150723-1705';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=616;
$one_mysql_log=0;
$DB=0;
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -814,7 +818,7 @@ $sip_hangup_cause_dictionary = array(
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -835,6 +839,7 @@ if ($qm_conf_ct > 0)
$callback_time_24hour = $row[10];
$SSenable_languages = $row[11];
$SSlanguage_method = $row[12];
$SSagent_debug_logging = $row[13];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -865,6 +870,13 @@ if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
$VUselected_language = '';
$stmt="SELECT selected_language from vicidial_users where user='$user';";
@@ -946,6 +958,7 @@ if ($ACTION == 'LogiNCamPaigns')
echo "<select size=1 name=VD_campaign id=VD_campaign onFocus=\"login_allowable_campaigns()\">\n";
echo "<option value=\"\">-- ERROR --</option>\n";
echo "</select>\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -1049,6 +1062,7 @@ if ($ACTION == 'LogiNCamPaigns')
echo "<select size=1 name=VD_campaign id=VD_campaign onFocus=\"login_allowable_campaigns()\">\n";
echo "<option value=\"\">-- "._QXZ("USER LOGIN ERROR")." --</option>\n";
echo "</select>\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -1129,6 +1143,7 @@ if ($ACTION == 'LogiNCamPaigns')
$VDdisplayMESSAGE.= _QXZ("Manager Password:")." <INPUT TYPE=PASSWORD NAME=\"MGR_pass$loginDATE\" SIZE=10 MAXLENGTH=20><br>\n";
$VDdisplayMESSAGE.= "<INPUT TYPE=submit NAME=SUBMIT VALUE="._QXZ("SUBMIT")."></FORM><BR><BR><BR><BR>\n";
echo "$VDdisplayMESSAGE";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -1187,6 +1202,7 @@ if ($ACTION == 'LogiNCamPaigns')
echo "<option value=\"\">-- "._QXZ("YOU MUST LOG IN TO THE TIMECLOCK FIRST")." --</option>\n";
echo "</select>\n";
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
@@ -1204,6 +1220,7 @@ if ($ACTION == 'regCLOSER')
{
$channel_live=0;
echo _QXZ("Group Choice is not valid").": $closer_choice\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -1440,6 +1457,7 @@ if ($ACTION == 'regTERRITORY')
{
$channel_live=0;
echo _QXZ("Territory Choice is not valid")."$agent_territories\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -1705,6 +1723,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$channel_live=0;
echo "HOPPER EMPTY\n";
echo _QXZ("Conf Exten %1s or campaign %2s or ext_context %3s is not valid",0,'',$conf_exten,$campaign,$ext_context)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -1995,6 +2014,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$VLAEDaffected_rows = mysqli_affected_rows($link);
echo "OUTSIDE OF LOCAL CALL TIME $VMDQaffected_rows|$VLAEDaffected_rows\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -2028,6 +2048,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$VLAEDaffected_rows = mysqli_affected_rows($link);
echo "DNC NUMBER\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
@@ -2068,6 +2089,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$VLAEDaffected_rows = mysqli_affected_rows($link);
echo "DNC NUMBER\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -2142,6 +2164,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$VLAEDaffected_rows = mysqli_affected_rows($link);
echo "NUMBER NOT IN CAMPLISTS\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -4196,6 +4219,7 @@ if ($ACTION == 'alt_phone_change')
$channel_live=0;
echo _QXZ("ALT PHONE NUMBER STATUS NOT CHANGED")."\n";
echo _QXZ("%1s %2s %3s or %4s is not valid",0,'',$phone_number,$stage,$lead_id,$called_count)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -4221,6 +4245,7 @@ if ($ACTION == 'AlertControl')
$channel_live=0;
echo _QXZ("AGENT ALERT SETTING NOT CHANGED")."\n";
echo _QXZ("%1s is not valid",0,'',$stage)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -4252,6 +4277,7 @@ if ($ACTION == 'manDiaLskip')
$channel_live=0;
echo "LEAD NOT REVERTED\n";
echo _QXZ("Conf Exten %1s or campaign %2s or ext_context %3s is not valid",0,'',$conf_exten,$campaign,$ext_context)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -4301,6 +4327,7 @@ if ($ACTION == 'manDiaLonly')
$channel_live=0;
echo " CALL NOT PLACED\n";
echo _QXZ("Conf Exten %1s or campaign %2s or ext_context %3s or phone_number %4s or lead_id %5s is not valid",0,'',$conf_exten,$campaign,$ext_context,$phone_number,$lead_id)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -4381,6 +4408,7 @@ if ($ACTION == 'manDiaLonly')
if ($row[0] > 0)
{
echo " CALL NOT PLACED\nDNC NUMBER\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
@@ -4408,6 +4436,7 @@ if ($ACTION == 'manDiaLonly')
if ($row[0] > 0)
{
echo " CALL NOT PLACED\nDNC NUMBER\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -4469,6 +4498,7 @@ if ($ACTION == 'manDiaLonly')
if ($row[0] < 1)
{
echo " CALL NOT PLACED\nNUMBER NOT IN CAMPLISTS\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -4880,6 +4910,7 @@ if ($ACTION == 'manDiaLlookCaLL')
{
echo "NO\n";
echo "MDnextCID $MDnextCID is not valid\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -5031,6 +5062,7 @@ if ($stage == "start")
echo "LOG NOT ENTERED\n";
echo _QXZ("uniqueid %1s or lead_id: %2s or list_id: %3s or phone_number: %4s or campaign: %5s is not valid",0,'',$uniqueid,$lead_id,$list_id,$phone_number,$campaign)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -6309,6 +6341,7 @@ if ($stage == "end")
fclose($fp);
exit;
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
}
$talk_sec=0;
@@ -6392,6 +6425,7 @@ if ($ACTION == 'VDADREcheckINCOMING')
echo "0\n";
echo _QXZ("Campaign %1s is not valid",0,'',$campaign)."\n";
echo _QXZ("lead_id %1s is not valid",0,'',$lead_id)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -6444,6 +6478,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$channel_live=0;
echo "0\n";
echo _QXZ("Campaign %1s is not valid",0,'',$campaign)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -7675,6 +7710,7 @@ if ($ACTION == 'VDADcheckINCOMING')
{
echo "0\n";
# echo "No calls in QUEUE for $user on $server_ip\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -7736,6 +7772,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$channel_live=0;
echo "0\n";
echo _QXZ("Campaign %1s is not valid",0,'',$campaign)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -8660,6 +8697,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
{
echo "0\n";
# echo "No calls in QUEUE for $user on $server_ip\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -8690,6 +8728,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
$channel_live=0;
echo "0\n";
echo _QXZ("Campaign %1s is not valid or lead_id %2s is not valid",0,'',$campaign,$lead_id)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -9387,6 +9426,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
{
echo "0\n";
# echo "No leads to update for $user on $server_ip\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -9406,6 +9446,7 @@ if ($ACTION == 'updateDISPO')
if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) )
{
echo _QXZ("Dispo Choice %1s or lead_id %2s is not valid",0,'',$dispo,$lead_id)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -11069,6 +11110,7 @@ if ($ACTION == 'RUNurls')
if (strlen($url_ids) < 2)
{
echo _QXZ("URL IDs are is not valid",0,'',$url_ids)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -11145,6 +11187,7 @@ if ($ACTION == 'updateLEAD')
if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) )
{
echo _QXZ("phone_number %1s or lead_id %2s is not valid",0,'',$phone_number,$lead_id)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -11251,6 +11294,7 @@ if ( ($ACTION == 'VDADpause') or ($ACTION == 'VDADready') or ($pause_trigger ==
if ( (strlen($vla_status)<2) or (strlen($server_ip)<1) )
{
echo _QXZ("stage %1s is not valid",0,'',$vla_status)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -11486,6 +11530,7 @@ if ($ACTION == 'userLOGout')
{
echo "NO\n";
echo _QXZ("campaign %1s or conf_exten %2s is not valid",0,'',$campaign,$conf_exten)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -11766,6 +11811,7 @@ if ($ACTION == 'UpdatEFavoritEs')
if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) )
{
echo _QXZ("favorites list %1s is not valid",0,'',$favorites_list)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -11804,6 +11850,7 @@ if ($ACTION == 'PauseCodeSubmit')
if ( (strlen($status)<1) or (strlen($agent_log_id)<1) )
{
echo _QXZ("agent_log_id %1s or pause_code %2s is not valid",0,'',$agent_log_id,$status)."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -12146,6 +12193,7 @@ if ($ACTION == 'CALLSINQUEUEview')
if (preg_match('/NONE/i',$view_calls_in_queue))
{
echo _QXZ("Calls in Queue View Disabled for this campaign")."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -12472,7 +12520,7 @@ if ($ACTION == 'CALLLOGview')
echo "<td align=right><font size=2> $ALLhangup_reason[$i] </td>\n";
echo "<td align=right><font size=2> <a href=\"#\" onclick=\"VieWLeaDInfO($ALLlead_id[$i]);return false;\"> "._QXZ("INFO")."</A> </td>\n";
if ($manual_dial_filter > 0)
{echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG','$ALLphone_code[$i]','$ALLphone_number[$i]','$ALLlead_id[$i]');return false;\"> "._QXZ("DIAL")." </A> </td>\n";}
{echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG','$ALLphone_code[$i]','$ALLphone_number[$i]','$ALLlead_id[$i]','','YES');return false;\"> "._QXZ("DIAL")." </A> </td>\n";}
else
{echo "<td align=right><font size=2> "._QXZ("DIAL")." </td>\n";}
echo "</tr>\n";
@@ -12582,6 +12630,7 @@ if ($ACTION == 'SEARCHRESULTSview')
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
@@ -12800,7 +12849,7 @@ if ($ACTION == 'SEARCHRESULTSview')
if ($inbound_lead_search < 1)
{
if ($manual_dial_filter > 0)
{echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('LEADSEARCH','$ALLphone_code[$i]','$ALLphone_number[$i]','$ALLlead_id[$i]');return false;\"> "._QXZ("DIAL")." </A> </td>\n";}
{echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('LEADSEARCH','$ALLphone_code[$i]','$ALLphone_number[$i]','$ALLlead_id[$i]','','YES');return false;\"> "._QXZ("DIAL")." </A> </td>\n";}
else
{echo "<td align=right><font size=2> "._QXZ("DIAL")." </td>\n";}
}
@@ -12833,6 +12882,7 @@ if ($ACTION == 'SEARCHRESULTSview')
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
##### END search queries and output #####
@@ -12843,6 +12893,7 @@ if ($ACTION == 'SEARCHRESULTSview')
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -13023,6 +13074,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
@@ -13163,6 +13215,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
##### END search queries and output #####
@@ -13173,6 +13226,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSContactsBox');return false;\">"._QXZ("Go Back")."</a>";
echo "</CENTER>";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -13452,7 +13506,7 @@ if ($ACTION == 'LEADINFOview')
if ($hide_dial_links < 1)
{
if ($manual_dial_filter > 0)
{$INFOout .= "<a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6], $lead_id);return false;\"> "._QXZ("DIAL")." </a>";}
{$INFOout .= "<a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6], $lead_id,'','YES');return false;\"> "._QXZ("DIAL")." </a>";}
else
{$INFOout .= _QXZ(" DIAL ");}
}
@@ -13460,7 +13514,7 @@ if ($ACTION == 'LEADINFOview')
if ( ($label_phone_number=='---HIDE---') and ($hide_dial_links < 1) )
{
if ($manual_dial_filter > 0)
{$INFOout .= "<tr bgcolor=white><td ALIGN=right><font size=2>"._QXZ("Dial Link:")." &nbsp; </td><td ALIGN=left><font size=2><a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6], $lead_id);return false;\"> "._QXZ("DIAL")." </a>";}
{$INFOout .= "<tr bgcolor=white><td ALIGN=right><font size=2>"._QXZ("Dial Link:")." &nbsp; </td><td ALIGN=left><font size=2><a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6], $lead_id,'','YES');return false;\"> "._QXZ("DIAL")." </a>";}
else
{$INFOout .= "<tr bgcolor=white><td ALIGN=right><font size=2>"._QXZ("Dial Link:")." &nbsp; </td><td ALIGN=left><font size=2>"._QXZ(" DIAL ");}
}
@@ -13498,7 +13552,7 @@ if ($ACTION == 'LEADINFOview')
if ($hide_dial_links < 1)
{
if ($manual_dial_filter > 0)
{$INFOout .= "<a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[20], $lead_id, 'ALT');return false;\"> "._QXZ("DIAL")." </a>";}
{$INFOout .= "<a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[20], $lead_id, 'ALT','YES');return false;\"> "._QXZ("DIAL")." </a>";}
else
{$INFOout .= " DIAL ";}
}
@@ -13833,6 +13887,7 @@ if ($ACTION == 'CALLSINQUEUEgrab')
if ( (preg_match('/NONE/i',$view_calls_in_queue)) or (preg_match('/N/i',$grab_calls_in_queue)) )
{
echo "ERROR: "._QXZ("Calls in Queue View Disabled for this campaign")."\n";
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
else
@@ -13887,6 +13942,7 @@ if ($ACTION == 'CALLSINQUEUEgrab')
fclose($fp);
}
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
}
}
@@ -14099,7 +14155,8 @@ if ($format=='debug')
echo "\n<!-- script runtime: $RUNtime seconds -->";
echo "\n</body>\n</html>\n";
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
+346 -195
View File
File diff suppressed because it is too large Load Diff
+19 -6
View File
@@ -1,7 +1,7 @@
<?php
# voicemail_check.php version 2.10
# voicemail_check.php version 2.12
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to check whether the voicemail box on the server defined has new and old messages
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -29,10 +29,14 @@
# 140811-0801 - Changed to use QXZ function for echoing text
# 141118-1240 - Formatting changes for QXZ output
# 141216-1902 - Added language settings lookups and user/pass variable standardization
# 150723-1711 - Added ajax logging
#
$version = '0.0.12';
$build = '141216-1902';
$version = '0.0.13';
$build = '150723-1711';
$php_script = 'voicemail_check.php';
$SSagent_debug_logging=0;
$startMS = microtime();
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -79,7 +83,7 @@ if ($sl_ct > 0)
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -90,6 +94,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -103,6 +108,13 @@ $auth=0;
$auth_message = user_authorization($user,$pass,'',0,1,0);
if ($auth_message == 'GOOD')
{$auth=1;}
if (strlen($SSagent_debug_logging) > 1)
{
if ($SSagent_debug_logging == "$user")
{$SSagent_debug_logging=1;}
else
{$SSagent_debug_logging=0;}
}
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
@@ -178,7 +190,8 @@ if ($format=='debug')
echo "\n<!-- script runtime: $RUNtime seconds -->";
echo "\n</body>\n</html>\n";
}
if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);}
exit;
?>
+464
View File
@@ -0,0 +1,464 @@
<?php
# AST_agent_debug_log_report.php
#
# Copyright (C) 2015 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 150724-0740 - First build
#
$startMS = microtime();
require("dbconnect_mysqli.php");
require("functions.php");
$report_name='Agent Debug Log Report';
$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["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"];}
#############################################
##### 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 #####
###########################################
$NOW_DATE = date("Y-m-d");
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);
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;
}
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");
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.="<!-- Using slave server $slave_db_server $db_source -->\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";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
/*
$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;";
$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="- "._QXZ("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="";}
*/
$HEADER.="<HTML>\n";
$HEADER.="<HEAD>\n";
$HEADER.="<STYLE type=\"text/css\">\n";
$HEADER.="<!--\n";
$HEADER.=" .green {color: white; background-color: green}\n";
$HEADER.=" .red {color: white; background-color: red}\n";
$HEADER.=" .blue {color: white; background-color: blue}\n";
$HEADER.=" .purple {color: white; background-color: purple}\n";
$HEADER.="-->\n";
$HEADER.=" </STYLE>\n";
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
$HEADER.="<link rel=\"stylesheet\" href=\"verticalbargraph.css\">\n";
$HEADER.="<script language=\"JavaScript\" src=\"wz_jsgraphics.js\"></script>\n";
$HEADER.="<script language=\"JavaScript\" src=\"line.js\"></script>\n";
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
$HEADER.="<TITLE>"._QXZ("$report_name")."</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
$short_header=1;
$MAIN.="<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
$MAIN.="<TABLE BORDER=0 cellspacing=5 cellpadding=5><TR><TD VALIGN=TOP align=center>\n";
$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
$MAIN.=_QXZ("Date").":\n";
$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
$MAIN.="<script language=\"JavaScript\">\n";
$MAIN.="var o_cal = new tcal ({\n";
$MAIN.=" // form name\n";
$MAIN.=" 'formname': 'vicidial_report',\n";
$MAIN.=" // input name\n";
$MAIN.=" 'controlname': 'query_date'\n";
$MAIN.="});\n";
$MAIN.="o_cal.a_tpl.yearscroll = false;\n";
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
$MAIN.="</script>\n";
$MAIN.="<BR><BR><INPUT TYPE=TEXT NAME=query_date_D SIZE=9 MAXLENGTH=8 VALUE=\"$query_date_D\">";
$MAIN.="<BR> "._QXZ("to")." <BR><INPUT TYPE=TEXT NAME=query_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$query_date_T\">";
/*
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>"._QXZ("Server IP").":<BR/>\n";
$MAIN.="<SELECT SIZE=5 NAME=server_ip[] multiple>\n";
if (preg_match('/\-\-ALL\-\-/',$server_ip_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- "._QXZ("ALL SERVERS")." --</option>\n";}
else
{$MAIN.="<option value=\"--ALL--\">-- "._QXZ("ALL SERVERS")." --</option>\n";}
$o=0;
while ($servers_to_print > $o)
{
if (preg_match("/\|$LISTserverIPs[$o]\|/",$server_ip_string))
{$MAIN.="<option selected value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";}
else
{$MAIN.="<option value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";}
$o++;
}
$MAIN.="</SELECT></TD><TD ROWSPAN=2 VALIGN=middle align=center>\n";
*/
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'><BR/><BR/>\n";
$MAIN.="</TD></TR></TABLE>\n";
if ($SUBMIT) {
/*
$stmt="select hangup_cause, dialstatus, count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by hangup_cause, dialstatus order by hangup_cause, dialstatus";
$rslt=mysql_to_mysqli($stmt, $link);
$MAIN.="<PRE><font size=2>\n";
if ($DB) {$MAIN.=$stmt."\n";}
if (mysqli_num_rows($rslt)>0) {
$MAIN.="--- "._QXZ("DIAL STATUS BREAKDOWN FOR")." $query_date, $query_date_D "._QXZ("TO")." $query_date_T $server_rpt_string\n";
$MAIN.="+--------------+-------------+---------+\n";
$MAIN.="| "._QXZ("HANGUP CAUSE",12)." | "._QXZ("DIAL STATUS",11)." | "._QXZ("COUNT",7)." |\n";
$MAIN.="+--------------+-------------+---------+\n";
$total_count=0;
while ($row=mysqli_fetch_array($rslt)) {
$MAIN.="| ".sprintf("%-13s", $row["hangup_cause"]);
$MAIN.="| ".sprintf("%-12s", $row["dialstatus"]);
$MAIN.="| ".sprintf("%-8s", $row["ct"]);
$MAIN.="|\n";
$total_count+=$row["ct"];
}
$MAIN.="+--------------+-------------+---------+\n";
$MAIN.="| "._QXZ("TOTAL",26,"r")." | ".sprintf("%-8s", $total_count)."|\n";
$MAIN.="+--------------+-------------+---------+\n\n";
$stmt="select sip_hangup_cause,sip_hangup_reason,count(*) as ct From vicidial_carrier_log where call_date>='$query_date $query_date_D' and call_date<='$query_date $query_date_T' $server_ip_SQL group by sip_hangup_cause,sip_hangup_reason order by sip_hangup_cause,sip_hangup_reason";
$rslt=mysql_to_mysqli($stmt, $link);
$MAIN.="<PRE><font size=2>\n";
if ($DB) {$MAIN.=$stmt."\n";}
if (mysqli_num_rows($rslt)>0) {
$MAIN.="--- "._QXZ("SIP ERROR REASON BREAKDOWN FOR")." $query_date, $query_date_D "._QXZ("TO")." $query_date_T $server_rpt_string\n";
$MAIN.="+----------+--------------------------------+---------+\n";
$MAIN.="| "._QXZ("SIP CODE",8)." | "._QXZ("SIP HANGUP REASON",30)." | "._QXZ("COUNT",7)." |\n";
$MAIN.="+----------+--------------------------------+---------+\n";
$total_count=0;
while ($row=mysqli_fetch_array($rslt)) {
$MAIN.="| ".sprintf("%8s", $row["sip_hangup_cause"])." ";
$MAIN.="| ".sprintf("%-31s", $row["sip_hangup_reason"]);
$MAIN.="| ".sprintf("%-8s", $row["ct"]);
$MAIN.="|\n";
$total_count+=$row["ct"];
}
$MAIN.="+----------+--------------------------------+---------+\n";
$MAIN.="| "._QXZ("TOTAL",41,"r")." | ".sprintf("%-8s", $total_count)."|\n";
$MAIN.="+-------------------------------------------+---------+\n\n\n";
}
*/
$MAIN.="<PRE><font size=2>\n";
$rpt_stmt="select user,start_time,db_time,run_time,php_script,action,lead_id,stage from vicidial_ajax_log where db_time >= '$query_date $query_date_D' and db_time <= '$query_date $query_date_T' order by db_time desc;";
$rpt_rslt=mysql_to_mysqli($rpt_stmt, $link);
if ($DB) {$MAIN.=$rpt_stmt."\n";}
if (mysqli_num_rows($rpt_rslt)>0) {
if (!$lower_limit) {$lower_limit=1;}
if ($lower_limit+999>=mysqli_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysqli_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
$MAIN.="--- "._QXZ("AGENT SCREEN DEBUG LOG RECORDS FOR")." $query_date, $query_date_D "._QXZ("TO")." $query_date_T $server_rpt_string, "._QXZ("RECORDS")." #$lower_limit-$upper_limit <a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">["._QXZ("DOWNLOAD")."]</a>\n";
$agntdb_rpt.="+----------------------+---------------------+---------------------+------------+----------------------+------------------------------------------+------------+------------------------------------------+\n";
$agntdb_rpt.="| "._QXZ("USER",20)." | "._QXZ("SCREEN DATE",19)." | "._QXZ("DB DATE",19)." | "._QXZ("RUN TIME",10)." | "._QXZ("SCRIPT",20)." | "._QXZ("ACTION",40)." | "._QXZ("LEAD_ID",10)." | "._QXZ("STAGE",40)." |\n";
$agntdb_rpt.="+----------------------+---------------------+---------------------+------------+----------------------+------------------------------------------+------------+------------------------------------------+\n";
$CSV_text="\""._QXZ("USER")."\",\""._QXZ("SCREEN DATE")."\",\""._QXZ("DB DATE")."\",\""._QXZ("RUN TIME")."\",\""._QXZ("SCRIPT")."\",\""._QXZ("ACTION")."\",\""._QXZ("LEAD_ID")."\",\""._QXZ("STAGE")."\"\n";
for ($i=1; $i<=mysqli_num_rows($rpt_rslt); $i++) {
$row=mysqli_fetch_array($rpt_rslt);
$CSV_text.="\"$row[user]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$row[sip_hangup_cause]\",\"$row[sip_hangup_reason]\",\"$phone_number\"\n";
if ($i>=$lower_limit && $i<=$upper_limit) {
$agntdb_rpt.="| ".sprintf("%-20s", $row["user"]);
$agntdb_rpt.=" | ".sprintf("%-19s", $row["start_time"]);
$agntdb_rpt.=" | ".sprintf("%-19s", $row["db_time"]);
if (strlen($row["run_time"])>10) {$row["run_time"]=substr($row["run_time"],0,10)."";}
$agntdb_rpt.=" | ".sprintf("%-10s", $row["run_time"]);
$agntdb_rpt.=" | ".sprintf("%-20s", $row["php_script"]);
if (strlen($row["action"])>37) {$row["action"]=substr($row["action"],0,37)."...";}
$agntdb_rpt.=" | ".sprintf("%-40s", $row["action"]);
$agntdb_rpt.=" | ".sprintf("%-10s", $row["lead_id"]);
if (strlen($row["stage"])>37) {$row["stage"]=substr($row["stage"],0,37)."...";}
$agntdb_rpt.=" | ".sprintf("%-40s", $row["stage"])." |\n";
}
}
$agntdb_rpt.="+----------------------+---------------------+---------------------+------------+----------------------+------------------------------------------+------------+------------------------------------------+\n";
$agntdb_rpt_hf="";
$ll=$lower_limit-1000;
if ($ll>=1) {
$agntdb_rpt_hf.="<a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=$ll\">[<<< "._QXZ("PREV")." 1000 "._QXZ("records")."]</a>";
} else {
$agntdb_rpt_hf.=sprintf("%-23s", " ");
}
$agntdb_rpt_hf.=sprintf("%-145s", " ");
if (($lower_limit+1000)<mysqli_num_rows($rpt_rslt)) {
if ($upper_limit+1000>=mysqli_num_rows($rpt_rslt)) {$max_limit=mysqli_num_rows($rpt_rslt)-$upper_limit;} else {$max_limit=1000;}
$agntdb_rpt_hf.="<a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=".($lower_limit+1000)."\">["._QXZ("NEXT")." $max_limit "._QXZ("records")." >>>]</a>";
} else {
$agntdb_rpt_hf.=sprintf("%23s", " ");
}
$agntdb_rpt_hf.="\n";
$MAIN.=$agntdb_rpt_hf.$agntdb_rpt.$agntdb_rpt_hf;
} else {
$MAIN.="*** "._QXZ("NO RECORDS FOUND")." ***\n";
}
$MAIN.="</font></PRE>\n";
$MAIN.="</form></BODY></HTML>\n";
}
if ($file_download>0) {
$FILE_TIME = date("Ymd-His");
$CSVfilename = "AST_agent_debug_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);
$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;
?>
+14 -6
View File
File diff suppressed because one or more lines are too long
+6
View File
@@ -52,6 +52,7 @@
# 150610-0938 - Added campaigns-customer_gone_seconds
# 150708-2238 - Added max_queue_ingroup_ options
# 150710-1124 - Added explanation of new ALT URL feature and alt_multi_urls
# 150724-0047 - Added agent_debug_logging
#
require("dbconnect_mysqli.php");
@@ -4760,6 +4761,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
<BR>
<B><?php echo _QXZ("Enable DID Entry List ID"); ?> -</B><?php echo _QXZ("This setting if enabled will allow a manager to define an entry list id to use on the DID modify screen. Default is 0 for disabled."); ?>
<BR>
<A NAME="settings-agent_debug_logging">
<BR>
<B><?php echo _QXZ("Agent Screen Debug Logging"); ?> -</B><?php echo _QXZ("This setting if enabled will log almost all agent screen mouse clicks and AJAX processes triggered by the agent screen. To enable for all agents, set this option to 1. To enable only for one agent on the system, set this option to the user that you want to log. Warning, this feature can log hundreds of entries per phone call, so use with caution. These agent debug records are deleted after 7 days. Default is 0 for disabled."); ?>
<BR>
<A NAME="settings-enhanced_disconnect_logging">
<BR>