From b22c0a7a9aa7f6652badf308acca7fd24ad75630 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 22 Aug 2011 17:15:16 +0000 Subject: [PATCH] Added optional DID Agent logging as System Settings option. This logs calls that come into DIDs in a separate table that includes the in-group and user that the call was sent to, if applicable git-svn-id: svn://192.168.202.10@1714 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 4 ++ agc_2-X/trunk/agi/agi-DID_route.agi | 57 +++++++++++++++---- agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 39 ++++++++++++- agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl | 52 +++++++++++++++++ .../trunk/extras/MySQL_AST_CREATE_tables.sql | 26 ++++++++- agc_2-X/trunk/extras/upgrade_2.4.sql | 26 +++++++++ .../TO_BE_TRANSLATED_2.4.txt | 3 + agc_2-X/trunk/www/vicidial/admin.php | 21 +++++-- 8 files changed, 206 insertions(+), 22 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 9ef1aba9..3f9a64f3 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -686,6 +686,10 @@ OTHER CHANGES: 156. Added update_phone, add_phone_alias, update_phone_alias functions to the Non-Agent API. +157. Added optional DID Agent logging as System Settings option. This logs calls + that come into DIDs in a separate table that includes the in-group and + user that the call was sent to, if applicable + diff --git a/agc_2-X/trunk/agi/agi-DID_route.agi b/agc_2-X/trunk/agi/agi-DID_route.agi index fb291f1e..25e85b77 100644 --- a/agc_2-X/trunk/agi/agi-DID_route.agi +++ b/agc_2-X/trunk/agi/agi-DID_route.agi @@ -13,7 +13,7 @@ # ;inbound DID catch-all: #exten => _X.,1,AGI(agi-DID_route.agi) # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # changes: # 81007-0324 - First Build @@ -26,6 +26,7 @@ # 100116-0631 - Logging bug fixes # 100123-1423 - Added record call DID option # 100805-0943 - Added Filter Phone Group alternate routing feature and CID number cleanup +# 110822-1210 - Added did_agent_log optional logging # $script = 'agi-DID_route.agi'; @@ -124,8 +125,8 @@ if ($sthArows > 0) $sthA->finish(); ############################################# -##### START QUEUEMETRICS LOGGING LOOKUP ##### -$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;"; +##### START SYSTEM SETTINGS LOOKUP ##### +$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend,did_agent_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -133,15 +134,21 @@ if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; $enable_queuemetrics_logging = $aryA[0]; - $queuemetrics_server_ip = $aryA[1]; - $queuemetrics_dbname = $aryA[2]; - $queuemetrics_login= $aryA[3]; - $queuemetrics_pass = $aryA[4]; - $queuemetrics_log_id = $aryA[5]; - $queuemetrics_eq_prepend = $aryA[6]; + $queuemetrics_server_ip = $aryA[1]; + $queuemetrics_dbname = $aryA[2]; + $queuemetrics_login= $aryA[3]; + $queuemetrics_pass = $aryA[4]; + $queuemetrics_log_id = $aryA[5]; + $queuemetrics_eq_prepend = $aryA[6]; + $did_agent_log = $aryA[7]; + $alt_log_server_ip = $aryA[8]; + $alt_log_dbname = $aryA[9]; + $alt_log_login = $aryA[10]; + $alt_log_pass = $aryA[11]; + $tables_use_alt_log_db = $aryA[12]; } $sthA->finish(); -##### END QUEUEMETRICS LOGGING LOOKUP ##### +##### END SYSTEM SETTINGS LOOKUP ##### ########################################### @@ -182,7 +189,7 @@ if ( (!$callerid) or ($callerid =~ /unknown/) ) ### Grab DID values from the database $DIDs_in_system=0; -$stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number FROM vicidial_inbound_dids where did_pattern = '$extension' and did_active='Y';"; +$stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number,group_id FROM vicidial_inbound_dids where did_pattern = '$extension' and did_active='Y';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -224,6 +231,7 @@ if ($sthArows > 0) $filter_phone_code = $aryA[32]; $filter_menu_id = $aryA[33]; $filter_clean_cid_number = $aryA[34]; + $group_id = $aryA[35]; $DIDs_in_system++; } @@ -232,7 +240,7 @@ $sthA->finish(); if ($sthArows < 1) { ### Grab DID values from the database for a default DID pattern if there is one - $stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number FROM vicidial_inbound_dids where did_pattern = 'default' and did_active='Y';"; + $stmtA = "SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number,group_id FROM vicidial_inbound_dids where did_pattern = 'default' and did_active='Y';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $DIDs_in_system=$sthA->rows; @@ -274,6 +282,7 @@ if ($sthArows < 1) $filter_phone_code = $aryA[32]; $filter_menu_id = $aryA[33]; $filter_clean_cid_number = $aryA[34]; + $group_id = $aryA[35]; } $sthA->finish(); } @@ -291,6 +300,30 @@ if ($AGILOG) {$agi_string = "-- CALL LOG : |$affected_rowsC|$stmtA|"; &agi_ if ($AGILOG) {$did_string = "$SQLdate|$uniqueid|$channel|$extension|$callerid|$calleridname|$did_id|$did_route|"; &did_output;} +if ($did_agent_log =~ /Y/) + { + if ($did_route !~ /IN_GROUP/) + {$group_id='';} + $stmtA = "INSERT INTO vicidial_did_agent_log SET uniqueid='$uniqueid',server_ip='$VARserver_ip',caller_id_number='$callerid',caller_id_name='$calleridname',extension='$extension',call_date='$SQLdate',did_id='$did_id',did_route='$did_route',user='VDCL',group_id='$group_id',did_description='$did_description';"; + + if ( ($tables_use_alt_log_db =~ /did_agent_log/i) && (length($alt_log_server_ip)>4) && (length($alt_log_dbname)>0) ) + { + $dbhD = DBI->connect("DBI:mysql:$alt_log_dbname:$alt_log_server_ip:3306", "$alt_log_login", "$alt_log_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($AGILOG) {$agi_string = "CONNECTED TO ALT-LOG DATABASE: $alt_log_server_ip|$alt_log_dbname|$uniqueid"; &agi_output;} + + $affected_rowsAL = $dbhD->do($stmtA); + + $dbhD->disconnect(); + } + else + { + $affected_rowsAL = $dbhA->do($stmtA); + } + if ($AGILOG) {$agi_string = "-- DID AGENT LOG : |$affected_rowsAL|$stmtA|"; &agi_output;} + } + if ($DIDs_in_system < 1) { ### if nothing found, exit script diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index f0322127..01e86565 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -155,6 +155,7 @@ # 110707-1302 - Added last_inbound_call_time and finish to next agent call options # 110731-0141 - Added call_id variable to add_lead_url function calls # 110801-0841 - Added on_hook_cid option and group_calldate field +# 110822-1256 - Added optional did_agent_log logging # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -1509,8 +1510,8 @@ if ($call_handle_method =~ /CLOSER|DIGITID$/) } ############################################# -##### START QUEUEMETRICS LOGGING LOOKUP ##### -$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend,queuemetrics_pe_phone_append FROM system_settings;"; +##### START SYSTEM SETTINGS LOOKUP ##### +$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend,queuemetrics_pe_phone_append,did_agent_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db FROM system_settings;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1526,9 +1527,15 @@ if ($sthArows > 0) $queuemetrics_log_id = $aryA[5]; $queuemetrics_eq_prepend = $aryA[6]; $queuemetrics_pe_phone_append = $aryA[7]; + $did_agent_log = $aryA[8]; + $alt_log_server_ip = $aryA[9]; + $alt_log_dbname = $aryA[10]; + $alt_log_login = $aryA[11]; + $alt_log_pass = $aryA[12]; + $tables_use_alt_log_db = $aryA[13]; } $sthA->finish(); -##### END QUEUEMETRICS LOGGING LOOKUP ##### +##### END SYSTEM SETTINGS LOOKUP ##### ########################################### if ($enable_queuemetrics_logging > 0) { @@ -2420,6 +2427,32 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) ) $alertVDADremDIALstr .= "$dtmf_silent_prefix$VDADconf_exten"; $VDADremDIALstr .= "$VDADconf_exten"; + + ### BEGIN if did agent log is active, update the user ### + if ($did_agent_log =~ /Y/) + { + $stmtA = "UPDATE vicidial_did_agent_log SET user='$VDADuser' where uniqueid='$uniqueid' and user='VDCL' order by call_date desc limit 1;"; + + if ( ($tables_use_alt_log_db =~ /did_agent_log/i) && (length($alt_log_server_ip)>4) && (length($alt_log_dbname)>0) ) + { + $dbhD = DBI->connect("DBI:mysql:$alt_log_dbname:$alt_log_server_ip:3306", "$alt_log_login", "$alt_log_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($AGILOG) {$agi_string = "CONNECTED TO ALT-LOG DATABASE: $alt_log_server_ip|$alt_log_dbname|$uniqueid"; &agi_output;} + + $affected_rowsAL = $dbhD->do($stmtA); + + $dbhD->disconnect(); + } + else + { + $affected_rowsAL = $dbhA->do($stmtA); + } + if ($AGILOG) {$agi_string = "-- DID AGENT LOG UPDATE: |$affected_rowsAL|$stmtA|"; &agi_output;} + } + ### END if did agent log is active, update the user ### + + ### if agent alert exten is not disabled, then trigger the alert and wait if ( ($agent_alert_exten !~ /^X$/i) && (length($agent_alert_exten)>0) && ($no_delay_call_route !~ /Y/i) && ($VDADextension !~ /^R\//) ) { diff --git a/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl b/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl index 553e2c13..14240227 100644 --- a/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl +++ b/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl @@ -33,6 +33,7 @@ # 110525-1040 - Added vicidial_outbound_ivr_log archiving # 110801-2140 - Added vicidial_url_log table purging and vicidial_log_extended to rolling processes # 110808-0055 - Added vicidial_log_noanswer process +# 110822-1257 - Added did_agent_log process # ### begin parsing run-time options ### @@ -508,6 +509,57 @@ if (!$T) + ##### vicidial_did_agent_log + $stmtA = "SELECT count(*) from vicidial_did_agent_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_did_agent_log_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_did_agent_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_did_agent_log_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing vicidial_did_agent_log table... ($vicidial_did_agent_log_count|$vicidial_did_agent_log_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO vicidial_did_agent_log_archive SELECT * from vicidial_did_agent_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows inserted into vicidial_did_agent_log_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM vicidial_did_agent_log WHERE call_date < '$del_time';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows deleted from vicidial_did_agent_log table \n";} + + $stmtA = "optimize table vicidial_did_agent_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $stmtA = "optimize table vicidial_did_agent_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + + ##### server_performance $stmtA = "SELECT count(*) from server_performance;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index d9c66da8..b970deb1 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1427,7 +1427,8 @@ alt_log_server_ip VARCHAR(50) default '', alt_log_dbname VARCHAR(50) default '', alt_log_login VARCHAR(50) default '', alt_log_pass VARCHAR(50) default '', -tables_use_alt_log_db VARCHAR(2000) default '' +tables_use_alt_log_db VARCHAR(2000) default '', +did_agent_log ENUM('Y','N') default 'N' ); CREATE TABLE vicidial_campaigns_list_mix ( @@ -2451,6 +2452,24 @@ index (lead_id), index (call_date) ); +CREATE TABLE vicidial_did_agent_log ( +uniqueid VARCHAR(20) NOT NULL, +server_ip VARCHAR(15) NOT NULL, +caller_id_number VARCHAR(18), +caller_id_name VARCHAR(20), +extension VARCHAR(100), +call_date DATETIME, +did_id VARCHAR(9) default '', +did_description VARCHAR(50) default '', +did_route VARCHAR(9) default '', +group_id VARCHAR(20) default '', +user VARCHAR(20) default 'VDCL', +index (uniqueid), +index (caller_id_number), +index (extension), +index (call_date) +); + ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY; @@ -2613,7 +2632,10 @@ CREATE UNIQUE INDEX vlea on vicidial_log_extended_archive (uniqueid,call_date,le CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer; -UPDATE system_settings SET db_schema_version='1292',db_schema_update_date=NOW(); +CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log; +CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route); + +UPDATE system_settings SET db_schema_version='1293',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 865ca0ff..f977bc35 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -976,3 +976,29 @@ ALTER TABLE vicidial_log_extended ADD noanswer_processed ENUM('N','Y','U') defau UPDATE system_settings SET db_schema_version='1292',db_schema_update_date=NOW() where db_schema_version < 1292; +ALTER TABLE vicidial_log_extended_archive ADD noanswer_processed ENUM('N','Y','U') default 'N'; + +CREATE TABLE vicidial_did_agent_log ( +uniqueid VARCHAR(20) NOT NULL, +server_ip VARCHAR(15) NOT NULL, +caller_id_number VARCHAR(18), +caller_id_name VARCHAR(20), +extension VARCHAR(100), +call_date DATETIME, +did_id VARCHAR(9) default '', +did_description VARCHAR(50) default '', +did_route VARCHAR(9) default '', +group_id VARCHAR(20) default '', +user VARCHAR(20) default 'VDCL', +index (uniqueid), +index (caller_id_number), +index (extension), +index (call_date) +); + +CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log; +CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route); + +ALTER TABLE system_settings ADD did_agent_log ENUM('Y','N') default 'N'; + +UPDATE system_settings SET db_schema_version='1293',db_schema_update_date=NOW() where db_schema_version < 1293; diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 9d0751fb..2ee673b6 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -697,6 +697,9 @@ This is the actual Text To Speech data field that is sent to Cepstral for creati for a 1 second break. You can also use several variables such as first name, last name and title as ViciDial variables just like you do in a Script: --A--first_name--B--|| If you have static audio files that you want to use based upon the value of one of the fields you can use those as well with C and D tags. The file names must be all lower case and they must be 8k 16bit pcm wav files. The field name must be the same but without the .wav in the filename. For example --C----A--address3--B----D-- would first find the value for address3, then it would try to find an audio file matching that value to put it into the prompt|| Here is a list of the available variables|| +DID Agent Log|| +This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N|| + lead_report_export.php admin_campaign_multi_alt.php diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 7412eef7..562e7423 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -102,7 +102,7 @@ $Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound R $UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily , 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, Custom Reports Links, CallCard Search'; -$Vtables = 'NONE,log_noanswer'; +$Vtables = 'NONE,log_noanswer,did_agent_log'; ###################################################################################################### ###################################################################################################### @@ -1611,6 +1611,8 @@ if (isset($_GET["alt_log_pass"])) {$alt_log_pass=$_GET["alt_log_pass"];} elseif (isset($_POST["alt_log_pass"])) {$alt_log_pass=$_POST["alt_log_pass"];} if (isset($_GET["tables_use_alt_log_db"])) {$tables_use_alt_log_db=$_GET["tables_use_alt_log_db"];} elseif (isset($_POST["tables_use_alt_log_db"])) {$tables_use_alt_log_db=$_POST["tables_use_alt_log_db"];} +if (isset($_GET["did_agent_log"])) {$did_agent_log=$_GET["did_agent_log"];} + elseif (isset($_POST["did_agent_log"])) {$did_agent_log=$_POST["did_agent_log"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -1955,6 +1957,7 @@ if ($non_latin < 1) $auto_resume_precall = ereg_replace("[^NY]","",$auto_resume_precall); $webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); $noanswer_log = ereg_replace("[^NY]","",$noanswer_log); + $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -2831,12 +2834,13 @@ else # 110802-2053 - Added links to Team Performance Detail Report # 110809-1547 - Added no-answer log and alt-log server system settings # 110815-2155 - Added the Campaign Status List Report +# 110822-1204 - Added did_agent_log System Settings option # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-330a'; -$build = '110815-2155'; +$admin_version = '2.4-331a'; +$build = '110822-1204'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -7668,6 +7672,11 @@ if ($ADD==99999)
No-Answer Log - This option will log the auto-dial calls that are not answered to a separate table. Default is N. +
+ +
+ DID Agent Log - This option will log the inbound DID calls along with an in-group and user ID, if applicable, to a separate table. Default is N. +

@@ -16158,7 +16167,7 @@ if ($ADD==411111111111111) } $tables_use_alt_log_db = preg_replace("/,$/","",$new_altlog_value); - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db';"; + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log';"; $rslt=mysql_query($stmt, $link); if ($reload_dialplan_on_servers > 0) @@ -27177,7 +27186,7 @@ if ($ADD==311111111111111) $row=mysql_fetch_row($rslt); $vicidial_nanpa_prefix_codes_count = $row[0]; - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -27279,6 +27288,7 @@ if ($ADD==311111111111111) $alt_log_login = $row[96]; $alt_log_pass = $row[97]; $tables_use_alt_log_db = $row[98]; + $did_agent_log = $row[99]; echo "
MODIFY VICIDIAL SYSTEM SETTINGS
\n"; echo "\n"; @@ -27536,6 +27546,7 @@ if ($ADD==311111111111111) echo "Webphone System Key: $NWB#settings-webphone_systemkey$NWE\n"; echo "No-Answer Log: $NWB#settings-noanswer_log$NWE\n"; + echo "DID Agent Log: $NWB#settings-did_agent_log$NWE\n"; echo "Alt-Log DB Server: $NWB#settings-alt_log_server_ip$NWE\n"; echo "Alt-Log DB Name: $NWB#settings-alt_log_server_ip$NWE\n"; echo "Alt-Log DB Login: $NWB#settings-alt_log_server_ip$NWE\n";