added run time logging to the api functions

git-svn-id: svn://192.168.202.10@1637 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-04-09 12:29:29 +00:00
parent 5081c832dc
commit 8a078adb0f
6 changed files with 36 additions and 7 deletions
+1
View File
@@ -491,6 +491,7 @@ OTHER CHANGES:
exten => _8331*.,1,Playback(sip-silence)
exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
exten => _8331*.,n,Hangup
115. Added ring_all Next Agent Call option for in-groups. This works with on-
+1
View File
@@ -55,6 +55,7 @@ Changes:
110306-1044 - Added add_list and update_list functions
110316-2035 - Added reset_time variable and NAMEPHONE dup search
110404-1356 - Added uniqueid search parameter to recording_lookup function
110409-0822 - Added run_time logging of API functions
@@ -1702,6 +1702,7 @@ result VARCHAR(10),
result_reason VARCHAR(255),
source VARCHAR(20),
data TEXT,
run_time VARCHAR(20) default '0',
index(api_date)
);
@@ -2453,7 +2454,7 @@ ALTER TABLE vicidial_call_notes_archive MODIFY notesid INT(9) UNSIGNED NOT NULL;
CREATE TABLE vicidial_lead_search_log_archive LIKE vicidial_lead_search_log;
ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNED NOT NULL;
UPDATE system_settings SET db_schema_version='1268',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1269',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+4
View File
@@ -731,3 +731,7 @@ UPDATE system_settings SET db_schema_version='1267',db_schema_update_date=NOW();
ALTER TABLE vicidial_campaigns MODIFY auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3','ALT_AND_EXTENDED','ALT_AND_ADDR3_AND_EXTENDED','EXTENDED_ONLY','MULTI_LEAD') default 'NONE';
UPDATE system_settings SET db_schema_version='1268',db_schema_update_date=NOW();
ALTER TABLE vicidial_api_log ADD run_time VARCHAR(20) default '0';
UPDATE system_settings SET db_schema_version='1269',db_schema_update_date=NOW();
+14 -3
View File
@@ -51,10 +51,13 @@
# 100914-1538 - Fixed bug in change_ingroups function
# 101123-1050 - Added manual dial queue features to external_dial function
# 110224-1711 - Added compatibility with QM phone environment logging
# 110409-0821 - Added run_time logging of API functions
#
$version = '2.4-18';
$build = '110224-1711';
$version = '2.4-19';
$build = '110409-0821';
$startMS = microtime();
require("dbconnect.php");
@@ -2435,8 +2438,16 @@ function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$val
{
if ($api_logging > 0)
{
global $startMS;
$endMS = microtime();
$startMSary = explode(" ",$startMS);
$endMSary = explode(" ",$endMS);
$runS = ($endMSary[0] - $startMSary[0]);
$runM = ($endMSary[1] - $startMSary[1]);
$TOTALrun = ($runS + $runM);
$NOW_TIME = date("Y-m-d H:i:s");
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script';";
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script',run_time='$TOTALrun';";
$rslt=mysql_query($stmt, $link);
}
return 1;
+14 -3
View File
@@ -45,10 +45,13 @@
# 110306-1044 - Added add_list and update_list functions
# 110316-2035 - Added reset_time variable and NAMEPHONE dup search
# 110404-1356 - Added uniqueid search parameter to recording_lookup function
# 110409-0822 - Added run_time logging of API functions
#
$version = '2.4-31';
$build = '110404-1356';
$version = '2.4-32';
$build = '110409-0822';
$startMS = microtime();
require("dbconnect.php");
@@ -4737,9 +4740,17 @@ function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$val
{
if ($api_logging > 0)
{
global $startMS;
$endMS = microtime();
$startMSary = explode(" ",$startMS);
$endMSary = explode(" ",$endMS);
$runS = ($endMSary[0] - $startMSary[0]);
$runM = ($endMSary[1] - $startMSary[1]);
$TOTALrun = ($runS + $runM);
$NOW_TIME = date("Y-m-d H:i:s");
# api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script';";
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script',run_time='$TOTALrun';";
$rslt=mysql_query($stmt, $link);
}
return 1;