From ca6283101e04740046410fec2c1377ed8aba42ba Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 21 Jun 2012 11:41:53 +0000 Subject: [PATCH] Changed survey opt-in non-agent qm logging to log connection to VDAD agent git-svn-id: svn://192.168.202.10@1833 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi | 21 +++++++++++++++---- .../xml_rpc_audio_server_vicidial.php | 19 +++++++---------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index bc7440b7..0d9710c3 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -94,12 +94,13 @@ # 111201-1751 - Added grade-random next-agent-call option # 111219-2256 - Added max stats updating # 120529-2112 - Added safe_harbor_audio_field campaign option +# 120621-0726 - Changed survey opt-in non-agent qm logging to log connection to VDAD agent # $script = 'agi-VDAD_ALL_outbound.agi'; $AGILOG = '0'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=97; +$mysql_log_count=99; $one_mysql_log=0; @@ -1517,16 +1518,28 @@ if ($call_handle_method =~ /SURVEY/) if ($enable_queuemetrics_logging > 0) { + $qm_call_time = ($now_date_epoch - $start_time_epoch); + $qm_complete_time = ($now_date_epoch + 1); + $qm_complete_sec = ($qm_call_time + 1); + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") or die "Couldn't connect to database: " . DBI->errstr; if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/VDAD',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); - $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01079'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01098'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='CALLSTATUS',data1='$survey_status',serverid='$queuemetrics_log_id';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$qm_complete_time',call_id='$callerid',queue='$VDADcampaign',agent='Agent/VDAD',verb='COMPLETEAGENT',data1='0',data2='$qm_complete_sec',data3='1',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01099'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + + # $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; + # $Baffected_rows = $dbhB->do($stmtB); + # $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01079'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$qm_complete_time',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='CALLSTATUS',data1='$survey_status',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01080'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; diff --git a/agc_2-X/trunk/www/vicidial/xml_rpc_audio_server_vicidial.php b/agc_2-X/trunk/www/vicidial/xml_rpc_audio_server_vicidial.php index f8f70649..b28654da 100644 --- a/agc_2-X/trunk/www/vicidial/xml_rpc_audio_server_vicidial.php +++ b/agc_2-X/trunk/www/vicidial/xml_rpc_audio_server_vicidial.php @@ -3,7 +3,7 @@ # # Used for integration with QueueMetrics of audio recordings # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # Copyright (C) 2007 Lenz Emilitri LICENSE: ???? # # CHANGES @@ -12,6 +12,7 @@ # 91012-0641 - Fixed to work with non-sequential time_ids in the queue_log # 100127-0603 - Added OpenSuSE install instructions # 100903-0041 - Changed lead_id max length to 10 digits +# 120621-0728 - Added commented-out debug logging # // $Id: xmlrpc_audio_server.php,v 1.3 2007/11/12 17:53:09 lenz Exp $ @@ -70,6 +71,11 @@ function find_file( $ServerID, $AsteriskID, $QMUserID, $QMUserName ) global $FILE_ENCODING; global $FILE_DURATION; +# uncomment below to enable basic logging of requests +# $fp = fopen ("./qm_rpc_debug.txt", "a"); +# fwrite ($fp, date("U") . "|$ServerID|$AsteriskID|$QMUserID|$QMUserName|\n"); +# fclose($fp); + require("dbconnect.php"); require("functions.php"); @@ -301,17 +307,6 @@ function xmlrpc_find_file( $params ) { - - - - - - - - - - - function xmlrpc_listen_call( $params ) { global $CALL_FOUND; global $CALL_LISTEN_URL;