From efa3b3796a4ef2e51bff8f27f9d4450a2c5e371e Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 8 Nov 2020 17:40:58 +0000 Subject: [PATCH] Added caching of parked call stats Added display of parked call stats, SLA stats and LIMITED report type to real-time report Added optional rolling of park_log to archive perl script git-svn-id: svn://192.168.202.10@3313 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 3 + agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl | 82 ++++ agc_2-X/trunk/bin/AST_VDadapt.pl | 34 +- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 13 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 10 + agc_2-X/trunk/www/agc/manager_send.php | 14 +- agc_2-X/trunk/www/agc/vicidial.php | 9 +- .../trunk/www/vicidial/AST_timeonVDADall.php | 410 +++++++++++++----- agc_2-X/trunk/www/vicidial/admin_header.php | 82 ++-- .../trunk/www/vicidial/options-example.php | 3 + .../trunk/www/vicidial/realtime_report.php | 206 ++++++--- 11 files changed, 636 insertions(+), 230 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 1d4d4565..a5ce7492 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -540,6 +540,9 @@ OTHER CHANGES: 152. Added Pause Max Exceptions campaign setting, allowing for exceptions to the Agent Pause Max feature for specified Pause Codes. +153. Added optional display of parked call stats and SLA 1&2 percentages to the + Real-Time Report + 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 5db71f98..acfd8976 100644 --- a/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl +++ b/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl @@ -58,6 +58,7 @@ # 190531-0841 - Added vicidial_log_extended_sip archiving # 190926-0005 - Added vicidial_sip_action_log archiving # 200102-0846 - Added vicidial_vmm_counts archiving +# 201107-2206 - Added optional park_log archiving # $CALC_TEST=0; @@ -65,6 +66,7 @@ $T=0; $TEST=0; $only_trim_archive=0; $recording_log_archive=0; $did_log_archive=0; +$park_log_archive=0; $wipe_closer_log=0; ### begin parsing run-time options ### @@ -95,6 +97,7 @@ if (length($ARGV[0])>1) print " vicidial_log_archive, vicidial_agent_log_archive, vicidial_closer_log_archive, vicidial_xfer_log_archive\n"; print " [--recording-log-days=XX] = OPTIONAL, number of days to archive recording_log table only past\n"; print " [--did-log-days=XX] = OPTIONAL, number of days to archive vicidial_did_log table only past\n"; + print " [--park-log-days=XX] = OPTIONAL, number of days to archive park_log table only past\n"; print " [--cpd-log-purge-days=XX] = OPTIONAL, number of days to purge vicidial_cpd_log table only past\n"; print " [--wipe-closer-log] = OPTIONAL, deletes all records from vicidial_closer_log after archiving\n"; print " [--wipe-all-being-archived] = OPTIONAL, deletes all records from most tables after archiving\n"; @@ -217,6 +220,18 @@ if (length($ARGV[0])>1) if ($Q < 1) {print "\n----- DID LOG ARCHIVE ACTIVE, DAYS: $diddays -----\n\n";} } + if ($args =~ /--park-log-days=/i) + { + $park_log_archive++; + @data_in = split(/--park-log-days=/,$args); + $parkdays = $data_in[1]; + $parkdays =~ s/ .*$//gi; + $parkdays =~ s/\D//gi; + if ($parkdays > 999999) + {$parkdays=1825;} + if ($Q < 1) + {print "\n----- PARK LOG ARCHIVE ACTIVE, DAYS: $parkdays -----\n\n";} + } if ($args =~ /--cpd-log-purge-days=/i) { $cpd_log_purge++; @@ -302,6 +317,19 @@ if ($did_log_archive > 0) if ($DIDsec < 10) {$DIDsec = "0$DIDsec";} $DIDdel_time = "$DIDyear-$DIDmon-$DIDmday $DIDhour:$DIDmin:$DIDsec"; } +if ($park_log_archive > 0) + { + $PARKdel_epoch = ($secX - (86400 * $parkdays)); # X days ago + ($PARKsec,$PARKmin,$PARKhour,$PARKmday,$PARKmon,$PARKyear,$PARKwday,$PARKyday,$PARKisdst) = localtime($PARKdel_epoch); + $PARKyear = ($PARKyear + 1900); + $PARKmon++; + if ($PARKmon < 10) {$PARKmon = "0$PARKmon";} + if ($PARKmday < 10) {$PARKmday = "0$PARKmday";} + if ($PARKhour < 10) {$PARKhour = "0$PARKhour";} + if ($PARKmin < 10) {$PARKmin = "0$PARKmin";} + if ($PARKsec < 10) {$PARKsec = "0$PARKsec";} + $PARKdel_time = "$PARKyear-$PARKmon-$PARKmday $PARKhour:$PARKmin:$PARKsec"; + } if ($cpd_log_purge > 0) { $CPDdel_epoch = ($secX - (86400 * $CPDdays)); # X days ago @@ -325,6 +353,7 @@ if (!$Q) {print "_archive tables and delete records in original tables older tha if (!$Q) {print "$CLIdays days ( $del_time [$del_date]|$del_epoch ) from current date \n\n";} if ( (!$Q) && ($recording_log_archive > 0) ) {print "REC $RECORDINGdays days ( $RECdel_time|$RECdel_epoch ) from current date \n\n";} if ( (!$Q) && ($did_log_archive > 0) ) {print "DID $diddays days ( $DIDdel_time|$DIDdel_epoch ) from current date \n\n";} +if ( (!$Q) && ($park_log_archive > 0) ) {print "PARK $parkdays days ( $PARKdel_time|$PARKdel_epoch ) from current date \n\n";} if ( (!$Q) && ($cpd_log_purge > 0) ) {print "CPD $CPDdays days ( $CPDdel_time|$CPDdel_epoch ) from current date \n\n";} if ($CALC_TEST > 0) @@ -2861,6 +2890,59 @@ if (!$T) } + if ($park_log_archive > 0) + { + ##### park_log + $stmtA = "SELECT count(*) from park_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; + $park_log_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from park_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; + $park_log_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing park_log table... ($park_log_count|$park_log_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO park_log_archive SELECT * from park_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 park_log_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM park_log WHERE parked_time < '$DIDdel_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 park_log table \n";} + + $stmtA = "optimize table park_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $stmtA = "optimize table park_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + } + + if ($cpd_log_purge > 0) { ##### vicidial_cpd_log diff --git a/agc_2-X/trunk/bin/AST_VDadapt.pl b/agc_2-X/trunk/bin/AST_VDadapt.pl index 06c27c2c..d9dd90c1 100644 --- a/agc_2-X/trunk/bin/AST_VDadapt.pl +++ b/agc_2-X/trunk/bin/AST_VDadapt.pl @@ -52,6 +52,7 @@ # 190720-2122 - Added audit and fixing of missing outbound auto-dial logs if Call Quotas is enabled # 190722-1004 - Added more logging and log-audit portions to Call Quotas log audit code # 200811-1600 - Include live agents from other campaigns if they have the campaign Drop-InGroup selected and drop sec < 0 +# 201106-2141 - Added calculation and caching of park_log stats per campaign/in-group # # constants @@ -2358,6 +2359,8 @@ sub calculate_drops $VCSagent_acw_today[$i]=0; $VCSagent_calls_today[$i]=0; $VCSlive_calls[$i]=0; + $VCSpark_calls_today[$i]=0; + $VCSpark_sec_today[$i]=0; # LAST ONE MINUTE CALL AND DROP STATS $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_one';"; @@ -3485,7 +3488,19 @@ sub calculate_drops $sthA->finish(); } - $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$i]',answers_today='$VCSanswers_today[$i]',drops_today='$VCSdrops_today[$i]',drops_today_pct='$VCSdrops_today_pct[$i]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$i]',calls_hour='$VCScalls_hour[$i]',answers_hour='$VCSanswers_hour[$i]',drops_hour='$VCSdrops_hour[$i]',drops_hour_pct='$VCSdrops_hour_pct[$i]',calls_halfhour='$VCScalls_halfhour[$i]',answers_halfhour='$VCSanswers_halfhour[$i]',drops_halfhour='$VCSdrops_halfhour[$i]',drops_halfhour_pct='$VCSdrops_halfhour_pct[$i]',calls_fivemin='$VCScalls_five[$i]',answers_fivemin='$VCSanswers_five[$i]',drops_fivemin='$VCSdrops_five[$i]',drops_fivemin_pct='$VCSdrops_five_pct[$i]',calls_onemin='$VCScalls_one[$i]',answers_onemin='$VCSanswers_one[$i]',drops_onemin='$VCSdrops_one[$i]',drops_onemin_pct='$VCSdrops_one_pct[$i]',agent_non_pause_sec='$VCSagent_nonpause_time[$i]',agent_calls_today='$VCSagent_calls_today[$i]',agent_pause_today='$VCSagent_pause_today[$i]',agent_wait_today='$VCSagent_wait_today[$i]',agent_custtalk_today='$VCSagent_custtalk_today[$i]',agent_acw_today='$VCSagent_acw_today[$i]',answering_machines_today='$VCSam_today[$i]',agenthandled_today='$VCSagenthandled_today[$i]',$VSCupdateSQL where campaign_id='$campaign_id[$i]';"; + $stmtA = "SELECT count(*),sum(parked_sec) from park_log where campaign_id='$campaign_id[$i]' and parked_time > '$VDL_date';"; + $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; + $VCSpark_calls_today[$i] = $aryA[0]; + $VCSpark_sec_today[$i] = $aryA[1]; + } + $sthA->finish(); + + $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$i]',answers_today='$VCSanswers_today[$i]',drops_today='$VCSdrops_today[$i]',drops_today_pct='$VCSdrops_today_pct[$i]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$i]',calls_hour='$VCScalls_hour[$i]',answers_hour='$VCSanswers_hour[$i]',drops_hour='$VCSdrops_hour[$i]',drops_hour_pct='$VCSdrops_hour_pct[$i]',calls_halfhour='$VCScalls_halfhour[$i]',answers_halfhour='$VCSanswers_halfhour[$i]',drops_halfhour='$VCSdrops_halfhour[$i]',drops_halfhour_pct='$VCSdrops_halfhour_pct[$i]',calls_fivemin='$VCScalls_five[$i]',answers_fivemin='$VCSanswers_five[$i]',drops_fivemin='$VCSdrops_five[$i]',drops_fivemin_pct='$VCSdrops_five_pct[$i]',calls_onemin='$VCScalls_one[$i]',answers_onemin='$VCSanswers_one[$i]',drops_onemin='$VCSdrops_one[$i]',drops_onemin_pct='$VCSdrops_one_pct[$i]',agent_non_pause_sec='$VCSagent_nonpause_time[$i]',agent_calls_today='$VCSagent_calls_today[$i]',agent_pause_today='$VCSagent_pause_today[$i]',agent_wait_today='$VCSagent_wait_today[$i]',agent_custtalk_today='$VCSagent_custtalk_today[$i]',agent_acw_today='$VCSagent_acw_today[$i]',answering_machines_today='$VCSam_today[$i]',agenthandled_today='$VCSagenthandled_today[$i]',park_calls_today='$VCSpark_calls_today[$i]',park_sec_today='$VCSpark_sec_today[$i]',$VSCupdateSQL where campaign_id='$campaign_id[$i]';"; $affected_rows = $dbhA->do($stmtA); if ($DBX) {print "OUTBOUND $campaign_id[$i]|$affected_rows|$stmtA|\n";} @@ -4436,6 +4451,8 @@ sub calculate_drops_inbound $iVCSlive_calls[$p]=0; $itotal_agents[$p]=0; $itotal_remote_agents[$p]=0; + $iVCSpark_calls_today[$p]=0; + $iVCSpark_sec_today[$p]=0; # DAILY STATS UPDATE if ($daily_stats > 0) @@ -4473,6 +4490,7 @@ sub calculate_drops_inbound $itotal_remote_agents[$p] = $aryA[0]; } $sthA->finish(); + $debug_ingroup_output .= " DAILY STATS|$iVCSlive_calls[$p]|$itotal_agents[$p]|$itotal_remote_agents[$p]|"; } @@ -5648,6 +5666,18 @@ sub calculate_drops_inbound } $sthA->finish(); } + + $stmtA = "SELECT count(*),sum(parked_sec) from park_log where campaign_id='$group_id[$p]' and parked_time > '$VDL_date';"; + $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; + $iVCSpark_calls_today[$p] = $aryA[0]; + $iVCSpark_sec_today[$p] = $aryA[1]; + } + $sthA->finish(); } @@ -5879,7 +5909,7 @@ sub calculate_drops_inbound if ($DBX) {print "$group_id[$p]|$stmtA|\n";} } - $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$iVCScalls_today[$p]',answers_today='$iVCSanswers_today[$p]',drops_today='$iVCSdrops_today[$p]',drops_today_pct='$iVCSdrops_today_pct[$p]',drops_answers_today_pct='$iVCSdrops_answers_today_pct[$p]',hold_sec_stat_one='$answer_sec_pct_rt_stat_one_PCT[$p]',hold_sec_stat_two='$answer_sec_pct_rt_stat_two_PCT[$p]',hold_sec_answer_calls='$hold_sec_answer_calls[$p]',hold_sec_drop_calls='$hold_sec_drop_calls[$p]',hold_sec_queue_calls='$hold_sec_queue_calls[$p]',$VSCupdateSQL where campaign_id='$group_id[$p]';"; + $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$iVCScalls_today[$p]',answers_today='$iVCSanswers_today[$p]',drops_today='$iVCSdrops_today[$p]',drops_today_pct='$iVCSdrops_today_pct[$p]',drops_answers_today_pct='$iVCSdrops_answers_today_pct[$p]',hold_sec_stat_one='$answer_sec_pct_rt_stat_one_PCT[$p]',hold_sec_stat_two='$answer_sec_pct_rt_stat_two_PCT[$p]',hold_sec_answer_calls='$hold_sec_answer_calls[$p]',hold_sec_drop_calls='$hold_sec_drop_calls[$p]',hold_sec_queue_calls='$hold_sec_queue_calls[$p]',park_calls_today='$iVCSpark_calls_today[$p]',park_sec_today='$iVCSpark_sec_today[$p]',$VSCupdateSQL where campaign_id='$group_id[$p]';"; $affected_rows = $dbhA->do($stmtA); if ($DBX) {print "INBOUND $group_id[$p]|$affected_rows|$stmtA|\n";} 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 fc15c34f..9f3b9881 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -288,8 +288,10 @@ talked_sec INT(10), extension VARCHAR(100), user VARCHAR(20), lead_id INT(9) UNSIGNED default '0', +campaign_id VARCHAR(20) default '', index (parked_time), -index (lead_id) +index (lead_id), +index (campaign_id) ) ENGINE=MyISAM; CREATE INDEX uniqueid_park on park_log (uniqueid); @@ -1613,7 +1615,9 @@ agent_custtalk_today BIGINT(14) UNSIGNED default '0', agent_acw_today BIGINT(14) UNSIGNED default '0', agent_pause_today BIGINT(14) UNSIGNED default '0', answering_machines_today INT(9) UNSIGNED default '0', -agenthandled_today INT(9) UNSIGNED default '0' +agenthandled_today INT(9) UNSIGNED default '0', +park_calls_today MEDIUMINT(8) UNSIGNED default '0', +park_sec_today BIGINT(14) UNSIGNED default '0' ) ENGINE=MyISAM; CREATE TABLE vicidial_dnc ( @@ -4588,6 +4592,9 @@ CREATE UNIQUE INDEX vlesa on vicidial_sip_action_log_archive (caller_code,call_d CREATE TABLE vicidial_vmm_counts_archive LIKE vicidial_vmm_counts; +CREATE TABLE park_log_archive LIKE park_log; +CREATE UNIQUE INDEX uniqueidtime_park on park_log_archive (uniqueid,parked_time); + GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; @@ -4670,4 +4677,4 @@ INSERT INTO vicidial_settings_containers VALUES ('INTERNATIONAL_DNC_IMPORT','Pro UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1609',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1610',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index 72795132..491150c3 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -1328,3 +1328,13 @@ UPDATE system_settings SET db_schema_version='1608',db_schema_update_date=NOW() ALTER TABLE vicidial_inbound_groups ADD no_agent_delay SMALLINT(5) default '0'; UPDATE system_settings SET db_schema_version='1609',db_schema_update_date=NOW() where db_schema_version < 1609; + +ALTER TABLE park_log ADD campaign_id VARCHAR(20) default ''; +CREATE INDEX pl_campaign_id on park_log(campaign_id); +CREATE TABLE park_log_archive LIKE park_log; +CREATE UNIQUE INDEX uniqueidtime_park on park_log_archive (uniqueid,parked_time); + +ALTER TABLE vicidial_campaign_stats ADD park_calls_today MEDIUMINT(8) UNSIGNED default '0'; +ALTER TABLE vicidial_campaign_stats ADD park_sec_today BIGINT(14) UNSIGNED default '0'; + +UPDATE system_settings SET db_schema_version='1610',db_schema_update_date=NOW() where db_schema_version < 1610; diff --git a/agc_2-X/trunk/www/agc/manager_send.php b/agc_2-X/trunk/www/agc/manager_send.php index 42cd4abc..d0728c24 100644 --- a/agc_2-X/trunk/www/agc/manager_send.php +++ b/agc_2-X/trunk/www/agc/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -143,10 +143,11 @@ # 190222-1318 - Added recent session per-call logging # 190310-1202 - Added MuteRecording function # 191013-2114 - Fixes for PHP7 +# 201107-2228 - Added campaign/in-group logging in park_log # -$version = '2.14-90'; -$build = '191013-2114'; +$version = '2.14-91'; +$build = '201107-2228'; $php_script = 'manager_send.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=143; @@ -252,6 +253,8 @@ if (isset($_GET["customerparked"])) {$customerparked=$_GET["customerparked"]; elseif (isset($_POST["customerparked"])) {$customerparked=$_POST["customerparked"];} if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} header ("Content-type: text/html; charset=utf-8"); @@ -304,6 +307,7 @@ $queryCID = preg_replace("/\'|\"|\\\\|;/","",$queryCID); $secondS = preg_replace('/[^0-9]/','',$secondS); $stage = preg_replace("/\'|\"|\\\\|;/","",$stage); $usegroupalias = preg_replace('/[^0-9]/','',$usegroupalias); +$group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$group_id); # default optional vars if not set if (!isset($ACTION)) {$ACTION="Originate";} @@ -1073,7 +1077,7 @@ if ($ACTION=="RedirectToPark") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; - $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='PARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';"; + $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='PARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id',campaign_id='$group_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02098',$user,$server_ip,$session_name,$one_mysql_log);} @@ -1322,7 +1326,7 @@ if ($ACTION=="RedirectToParkIVR") $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02088',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='IVRPARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';"; + $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='IVRPARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id',campaign_id='$group_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02107',$user,$server_ip,$session_name,$one_mysql_log);} diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 68212e58..a553b2f9 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -648,10 +648,11 @@ # 201004-1112 - Added pause_max_exceptions campaign feature # 201010-2223 - Added force change password feature # 201026-0143 - Fix for pause_max_exceptions issue +# 201107-2236 - Change for parked call logging # -$version = '2.14-616c'; -$build = '201026-0143'; +$version = '2.14-617c'; +$build = '201107-2236'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=92; $one_mysql_log=0; @@ -7391,7 +7392,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&group_id=" + group; document.getElementById("ParkControl").innerHTML ="\" border=\"0\" alt=\"Grab Parked Call\" />"; if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) @@ -7439,7 +7440,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var redirectdestination = taskxferconf; var redirectdestserverip = taskserverip; var parkedby = protocol + "/" + extension; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&group_id=" + group; document.getElementById("ParkControl").innerHTML ="\" border=\"0\" alt=\"Grab Parked Call\" />"; if (ivr_park_call=='ENABLED_PARK_ONLY') diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index db28f588..23b10e22 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -120,10 +120,11 @@ # 200428-1337 - Added RS_INcolumnsHIDE, RS_report_default_format & RS_AGENTstatusTALLY options.php settings # 200506-1642 - Added RS_CUSTINFOminUL options.php setting # 200815-0930 - Added agent-paused 10 & 15 minute indicators +# 201107-2253 - Added display of parked calls, inbound SLA stats and LIMITED report type # -$version = '2.14-105'; -$build = '200815-0930'; +$version = '2.14-106'; +$build = '201107-2253'; header ("Content-type: text/html; charset=utf-8"); @@ -242,6 +243,10 @@ if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_d elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (isset($_GET["mobile_device"])) {$mobile_device=$_GET["mobile_device"];} elseif (isset($_POST["mobile_device"])) {$mobile_device=$_POST["mobile_device"];} +if (isset($_GET["parkSTATS"])) {$parkSTATS=$_GET["parkSTATS"];} + elseif (isset($_POST["parkSTATS"])) {$parkSTATS=$_POST["parkSTATS"];} +if (isset($_GET["SLAinSTATS"])) {$SLAinSTATS=$_GET["SLAinSTATS"];} + elseif (isset($_POST["SLAinSTATS"])) {$SLAinSTATS=$_POST["SLAinSTATS"];} $report_name = 'Real-Time Main Report'; @@ -651,6 +656,7 @@ while($i < $ingroup_ct) $i++; } $ingroup_SQL = preg_replace('/,$/i', '',$ingroup_SQL); +#if ($DB > 0) {echo "INBOUND INPUT DEBUG: |$ingroup_ct|$ingroup_string|\n";} ### if no campaigns selected, display all if ( ($group_ct < 1) or (strlen($group_string) < 2) ) @@ -923,6 +929,25 @@ $select_list .= "