database changes for last commit

git-svn-id: svn://192.168.202.10@502 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2007-02-05 21:54:02 +00:00
parent a6acffb8e3
commit 4870bc0c5d
7 changed files with 421 additions and 199 deletions
+105 -37
View File
@@ -1,21 +1,23 @@
#!/usr/bin/perl
#
# AST_VDadapt.pl version 2.0.1 *DBI-version*
# AST_VDadapt.pl version 2.0.3 *DBI-version*
#
# DESCRIPTION:
# adjusts the auto_dial_level for vicidial adaptive-predictive campaigns.
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# 60823-1302 - first build from AST_VDhopper.pl
# 60825-1734 - functional alpha version, no loop
# 60826-0857 - added loop and CLI flag options
# 60827-0035 - separate Drop calculation and target dial level calculation into different subroutines
# - alter code so that DROP percentages would calculate only about once a minute no matter he loop delay
# 60828-1149 - add field for target dial_level difference, -1 would target one agent waiting, +1 would target 1 customer waiting
# 60919-1243 - changed variables to use arrays for all campaign-specific values
# 61215-1110 - added answered calls stats and use drops as percentage of answered for today
# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
# CHANGELOG
# 60823-1302 - First build from AST_VDhopper.pl
# 60825-1734 - Functional alpha version, no loop
# 60826-0857 - Added loop and CLI flag options
# 60827-0035 - Separate Drop calculation and target dial level calculation into different subroutines
# - Alter code so that DROP percentages would calculate only about once a minute no matter he loop delay
# 60828-1149 - Add field for target dial_level difference, -1 would target one agent waiting, +1 would target 1 customer waiting
# 60919-1243 - Changed variables to use arrays for all campaign-specific values
# 61215-1110 - Added answered calls stats and use drops as percentage of answered for today
# 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
#
# constants
@@ -295,6 +297,8 @@ while ($master_loop<$CLIloops)
@adaptive_latest_server_time=@MT;
@adaptive_intensity=@MT;
@adaptive_dl_diff_target=@MT;
@campaign_changedate=@MT;
@campaign_stats_refresh=@MT;
if ($CLIcampaign)
{
@@ -302,7 +306,7 @@ if ($CLIcampaign)
}
else
{
$stmtA = "SELECT * from vicidial_campaigns where active='Y'";
$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') )";
}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -311,28 +315,30 @@ $rec_count=0;
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]";
$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];
if (!$CLIlevel)
{$hopper_level[$rec_count] = "$aryA[13]";}
{$hopper_level[$rec_count] = $aryA[7];}
else
{$hopper_level[$rec_count] = "$CLIlevel";}
$auto_dial_level[$rec_count] = "$aryA[14]";
$local_call_time[$rec_count] = "$aryA[16]";
$lead_filter_id[$rec_count] = "$aryA[35]";
$use_internal_dnc[$rec_count] = "$aryA[43]";
$dial_method[$rec_count] = $aryA[46];
$available_only_ratio_tally[$i][$rec_count] = $aryA[47];
$adaptive_dropped_percentage[$rec_count] = $aryA[48];
$adaptive_maximum_level[$rec_count] = $aryA[49];
$adaptive_latest_server_time[$rec_count] = $aryA[50];
$adaptive_intensity[$rec_count] = $aryA[51];
$adaptive_dl_diff_target[$rec_count] = $aryA[52];
{$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];
$rec_count++;
}
@@ -397,6 +403,68 @@ foreach(@campaign_id)
&calculate_dial_level;
}
}
else
{
if ($campaign_stats_refresh[$i] =~ /Y/)
{
if ($drop_count_updater>=60)
{
if ($DB) {print " REFRESH OVERRIDE: $campaign_id[$i]\n";}
&calculate_drops;
$RESETdrop_count_updater++;
$stmtA = "UPDATE vicidial_campaigns SET campaign_stats_refresh='N' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
}
}
else
{
if ($campaign_changedate[$i] >= $VDL_ninty)
{
if ($drop_count_updater>=60)
{
if ($DB) {print " CHANGEDATE OVERRIDE: $campaign_id[$i]\n";}
&calculate_drops;
$RESETdrop_count_updater++;
}
}
}
}
}
else
{
if ($campaign_stats_refresh[$i] =~ /Y/)
{
if ($drop_count_updater>=60)
{
if ($DB) {print " REFRESH OVERRIDE: $campaign_id[$i]\n";}
&calculate_drops;
$RESETdrop_count_updater++;
$stmtA = "UPDATE vicidial_campaigns SET campaign_stats_refresh='N' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
}
}
else
{
if ($campaign_changedate[$i] >= $VDL_ninty)
{
if ($drop_count_updater>=60)
{
if ($DB) {print " CHANGEDATE OVERRIDE: $campaign_id[$i]\n";}
&calculate_drops;
$RESETdrop_count_updater++;
}
}
}
}
$i++;
}
@@ -505,6 +573,9 @@ if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_five = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get epoch of ninty seconds ago ###
$VDL_ninty = ($secX - (1 * 90));
### get date-time of one minute ago ###
$VDL_one = ($secX - (1 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_one);
@@ -875,6 +946,9 @@ if ($VCScalls_five[$i] > 0)
}
if ($DBX) {print "$campaign_id[$i]|$VCSdrops_five_pct[$i]|$VCSdrops_today_pct[$i]\n";}
$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]' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "$campaign_id[$i]|$stmtA|\n";}
}
@@ -941,12 +1015,6 @@ else
$differential_onemin[$i] = $stat_differential[$i];
}
## UPDATE STATS FOR CAMPAIGN
$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]' where campaign_id='$campaign_id[$i]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "$campaign_id[$i]|$stmtA|\n";}
if ( ($dial_method[$i] =~ /ADAPT_HARD_LIMIT|ADAPT_AVERAGE|ADAPT_TAPERED/) || ($force_test>0) )
{
# Calculate the optimal dial_level differential for the past minute
+29 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# AST_VDauto_dial.pl version 0.12 *DBI-version*
# AST_VDauto_dial.pl version 2.0.3 *DBI-version*
#
# DESCRIPTION:
# Places auto_dial calls on the VICIDIAL dialer system
@@ -27,7 +27,7 @@
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# changes:
# CHANGELOG:
# 50125-1201 - Changed dial timeout to 120 seconds from 180 seconds
# 50317-0954 - Added duplicate check per cycle to account for DB lockups
# 50322-1302 - Added campaign custom callerid feature
@@ -58,6 +58,7 @@
# 70116-1619 - Added VDAD Ring-No-Answer Auto Alt Dial code
# 70118-1539 - Added user_group logging to vicidial_user_log
# 70131-1550 - Fixed Manual dialing trunk shortage bug
# 70205-1414 - Added code for last called date update
#
@@ -265,6 +266,10 @@ while($one_day_interval > 0)
$user_campaignIP = '|';
$user_CIPct = 0;
$active_agents = "'READY','QUEUE','INCALL','DONE'";
$lists_update = '';
$LUcount=0;
$campaigns_update = '';
$CPcount=0;
##### Get a listing of the users that are active and ready to take calls
##### Also get a listing of the campaigns and campaigns/serverIP that will be used
@@ -284,6 +289,7 @@ while($one_day_interval > 0)
if ($user_campaigns !~ /\|$DBlive_campaign[$user_counter]\|/i)
{
if ($campaigns_update !~ /'$DBlive_campaign[$user_counter]'/) {$campaigns_update .= "'$DBlive_campaign[$user_counter]',"; $CPcount++;}
$user_campaigns .= "$DBlive_campaign[$user_counter]|";
$DBcampaigns[$user_campaigns_counter] = $DBlive_campaign[$user_counter];
$user_campaigns_counter++;
@@ -671,6 +677,7 @@ while($one_day_interval > 0)
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$list_id = "$aryA[7]";
$gmt_offset_now = "$aryA[8]";
$called_since_last_reset = "$aryA[9]";
$phone_code = "$aryA[10]";
@@ -744,6 +751,8 @@ while($one_day_interval > 0)
}
$PADlead_id = sprintf("%09s", $lead_id); while (length($PADlead_id) > 9) {chop($PADlead_id);}
if ($lists_update !~ /'$list_id'/) {$lists_update .= "'$list_id',"; $LUcount++;}
$lead_id_call_list .= "$lead_id|";
### whether to omit phone_code or not
@@ -1112,6 +1121,24 @@ while($one_day_interval > 0)
}
if ($LUcount > 0)
{
chop($lists_update);
$stmtA = "UPDATE vicidial_lists SET list_lastcalldate='$SQLdate' where list_id IN($lists_update);";
$affected_rows = $dbhA->do($stmtA);
$event_string = "| lastcalldate UPDATED $affected_rows|$lists_update|";
&event_logger;
}
if ($CPcount > 0)
{
chop($campaigns_update);
$stmtA = "UPDATE vicidial_campaigns SET campaign_logindate='$SQLdate' where campaign_id IN($campaigns_update);";
$affected_rows = $dbhA->do($stmtA);
$event_string = "| logindate UPDATED $affected_rows|$campaigns_update|";
&event_logger;
}
###############################################################################
###### last, wait for a little bit and repeat the loop
+167 -141
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# AST_VDauto_dial_FILL.pl version 0.1 *DBI-version*
# AST_VDauto_dial_FILL.pl version 2.0.3 *DBI-version*
#
# DESCRIPTION:
# Places auto_dial calls on the VICIDIAL dialer system across all servers only
@@ -14,9 +14,10 @@
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# changes:
# CHANGELOG:
# 61115-1246 - First build, framework setup, non-functional
# 61120-2008 - second alpha version, functional and tested in production
# 70205-1425 - Added code for last called date update
#
@@ -222,6 +223,8 @@ while($one_day_interval > 0)
$camp_counter=0;
$total_shortage=0;
$balance_servers=0;
$lists_update = '';
$LUcount=0;
$stmtA = "SELECT count(*) FROM servers where vicidial_balance_active = 'Y';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -512,165 +515,179 @@ while($one_day_interval > 0)
&event_logger;
##################################################################################
##### PLACE THE CALLS
##################################################################################
$event_string="$DBfill_campaign[$camp_CIPct] $DB_camp_server_server_ip[$server_CIPct]: CALLING";
&event_logger;
$call_CMPIPct=0;
$lead_id_call_list='|';
my $UDaffected_rows=0;
if ($call_CMPIPct < $DB_camp_server_trunks_to_dial[$server_CIPct])
$stmtA = "SELECT count(*) FROM vicidial_live_agents where campaign_id='$DBfill_campaign[$camp_CIPct]' and status NOT IN('PAUSED');";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
while ($sthArows > $rec_count)
{
$stmtA = "UPDATE vicidial_hopper set status='QUEUE', user='VDAD_$DB_camp_server_server_ip[$server_CIPct]' where campaign_id='$DBfill_campaign[$camp_CIPct]' and status='READY' order by hopper_id LIMIT $DB_camp_server_trunks_to_dial[$server_CIPct]";
print "|$stmtA|\n";
$UDaffected_rows = $dbhA->do($stmtA);
print "hopper rows updated to QUEUE: |$UDaffected_rows|\n";
@aryA = $sthA->fetchrow_array;
$LVA_count = $aryA[0];
$rec_count++;
}
$sthA->finish();
if ($UDaffected_rows)
if ($LVA_count > 0)
{
##################################################################################
##### PLACE THE CALLS
##################################################################################
$event_string="$DBfill_campaign[$camp_CIPct] $DB_camp_server_server_ip[$server_CIPct]: CALLING";
&event_logger;
$call_CMPIPct=0;
$lead_id_call_list='|';
my $UDaffected_rows=0;
if ($call_CMPIPct < $DB_camp_server_trunks_to_dial[$server_CIPct])
{
$lead_id=''; $phone_code=''; $phone_number=''; $called_count='';
while ($call_CMPIPct < $UDaffected_rows)
$stmtA = "UPDATE vicidial_hopper set status='QUEUE', user='VDAD_$DB_camp_server_server_ip[$server_CIPct]' where campaign_id='$DBfill_campaign[$camp_CIPct]' and status='READY' order by hopper_id LIMIT $DB_camp_server_trunks_to_dial[$server_CIPct]";
print "|$stmtA|\n";
$UDaffected_rows = $dbhA->do($stmtA);
print "hopper rows updated to QUEUE: |$UDaffected_rows|\n";
if ($UDaffected_rows)
{
$stmtA = "SELECT lead_id FROM vicidial_hopper where campaign_id='$DBfill_campaign[$camp_CIPct]' and status='QUEUE' and user='VDAD_$DB_camp_server_server_ip[$server_CIPct]' LIMIT 1";
print "|$stmtA|\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
$rec_countCUSTDATA=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$lead_id = "$aryA[0]";
$rec_count++;
}
$sthA->finish();
if ($lead_id_call_list =~ /\|$lead_id\|/)
$lead_id=''; $phone_code=''; $phone_number=''; $called_count='';
while ($call_CMPIPct < $UDaffected_rows)
{
print "!!!!!!!!!!!!!!!!duplicate lead_id for this run: |$lead_id| $lead_id_call_list\n";
if ($SYSLOG)
{
open(DUPout, ">>$PATHlogs/VDAD_DUPLICATE.$file_date")
|| die "Can't open $PATHlogs/VDAD_DUPLICATE.$file_date: $!\n";
print DUPout "$now_date-----$lead_id_call_list-----$lead_id\n";
close(DUPout);
}
}
else
{
$stmtA = "UPDATE vicidial_hopper set status='INCALL' where lead_id='$lead_id'";
$stmtA = "SELECT lead_id FROM vicidial_hopper where campaign_id='$DBfill_campaign[$camp_CIPct]' and status='QUEUE' and user='VDAD_$DB_camp_server_server_ip[$server_CIPct]' LIMIT 1";
print "|$stmtA|\n";
$UQaffected_rows = $dbhA->do($stmtA);
print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n";
$stmtA = "SELECT * FROM vicidial_list where lead_id='$lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
$rec_countCUSTDATA=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$gmt_offset_now = "$aryA[8]";
$called_since_last_reset = "$aryA[9]";
$phone_code = "$aryA[10]";
$phone_number = "$aryA[11]";
$called_count = "$aryA[30]";
$rec_countCUSTDATA++;
$rec_count++;
}
$sthA->finish();
if ($rec_countCUSTDATA)
{
### update called_count
$called_count++;
if ($called_since_last_reset =~ /^Y/)
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
$rec_countCUSTDATA=0;
while ($sthArows > $rec_count)
{
if ($called_since_last_reset =~ /^Y$/) {$CSLR = 'Y1';}
else
@aryA = $sthA->fetchrow_array;
$lead_id = "$aryA[0]";
$rec_count++;
}
$sthA->finish();
if ($lead_id_call_list =~ /\|$lead_id\|/)
{
print "!!!!!!!!!!!!!!!!duplicate lead_id for this run: |$lead_id| $lead_id_call_list\n";
if ($SYSLOG)
{
open(DUPout, ">>$PATHlogs/VDAD_DUPLICATE.$file_date")
|| die "Can't open $PATHlogs/VDAD_DUPLICATE.$file_date: $!\n";
print DUPout "$now_date-----$lead_id_call_list-----$lead_id\n";
close(DUPout);
}
}
else
{
$stmtA = "UPDATE vicidial_hopper set status='INCALL' where lead_id='$lead_id'";
print "|$stmtA|\n";
$UQaffected_rows = $dbhA->do($stmtA);
print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n";
$stmtA = "SELECT * FROM vicidial_list where lead_id='$lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
$rec_countCUSTDATA=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$list_id = "$aryA[7]";
$gmt_offset_now = "$aryA[8]";
$called_since_last_reset = "$aryA[9]";
$phone_code = "$aryA[10]";
$phone_number = "$aryA[11]";
$called_count = "$aryA[30]";
$rec_countCUSTDATA++;
$rec_count++;
}
$sthA->finish();
if ($rec_countCUSTDATA)
{
### update called_count
$called_count++;
if ($called_since_last_reset =~ /^Y/)
{
$called_since_last_reset =~ s/^Y//gi;
$called_since_last_reset++;
$CSLR = "Y$called_since_last_reset";
if ($called_since_last_reset =~ /^Y$/) {$CSLR = 'Y1';}
else
{
$called_since_last_reset =~ s/^Y//gi;
$called_since_last_reset++;
$CSLR = "Y$called_since_last_reset";
}
}
}
else {$CSLR = 'Y';}
else {$CSLR = 'Y';}
$stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR', called_count='$called_count',user='VDAD' where lead_id='$lead_id'";
$affected_rows = $dbhA->do($stmtA);
$stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id'";
$affected_rows = $dbhA->do($stmtA);
$CCID_on=0; $CCID='';
$local_DEF = 'Local/';
$local_AMP = '@';
$Local_out_prefix = '9';
$Local_dial_timeout = '60';
if ($DBIPdialtimeout[$camp_CIPct] > 4) {$Local_dial_timeout = $DBIPdialtimeout[$camp_CIPct];}
$Local_dial_timeout = ($Local_dial_timeout * 1000);
if (length($DBIPdialprefix[$camp_CIPct]) > 0) {$Local_out_prefix = "$DBIPdialprefix[$camp_CIPct]";}
if (length($DBIPvdadexten[$camp_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$camp_CIPct]";}
else {$VDAD_dial_exten = "$answer_transfer_agent";}
if (length($DBfill_campaigncid[$camp_CIPct]) > 6) {$CCID = "$DBfill_campaigncid[$camp_CIPct]"; $CCID_on++;}
if ($DBIPdialprefix[$camp_CIPct] =~ /x/i) {$Local_out_prefix = '';}
if ($RECcount)
{
if ( (length($RECprefix)>0) && ($called_count < $RECcount) )
{$Local_out_prefix .= "$RECprefix";}
}
$PADlead_id = sprintf("%09s", $lead_id); while (length($PADlead_id) > 9) {chop($PADlead_id);}
$lead_id_call_list .= "$lead_id|";
### whether to omit phone_code or not
if ($DBIPomitcode[$camp_CIPct] > 0)
{$Ndialstring = "$Local_out_prefix$phone_number";}
else
{$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
### use manager middleware-app to connect the next call to the meetme room
# VmmddhhmmssLLLLLLLLL
$VqueryCID = "V$CIDdate$PADlead_id";
if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";}
else {$CIDstring = "$VqueryCID";}
### insert a NEW record to the vicidial_manager table to be processed
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$DB_camp_server_server_ip[$server_CIPct]','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','')";
$stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR', called_count='$called_count',user='VDAD' where lead_id='$lead_id'";
$affected_rows = $dbhA->do($stmtA);
$event_string = "| number call dialed|$DBfill_campaign[$camp_CIPct]|$VqueryCID|$stmtA|$gmt_offset_now|";
&event_logger;
### insert a SENT record to the vicidial_auto_calls table
$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$DB_camp_server_server_ip[$server_CIPct]','$DBfill_campaign[$camp_CIPct]','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUTBALANCE')";
$stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id'";
$affected_rows = $dbhA->do($stmtA);
### sleep for a tenth of a second to not flood the server with new calls
usleep(1*25*1000);
$CCID_on=0; $CCID='';
$local_DEF = 'Local/';
$local_AMP = '@';
$Local_out_prefix = '9';
$Local_dial_timeout = '60';
if ($DBIPdialtimeout[$camp_CIPct] > 4) {$Local_dial_timeout = $DBIPdialtimeout[$camp_CIPct];}
$Local_dial_timeout = ($Local_dial_timeout * 1000);
if (length($DBIPdialprefix[$camp_CIPct]) > 0) {$Local_out_prefix = "$DBIPdialprefix[$camp_CIPct]";}
if (length($DBIPvdadexten[$camp_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$camp_CIPct]";}
else {$VDAD_dial_exten = "$answer_transfer_agent";}
if (length($DBfill_campaigncid[$camp_CIPct]) > 6) {$CCID = "$DBfill_campaigncid[$camp_CIPct]"; $CCID_on++;}
if ($DBIPdialprefix[$camp_CIPct] =~ /x/i) {$Local_out_prefix = '';}
if ($RECcount)
{
if ( (length($RECprefix)>0) && ($called_count < $RECcount) )
{$Local_out_prefix .= "$RECprefix";}
}
$PADlead_id = sprintf("%09s", $lead_id); while (length($PADlead_id) > 9) {chop($PADlead_id);}
if ($lists_update !~ /'$list_id'/) {$lists_update .= "'$list_id',"; $LUcount++;}
$lead_id_call_list .= "$lead_id|";
### whether to omit phone_code or not
if ($DBIPomitcode[$camp_CIPct] > 0)
{$Ndialstring = "$Local_out_prefix$phone_number";}
else
{$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
### use manager middleware-app to connect the next call to the meetme room
# VmmddhhmmssLLLLLLLLL
$VqueryCID = "V$CIDdate$PADlead_id";
if ($CCID_on) {$CIDstring = "\"$VqueryCID\" <$CCID>";}
else {$CIDstring = "$VqueryCID";}
### insert a NEW record to the vicidial_manager table to be processed
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$DB_camp_server_server_ip[$server_CIPct]','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','')";
$affected_rows = $dbhA->do($stmtA);
$event_string = "| number call dialed|$DBfill_campaign[$camp_CIPct]|$VqueryCID|$stmtA|$gmt_offset_now|";
&event_logger;
### insert a SENT record to the vicidial_auto_calls table
$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$DB_camp_server_server_ip[$server_CIPct]','$DBfill_campaign[$camp_CIPct]','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUTBALANCE')";
$affected_rows = $dbhA->do($stmtA);
### sleep for a tenth of a second to not flood the server with new calls
usleep(1*25*1000);
}
}
$call_CMPIPct++;
}
$call_CMPIPct++;
}
}
}
else
{
$event_string.="No Agents logged in, not dialing";
&event_logger;
}
@@ -720,6 +737,15 @@ while($one_day_interval > 0)
&get_time_now;
if ($LUcount > 0)
{
chop($lists_update);
$stmtA = "UPDATE vicidial_lists SET list_lastcalldate='$SQLdate' where list_id IN($lists_update);";
$affected_rows = $dbhA->do($stmtA);
$event_string = "| lastcalldate UPDATED $affected_rows|$lists_update|";
&event_logger;
}
###############################################################################
###### last, wait for a little bit and repeat the loop
###############################################################################
+9 -2
View File
@@ -514,14 +514,21 @@ adaptive_dl_diff_target SMALLINT(3) default '0',
concurrent_transfers ENUM('AUTO','1','2','3','4','5','6','7','8','9','10') default 'AUTO',
auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3') default 'NONE',
auto_alt_dial_statuses VARCHAR(255) default ' B N NA DC -',
agent_pause_codes_active ENUM('Y','N') default 'N'
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
);
CREATE TABLE vicidial_lists (
list_id BIGINT(14) UNSIGNED PRIMARY KEY NOT NULL,
list_name VARCHAR(30),
campaign_id VARCHAR(8),
active ENUM('Y','N')
active ENUM('Y','N'),
list_description VARCHAR(255),
list_changedate DATETIME,
list_lastcalldate DATETIME
);
CREATE TABLE vicidial_statuses (
+8 -2
View File
@@ -51,8 +51,6 @@ campaign_id VARCHAR(8),
index (campaign_id)
);
ALTER TABLE vicidial_list DROP INDEX lead_id;
ALTER TABLE recording_log DROP INDEX recording_id;
ALTER TABLE call_log DROP INDEX uniqueid;
@@ -76,3 +74,11 @@ ALTER TABLE vicidial_agent_log DROP INDEX agent_log_id;
ALTER TABLE vicidial_scripts DROP INDEX script_id;
ALTER TABLE vicidial_lead_recycle DROP INDEX recycle_id;
ALTER TABLE vicidial_lists ADD list_description VARCHAR(255);
ALTER TABLE vicidial_lists ADD list_changedate DATETIME;
ALTER TABLE vicidial_lists ADD list_lastcalldate DATETIME;
ALTER TABLE vicidial_campaigns ADD campaign_description VARCHAR(255);
ALTER TABLE vicidial_campaigns ADD campaign_changedate DATETIME;
ALTER TABLE vicidial_campaigns ADD campaign_stats_refresh ENUM('Y','N') default 'N';
ALTER TABLE vicidial_campaigns ADD campaign_logindate DATETIME;
@@ -102,6 +102,17 @@ there is already an entry for this campaign with this pause code||
AGENT PAUSE CODE ADDED||
AGENT PAUSE CODE NOT MODIFIED||
CAMPAIGN PAUSE CODE NOT DELETED||
Campaign Description -<\/B> This is a memo field for the campaign, it is optional and can be a maximum of 255 characters in length||
Campaign Change Date -<\/B> This is the last time that the settings for this campaign were modified in any way||
Campaign Stats Refresh -<\/B> This checkbox will allow you to force a vicidial stats refresh, even if the campaign is not active||
Last Campaign Login Date -<\/B> This is the last time that an agent was logged into this campaign||
List Description -<\/B> This is the memo field for the list, it is optional||
List Change Date -<\/B> This is the last time that the settings for this list were modified in any way||
List Last Call Date -<\/B> This is the last time that lead was dialed from this list||
List Description: ||
List Change Date: ||
Campaign Description: ||
############################################################ CLIENT
+92 -15
View File
@@ -531,13 +531,18 @@ if (isset($_GET["view_reports"])) {$view_reports=$_GET["view_reports"];}
elseif (isset($_POST["view_reports"])) {$view_reports=$_POST["view_reports"];}
if (isset($_GET["agent_pause_codes_active"])) {$agent_pause_codes_active=$_GET["agent_pause_codes_active"];}
elseif (isset($_POST["agent_pause_codes_active"])) {$agent_pause_codes_active=$_POST["agent_pause_codes_active"];}
if (isset($_GET["pause_code"])) {$pause_code=$_GET["pause_code"];}
elseif (isset($_POST["pause_code"])) {$pause_code=$_POST["pause_code"];}
if (isset($_GET["pause_code"])) {$pause_code=$_GET["pause_code"];}
elseif (isset($_POST["pause_code"])) {$pause_code=$_POST["pause_code"];}
if (isset($_GET["pause_code_name"])) {$pause_code_name=$_GET["pause_code_name"];}
elseif (isset($_POST["pause_code_name"])) {$pause_code_name=$_POST["pause_code_name"];}
if (isset($_GET["billable"])) {$billable=$_GET["billable"];}
elseif (isset($_POST["billable"])) {$billable=$_POST["billable"];}
if (isset($_GET["billable"])) {$billable=$_GET["billable"];}
elseif (isset($_POST["billable"])) {$billable=$_POST["billable"];}
if (isset($_GET["campaign_description"])) {$campaign_description=$_GET["campaign_description"];}
elseif (isset($_POST["campaign_description"])) {$campaign_description=$_POST["campaign_description"];}
if (isset($_GET["campaign_stats_refresh"])) {$campaign_stats_refresh=$_GET["campaign_stats_refresh"];}
elseif (isset($_POST["campaign_stats_refresh"])){$campaign_stats_refresh=$_POST["campaign_stats_refresh"];}
if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];}
elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
@@ -675,6 +680,7 @@ $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log);
$vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active);
$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs);
$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active);
$campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh);
### ALPHA-NUMERIC ONLY ###
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
@@ -689,6 +695,8 @@ $dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix);
$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state);
$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks);
$concurrent_transfers = ereg_replace("[^0-9a-zA-Z]","",$concurrent_transfers);
$billable = ereg_replace("[^0-9a-zA-Z]","",$billable);
$pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code);
### DIGITS and Dots
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
@@ -787,6 +795,9 @@ $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description
$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status);
$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name);
$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message);
$pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name);
$campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description);
$list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description);
### ALPHA-NUMERIC and underscore and dash and slash and at and dot
$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group);
@@ -904,14 +915,17 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql);
# 70123-1519 - Added user permission settings for all sections
# 70124-1346 - Fixed spelling errors and formatting consistency
# 70202-1120 - Added agent_pause_codes section to campaigns
# 70205-1204 - Added memo, last dialed, timestamp and stats-refresh fields to vicidial_campaigns/lists
#
# 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
$version = '2.0.83';
$build = '70202-1120';
$version = '2.0.84';
$build = '70205-1204';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
if ($force_logout)
{
@@ -1572,6 +1586,26 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<B>Campaign Name -</B> This is the description of the campaign, it must be between 6 and 40 characters in length.
<BR>
<A NAME="vicidial_campaigns-campaign_description">
<BR>
<B>Campaign Description -</B> This is a memo field for the campaign, it is optional and can be a maximum of 255 characters in length.
<BR>
<A NAME="vicidial_campaigns-campaign_changedate">
<BR>
<B>Campaign Change Date -</B> This is the last time that the settings for this campaign were modified in any way.
<BR>
<A NAME="vicidial_campaigns-campaign_logindate">
<BR>
<B>Last Campaign Login Date -</B> This is the last time that an agent was logged into this campaign.
<BR>
<A NAME="vicidial_campaigns-campaign_stats_refresh">
<BR>
<B>Campaign Stats Refresh -</B> This checkbox will allow you to force a vicidial stats refresh, even if the campaign is not active.
<BR>
<A NAME="vicidial_campaigns-active">
<BR>
@@ -1836,6 +1870,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<B>List Name -</B> This is the description of the list, it must be between 2 and 20 characters in length.
<BR>
<A NAME="vicidial_lists-list_description">
<BR>
<B>List Description -</B> This is the memo field for the list, it is optional.
<BR>
<A NAME="vicidial_lists-list_changedate">
<BR>
<B>List Change Date -</B> This is the last time that the settings for this list were modified in any way.
<BR>
<A NAME="vicidial_lists-list_lastcalldate">
<BR>
<B>List Last Call Date -</B> This is the last time that lead was dialed from this list.
<BR>
<A NAME="vicidial_lists-campaign_id">
<BR>
@@ -3129,6 +3178,7 @@ if ($ADD==11)
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><input type=text name=campaign_id size=10 maxlength=8>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=30 maxlength=30>$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Description: </td><td align=left><input type=text name=campaign_description size=30 maxlength=255>$NWB#vicidial_campaigns-campaign_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Extension: </td><td align=left><input type=text name=park_ext size=10 maxlength=10>$NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Filename: </td><td align=left><input type=text name=park_file_name size=10 maxlength=10>$NWB#vicidial_campaigns-park_file_name$NWE</td></tr>\n";
@@ -3170,6 +3220,7 @@ if ($ADD==111)
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List ID: </td><td align=left><input type=text name=list_id size=8 maxlength=8> (digits only)$NWB#vicidial_lists-list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Name: </td><td align=left><input type=text name=list_name size=20 maxlength=20>$NWB#vicidial_lists-list_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Description: </td><td align=left><input type=text name=list_description size=30 maxlength=255>$NWB#vicidial_lists-list_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
@@ -3676,7 +3727,7 @@ if ($ADD==21)
{
echo "<br><B>CAMPAIGN ADDED: $campaign_id</B>\n";
$stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');";
$stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,campaign_description,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch,campaign_changedate,campaign_stats_refresh) values('$campaign_id','$campaign_name','$campaign_description','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch','$SQLdate','Y');";
$rslt=mysql_query($stmt, $link);
$stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');";
@@ -3942,14 +3993,14 @@ if ($ADD==211)
{
echo "<br><B>LIST ADDED: $list_id</B>\n";
$stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');";
$stmt="INSERT INTO vicidial_lists (list_id,list_name,campaign_id,active,list_description,list_changedate) values('$list_id','$list_name','$campaign_id','$active','$list_description','$SQLdate');";
$rslt=mysql_query($stmt, $link);
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n");
fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
@@ -4552,6 +4603,7 @@ if ($ADD==41)
{
echo "<br>CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>the campaign name needs to be at least 6 characters in length\n";
echo "<br>|$campaign_name|$active|\n";
}
else
{
@@ -4586,7 +4638,7 @@ if ($ADD==41)
}
}
}
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active' where campaign_id='$campaign_id';";
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link);
if ($reset_hopper == 'Y')
@@ -4744,7 +4796,7 @@ if ($ADD==44)
}
}
}
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity' where campaign_id='$campaign_id';";
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', $adlSQL lead_filter_id='$lead_filter_id',dial_method='$dial_method',adaptive_intensity='$adaptive_intensity',campaign_description='$campaign_description',campaign_changedate='$SQLdate' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link);
if ($reset_hopper == 'Y')
@@ -4880,7 +4932,7 @@ if ($ADD==411)
{
echo "<br><B>LIST MODIFIED: $list_id</B>\n";
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';";
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate' where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
if ($reset_list == 'Y')
@@ -4888,6 +4940,7 @@ if ($ADD==411)
echo "<br>RESETTING LIST-CALLED-STATUS\n";
$stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
### LOG RESET TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
@@ -4907,7 +4960,7 @@ if ($ADD==411)
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n");
fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description' where list_id='$list_id'|\n");
fclose($fp);
}
}
@@ -6790,6 +6843,7 @@ if ($ADD==31)
$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$campaign_name = $row[1];
$dial_status_a = $row[3];
$dial_status_b = $row[4];
$dial_status_c = $row[5];
@@ -6841,6 +6895,10 @@ if ($ADD==31)
$auto_alt_dial = $row[54];
$auto_alt_dial_statuses = $row[55];
$agent_pause_codes_active = $row[56];
$campaign_description = $row[57];
$campaign_changedate = $row[58];
$campaign_stats_refresh = $row[59];
$campaign_logindate = $row[60];
echo "<br>MODIFY A CAMPAIGNS RECORD: $row[0] - <a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\">Basic View</a>";
echo " | Detail View</a> | ";
@@ -6850,7 +6908,10 @@ if ($ADD==31)
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><b>$row[0]</b>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=40 maxlength=40 value=\"$row[1]\">$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=40 maxlength=40 value=\"$campaign_name\">$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Description: </td><td align=left><input type=text name=campaign_description size=40 maxlength=255 value=\"$campaign_description\">$NWB#vicidial_campaigns-campaign_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Change Date: </td><td align=left>$campaign_changedate &nbsp; $NWB#vicidial_campaigns-campaign_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Login Date: </td><td align=left>$campaign_logindate &nbsp; $NWB#vicidial_campaigns-campaign_logindate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$row[2]</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Extension: </td><td align=left><input type=text name=park_ext size=10 maxlength=10 value=\"$row[9]\"> - Filename: <input type=text name=park_file_name size=10 maxlength=10 value=\"$row[10]\">$NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=50 maxlength=255 value=\"$row[11]\">$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
@@ -7046,6 +7107,8 @@ if ($ADD==31)
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Pause Codes Active: </td><td align=left><select size=1 name=agent_pause_codes_active><option>Y</option><option>N</option><option SELECTED>$agent_pause_codes_active</option></select>$NWB#vicidial_campaigns-agent_pause_codes_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Stats Refresh: </td><td align=left><select size=1 name=campaign_stats_refresh><option>Y</option><option>N</option><option SELECTED>$campaign_stats_refresh</option></select>$NWB#vicidial_campaigns-campaign_stats_refresh$NWE</td></tr>\n";
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id))
{
@@ -7406,6 +7469,10 @@ if ($ADD==34)
$display_dialable_count = $row[39];
$dial_method = $row[46];
$adaptive_intensity = $row[51];
$campaign_description = $row[57];
$campaign_changedate = $row[58];
$campaign_stats_refresh = $row[59];
$campaign_logindate = $row[60];
echo "<br>MODIFY A CAMPAIGN'S RECORD: $row[0] - Basic View | ";
echo "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id\">Detail View</a> | ";
@@ -7416,6 +7483,10 @@ if ($ADD==34)
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign ID: </td><td align=left><b>$row[0]</b>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Name: </td><td align=left><input type=text name=campaign_name size=40 maxlength=40 value=\"$row[1]\">$NWB#vicidial_campaigns-campaign_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Description: </td><td align=left><input type=text name=campaign_changedate size=40 maxlength=255 value=\"$campaign_description\">$NWB#vicidial_campaigns-campaign_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Change Date: </td><td align=left>$campaign_changedate &nbsp; $NWB#vicidial_campaigns-campaign_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Login Date: </td><td align=left>$campaign_logindate &nbsp; $NWB#vicidial_campaigns-campaign_logindate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$row[2]</option></select>$NWB#vicidial_campaigns-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Park Extension: </td><td align=left>$row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left>$row[11]$NWB#vicidial_campaigns-web_form_address$NWE</td></tr>\n";
@@ -7625,6 +7696,9 @@ if ($ADD==311)
$row=mysql_fetch_row($rslt);
$campaign_id = $row[2];
$active = $row[3];
$list_description = $row[4];
$list_changedate = $row[5];
$list_lastcalldate = $row[6];
# grab names of global statuses and statuses in the selected campaign
$stmt="SELECT * from vicidial_statuses order by status";
@@ -7658,6 +7732,7 @@ if ($ADD==311)
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List ID: </td><td align=left><b>$row[0]</b>$NWB#vicidial_lists-list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Name: </td><td align=left><input type=text name=list_name size=20 maxlength=20 value=\"$row[1]\">$NWB#vicidial_lists-list_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Description: </td><td align=left><input type=text name=list_description size=30 maxlength=255 value=\"$list_description\">$NWB#vicidial_lists-list_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\">Campaign</a>: </td><td align=left><select size=1 name=campaign_id>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
@@ -7676,6 +7751,8 @@ if ($ADD==311)
echo "</select>$NWB#vicidial_lists-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_lists-active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Reset Lead-Called-Status for this list: </td><td align=left><select size=1 name=reset_list><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_lists-reset_list$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Change Date: </td><td align=left>$list_changedate &nbsp; $NWB#vicidial_lists-list_changedate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List Last Call Date: </td><td align=left>$list_lastcalldate &nbsp; $NWB#vicidial_lists-list_lastcalldate$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";