Fix for no-dial options in auto-dial script

Added live call and shortage counts per server tables to campaign debug report

git-svn-id: svn://192.168.202.10@2903 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2018-02-01 17:46:27 +00:00
parent a38bbc1c06
commit 1c0be8416a
2 changed files with 64 additions and 2 deletions
+16 -1
View File
@@ -1082,10 +1082,25 @@ while($one_day_interval > 0)
if ( ($DBIPadlevel[$user_CIPct] < 1) || ($DBIPdial_method[$user_CIPct] =~ /MANUAL|INBOUND_MAN/) )
{
$event_string="Manual Dial Override for Shortage |$DBIPadlevel[$user_CIPct]|$DBIPtrunk_shortage[$user_CIPct]|";
&event_logger;
$debug_string .= "$event_string\n";
&event_logger;
$DBIPtrunk_shortage[$user_CIPct] = 0;
}
if ( ( ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /ENABLED/) && ($DBIPexistcalls_IN_LIVE[$user_CIPct] > 0) ) || ( ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /CHAT/) && ($DBIPexistchats_IN_LIVE[$user_CIPct] > 0) ) )
{
$event_string="Inbound Queue No-Dial Override for Shortage |$DBIPexistcalls_IN_LIVE[$user_CIPct]|$DBIPtrunk_shortage[$user_CIPct]|";
$debug_string .= "$event_string\n";
&event_logger;
$DBIPtrunk_shortage[$user_CIPct] = 0;
}
if ($DBIPinbound_no_agents_no_dial_trigger[$user_CIPct] > 0)
{
$event_string="Inbound No-Agents No-Dial Override for Shortage |$DBIPinbound_no_agents_no_dial_trigger[$user_CIPct]|$DBIPtrunk_shortage[$user_CIPct]|";
$debug_string .= "$event_string\n";
&event_logger;
$DBIPtrunk_shortage[$user_CIPct] = 0;
}
$stmtA = "UPDATE vicidial_campaign_server_stats SET local_trunk_shortage='$DBIPtrunk_shortage[$user_CIPct]',update_time='$now_date' where server_ip='$server_ip' and campaign_id='$DBIPcampaign[$user_CIPct]';";
$affected_rows = $dbhA->do($stmtA);
}
+48 -1
View File
@@ -1,7 +1,7 @@
<?php
# campaign_debug.php
#
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 110514-1231 - First build
@@ -13,6 +13,7 @@
# 141007-2209 - Finalized adding QXZ translation to all admin files
# 141229-2042 - Added code for on-the-fly language translations display
# 170409-1534 - Added IP List validation code
# 180201-1245 - Added live call and shortage counts per server tables
#
$startMS = microtime();
@@ -321,6 +322,52 @@ else
$i++;
}
$stmt="select server_ip,update_time,local_trunk_shortage from vicidial_campaign_server_stats where campaign_id='" . mysqli_real_escape_string($link, $group) . "' order by server_ip limit 100;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$shortages_to_print = mysqli_num_rows($rslt);
if ($shortages_to_print > 0)
{
echo "Per-Server Shortages:\n";
echo " SERVER DATE/TIME SHORT\n";
}
$i=0;
while ($shortages_to_print > $i)
{
$row=mysqli_fetch_row($rslt);
echo sprintf("%-15s", $row[0])." ";
echo sprintf("%-20s", $row[1])." ";
echo sprintf("%-8s", $row[2])."\n";
$i++;
}
echo "\n";
$stmt="select count(*),call_type,server_ip from vicidial_auto_calls where campaign_id='" . mysqli_real_escape_string($link, $group) . "' group by call_type,server_ip order by server_ip,call_type limit 100;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$shortages_to_print = mysqli_num_rows($rslt);
if ($shortages_to_print > 0)
{
echo "Per-Server and Per-Type Campaign Calls:\n";
echo " SERVER CALL TYPE COUNT\n";
}
$i=0;
while ($shortages_to_print > $i)
{
$row=mysqli_fetch_row($rslt);
echo sprintf("%-15s", $row[2])." ";
echo sprintf("%-11s", $row[1])." ";
echo sprintf("%-8s", $row[0])."\n";
$i++;
}
echo "\n";
$closer_groupsSQL = preg_replace("/^ | -$/","",$closer_campaigns);
$closer_groupsSQL = preg_replace("/ /","','",$closer_groupsSQL);