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 6c0a9328f3
commit 19792e4a18
17 changed files with 1159 additions and 257 deletions
+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;
?>