changed campaign dial statuses to use dunamic number of statuses, replacing the static dial_status_x fields. Changes to database, admin.php, AST_VDhopper and timeonVDADall scripts
git-svn-id: svn://192.168.202.10@532 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -73,7 +73,8 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
|
||||
"--postal-code-gmt" flag to your adjust GMT script in the crontab to
|
||||
more accurately assign timezones to your leads.
|
||||
|
||||
|
||||
18. Changed dial statuses to use dynamic number of dial statuses instead of
|
||||
static dial_status_x fields.
|
||||
|
||||
|
||||
|
||||
|
||||
+18
-27
@@ -5,7 +5,7 @@
|
||||
# DESCRIPTION:
|
||||
# adjusts the auto_dial_level for vicidial adaptive-predictive campaigns.
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# CHANGELOG
|
||||
# 60823-1302 - First build from AST_VDhopper.pl
|
||||
@@ -19,6 +19,7 @@
|
||||
# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
|
||||
# 70205-1429 - Added code for campaign_changedate and campaign_stats_refresh updates
|
||||
# 70213-1221 - Added code for QueueMetrics queue_log QUEUESTART record
|
||||
# 70219-1249 - Removed unused references to dial_status_x fields
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -316,11 +317,6 @@ while ($master_loop<$CLIloops)
|
||||
# if ($DB) {print "TIME DEBUG: $master_loop $LOCAL_GMT_OFF_STD|$LOCAL_GMT_OFF|$isdst| GMT: $hour:$min\n";}
|
||||
|
||||
@campaign_id=@MT;
|
||||
@dial_status_a=@MT;
|
||||
@dial_status_b=@MT;
|
||||
@dial_status_c=@MT;
|
||||
@dial_status_d=@MT;
|
||||
@dial_status_e=@MT;
|
||||
@lead_order=@MT;
|
||||
@hopper_level=@MT;
|
||||
@auto_dial_level=@MT;
|
||||
@@ -343,7 +339,7 @@ if ($CLIcampaign)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtA = "SELECT campaign_id,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,UNIX_TIMESTAMP(campaign_changedate),campaign_stats_refresh from vicidial_campaigns where ( (active='Y') or (campaign_stats_refresh='Y') )";
|
||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,UNIX_TIMESTAMP(campaign_changedate),campaign_stats_refresh from vicidial_campaigns where ( (active='Y') or (campaign_stats_refresh='Y') )";
|
||||
}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -353,29 +349,24 @@ while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$campaign_id[$rec_count] = $aryA[0];
|
||||
$dial_status_a[$rec_count] = $aryA[1];
|
||||
$dial_status_b[$rec_count] = $aryA[2];
|
||||
$dial_status_c[$rec_count] = $aryA[3];
|
||||
$dial_status_d[$rec_count] = $aryA[4];
|
||||
$dial_status_e[$rec_count] = $aryA[5];
|
||||
$lead_order[$rec_count] = $aryA[6];
|
||||
$lead_order[$rec_count] = $aryA[1];
|
||||
if (!$CLIlevel)
|
||||
{$hopper_level[$rec_count] = $aryA[7];}
|
||||
{$hopper_level[$rec_count] = $aryA[2];}
|
||||
else
|
||||
{$hopper_level[$rec_count] = $CLIlevel;}
|
||||
$auto_dial_level[$rec_count] = $aryA[8];
|
||||
$local_call_time[$rec_count] = $aryA[9];
|
||||
$lead_filter_id[$rec_count] = $aryA[10];
|
||||
$use_internal_dnc[$rec_count] = $aryA[11];
|
||||
$dial_method[$rec_count] = $aryA[12];
|
||||
$available_only_ratio_tally[$i][$rec_count] = $aryA[13];
|
||||
$adaptive_dropped_percentage[$rec_count] = $aryA[14];
|
||||
$adaptive_maximum_level[$rec_count] = $aryA[15];
|
||||
$adaptive_latest_server_time[$rec_count] = $aryA[16];
|
||||
$adaptive_intensity[$rec_count] = $aryA[17];
|
||||
$adaptive_dl_diff_target[$rec_count] = $aryA[18];
|
||||
$campaign_changedate[$rec_count] = $aryA[19];
|
||||
$campaign_stats_refresh[$rec_count] = $aryA[20];
|
||||
$auto_dial_level[$rec_count] = $aryA[3];
|
||||
$local_call_time[$rec_count] = $aryA[4];
|
||||
$lead_filter_id[$rec_count] = $aryA[5];
|
||||
$use_internal_dnc[$rec_count] = $aryA[6];
|
||||
$dial_method[$rec_count] = $aryA[7];
|
||||
$available_only_ratio_tally[$i][$rec_count] = $aryA[8];
|
||||
$adaptive_dropped_percentage[$rec_count] = $aryA[9];
|
||||
$adaptive_maximum_level[$rec_count] = $aryA[10];
|
||||
$adaptive_latest_server_time[$rec_count] = $aryA[11];
|
||||
$adaptive_intensity[$rec_count] = $aryA[12];
|
||||
$adaptive_dl_diff_target[$rec_count] = $aryA[13];
|
||||
$campaign_changedate[$rec_count] = $aryA[14];
|
||||
$campaign_stats_refresh[$rec_count] = $aryA[15];
|
||||
|
||||
$rec_count++;
|
||||
}
|
||||
|
||||
+24
-14
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_VDhopper.pl version 2.0.2 *DBI-version*
|
||||
# AST_VDhopper.pl version 2.0.3 *DBI-version*
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# uses DBD::MySQL to update the VICIDIAL leads hopper for the streamlined
|
||||
@@ -23,8 +23,9 @@
|
||||
# a minute, you may want to play with the variables below to streamline for
|
||||
# your usage
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# CHANGELOG
|
||||
# 50810-1613 - Added database server variable definitions lookup
|
||||
# 60215-1106 - Added Scheduled Callback release functionality
|
||||
# 60228-1623 - Change Callback activation to set the called_since_last_reset=N
|
||||
@@ -36,12 +37,13 @@
|
||||
# 60511-1150 - Added inserts into vicidial_campaign_stats table
|
||||
# 60609-1451 - Added ability to filter by DNC list vicidial_dnc
|
||||
# 60614-1159 - Added campaign lead recycling ability
|
||||
# 60715-2251 - changed to use /etc/astguiclient.conf for configs
|
||||
# 60715-2251 - Changed to use /etc/astguiclient.conf for configs
|
||||
# 60801-1634 - Fixed Callback activation bug 000008
|
||||
# 60814-1720 - added option for no logging to file
|
||||
# 60822-1527 - added campaign_stats and logging options for adaptive dialing
|
||||
# 60925-1330 - fixed recycling leads issues
|
||||
# 61110-1513 - changed Xth NEW to fill to hopper_level with standard if not enough NEW
|
||||
# 60814-1720 - Added option for no logging to file
|
||||
# 60822-1527 - Added campaign_stats and logging options for adaptive dialing
|
||||
# 60925-1330 - Fixed recycling leads issues
|
||||
# 61110-1513 - Changed Xth NEW to fill to hopper_level with standard if not enough NEW
|
||||
# 70219-1247 - Changed to use dial_statuses field instead of dial_status_x fields
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -384,11 +386,6 @@ while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$campaign_id[$rec_count] = "$aryA[0]";
|
||||
$dial_status_a[$rec_count] = "$aryA[3]";
|
||||
$dial_status_b[$rec_count] = "$aryA[4]";
|
||||
$dial_status_c[$rec_count] = "$aryA[5]";
|
||||
$dial_status_d[$rec_count] = "$aryA[6]";
|
||||
$dial_status_e[$rec_count] = "$aryA[7]";
|
||||
$lead_order[$rec_count] = "$aryA[8]";
|
||||
if (!$CLIlevel)
|
||||
{$hopper_level[$rec_count] = "$aryA[13]";}
|
||||
@@ -402,6 +399,7 @@ while ($sthArows > $rec_count)
|
||||
$available_only_ratio_tally[$rec_count] = $aryA[47];
|
||||
$adaptive_dropped_percentage[$rec_count] = $aryA[48];
|
||||
$adaptive_maximum_level[$rec_count] = $aryA[49];
|
||||
$dial_statuses[$rec_count] = $aryA[61];
|
||||
|
||||
$rec_count++;
|
||||
}
|
||||
@@ -417,6 +415,18 @@ foreach(@campaign_id)
|
||||
$vicidial_log = 'vicidial_log';
|
||||
$VCSdialable_leads[$i]=0;
|
||||
|
||||
$dial_statuses[$i] =~ s/ -$//gi;
|
||||
@Dstatuses = split(/ /,$dial_statuses[$i]);
|
||||
$Ds_to_print = (($#Dstatuses) + 0);
|
||||
$STATUSsql[$i]='';
|
||||
$o=0;
|
||||
while ($Ds_to_print > $o)
|
||||
{
|
||||
$o++;
|
||||
$STATUSsql[$i] .= "'$Dstatuses[$o]',";
|
||||
}
|
||||
chop($STATUSsql[$i]);
|
||||
|
||||
$stmtA = "SELECT dialable_leads from vicidial_campaign_stats where campaign_id='$campaign_id[$i]';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -955,7 +965,7 @@ foreach(@campaign_id)
|
||||
if ($DBX) {print " |$lead_filter_id[$i]|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists[$i]) and ($all_gmtSQL[$i]) $lead_filter_sql[$i];";
|
||||
$stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and ($all_gmtSQL[$i]) $lead_filter_sql[$i];";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1137,7 +1147,7 @@ foreach(@campaign_id)
|
||||
if ($campaign_leads_to_call[$i] > 0)
|
||||
{
|
||||
if ($DB) {print " lead call order: $order_stmt\n";}
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
|
||||
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
|
||||
if ($DBX) {print " |$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
|
||||
@@ -519,7 +519,8 @@ agent_pause_codes_active ENUM('Y','N') default 'N',
|
||||
campaign_description VARCHAR(255),
|
||||
campaign_changedate DATETIME,
|
||||
campaign_stats_refresh ENUM('Y','N') default 'N',
|
||||
campaign_logindate DATETIME
|
||||
campaign_logindate DATETIME,
|
||||
auto_alt_dial_statuses VARCHAR(255) default ' NEW -'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_lists (
|
||||
|
||||
@@ -99,3 +99,7 @@ queuemetrics_log_id VARCHAR(10) default 'VIC'
|
||||
);
|
||||
|
||||
INSERT INTO system_settings (version,install_date) values('2.0.X', CURDATE());
|
||||
|
||||
ALTER TABLE vicidial_campaigns ADD dial_statuses VARCHAR(255) default ' NEW -';
|
||||
|
||||
update vicidial_campaigns SET dial_statuses=concat_ws(""," ",`dial_status_a`," ",`dial_status_b`," ",`dial_status_c`," ",`dial_status_d`," ",`dial_status_e`," -");
|
||||
|
||||
@@ -135,6 +135,17 @@ QueueMetrics Database Password -<\/B> This is the password used to log in to you
|
||||
QueueMetrics URL -<\/B> This is the URL or web site address used to get to your QueueMetrics installation||
|
||||
QueueMetrics Log ID -<\/B> This is the server ID that all VICIDIAL logs going into the QueueMetrics database will use as an identifier for each record||
|
||||
QueueMetrics Log ID: ||
|
||||
Campaign Dial Status Added||
|
||||
Campaign Dial Status Removed||
|
||||
To add another status to dial, select it from the drop-down list and click ADD. To remove one of the dial statuses, click on the REMOVE link next to the status you want to remove||
|
||||
CAMPAIGN DIAL STATUS NOT ADDED||
|
||||
CAMPAIGN DIAL STATUS ADDED||
|
||||
this dial status is not selected for this campaign||
|
||||
CAMPAIGN DIAL STATUS NOT REMOVED||
|
||||
CAMPAIGN DIAL STATUS REMOVED||
|
||||
>REMOVE<||
|
||||
Dial Status ||
|
||||
no dial statuses selected for this campaign||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
@@ -265,10 +265,10 @@ echo "\n\n";
|
||||
if (!$group) {echo "<BR><BR>please select a campaign from the pulldown above</FORM>\n"; exit;}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout) from vicidial_campaigns;";
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses) from vicidial_campaigns;";
|
||||
}
|
||||
if ($non_latin > 0)
|
||||
{
|
||||
@@ -294,6 +294,9 @@ $ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
@@ -383,7 +386,7 @@ echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatusA, $DIALstatusB, $DIALstatusC, $DIALstatusD, $DIALstatusE </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
|
||||
@@ -130,7 +130,7 @@ $group = $groups[$k];
|
||||
echo "<b><a href=\"./AST_timeonVDADall.php?group=$group&RR=$RR&DB=$DB&adastats=$adastats\">$group</a></b> - ";
|
||||
echo "<a href=\"./admin.php?ADD=34&campaign_id=$group\">Modify</a>\n";
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
@@ -151,6 +151,9 @@ $ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -216,7 +219,7 @@ echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatusA, $DIALstatusB, $DIALstatusC, $DIALstatusD, $DIALstatusE </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
|
||||
+544
-419
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user