2006-06-16 snapshot

git-svn-id: svn://192.168.202.10@9 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-07-07 15:27:12 +00:00
parent 36f070cc92
commit 8d319a6c2c
30 changed files with 4284 additions and 450 deletions
+21 -3
View File
@@ -11,6 +11,7 @@
# #
# #
# 50810-1540 - Added database server variable definitions lookup # 50810-1540 - Added database server variable definitions lookup
# 60615-1717 - Added definition GMT lookup from database not flat text file
# #
$MT[0]=''; $MT[0]='';
@@ -154,9 +155,26 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC
if ($DB) {print " - Unique Country dial codes found: $rec_countY\n";} if ($DB) {print " - Unique Country dial codes found: $rec_countY\n";}
open(codefile, "/home/cron/phone_codes_GMT.txt") || die "can't open /home/cron/phone_codes_GMT.txt: $!\n"; $stmtA = "select * from vicidial_phone_codes;";
@codefile = <codefile>; if($DBX){print STDERR "\n|$stmtA|\n";}
close(codefile); $dbhA->query($stmtA);
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
$rec_countZ=0;
@codefile=@MT;
while ($recordA = $iterA->each)
{
$codefile[$rec_countZ] = "$recordA->[0]\t$recordA->[1]\t$recordA->[2]\t$recordA->[3]\t$recordA->[4]\t$recordA->[5]\t$recordA->[6]\t$recordA->[7]\n";
$rec_countZ++;
}
}
if ($DB) {print " - GMT phone codes records: $rec_countZ\n";}
# open(codefile, "/home/cron/phone_codes_GMT.txt") || die "can't open /home/cron/phone_codes_GMT.txt: $!\n";
# @codefile = <codefile>;
# close(codefile);
$ep=0; $ei=0; $ee=0; $ep=0; $ei=0; $ee=0;
$d=0; $d=0;
+28 -18
View File
@@ -1,11 +1,15 @@
#!/usr/bin/perl #!/usr/bin/perl
# ADMIN_area_code_populate.pl version 1.1 for Perl # ADMIN_area_code_populate.pl version 1.1.12 for Perl
# #
# Copyright (C) 2006 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # Copyright (C) 2006 Joe Johnson,Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# #
# Description: # Description:
# server application that allows load areacodes into to asterisk list database # server application that allows load areacodes into to asterisk list database
# #
#
# CHANGES
# 60615-1514 - Changed to ignore the header row
#
use lib ".\\",".\\libs", './', './libs', '../libs', '/usr/local/perl_TK/libs', 'C:\\AST_VICI\\libs'; use lib ".\\",".\\libs", './', './libs', '../libs', '/usr/local/perl_TK/libs', 'C:\\AST_VICI\\libs';
use Time::HiRes ('gettimeofday','usleep','sleep'); # needed to have perl sleep in increments of less than one second use Time::HiRes ('gettimeofday','usleep','sleep'); # needed to have perl sleep in increments of less than one second
@@ -27,25 +31,31 @@ $slash_star = '\*';
close(codefile); close(codefile);
$pc=0; $pc=0;
$ins_stmt="insert into vicidial_phone_codes VALUES "; $ins_stmt="insert into vicidial_phone_codes VALUES ";
foreach (@codefile) { foreach (@codefile)
{
@row=split(/\t/, $codefile[$pc]); @row=split(/\t/, $codefile[$pc]);
$row[7] =~ s/\r|\n|\t| $//gi; if ($codefile[$pc] !~ /GEOGRAPHIC DESCRIPTION/)
$row[6] =~ s/\r|\n|\t| $//gi; {
$row[5] =~ s/\r|\n|\t| $//gi; $pc++;
$row[4] =~ s/\r|\n|\t| $//gi; $row[7] =~ s/\r|\n|\t| $//gi;
$row[3] =~ s/\r|\n|\t| $//gi; $row[6] =~ s/\r|\n|\t| $//gi;
$row[2] =~ s/\r|\n|\t| $//gi; $row[5] =~ s/\r|\n|\t| $//gi;
$row[1] =~ s/\r|\n|\t| $//gi; $row[4] =~ s/\r|\n|\t| $//gi;
$row[0] =~ s/\r|\n|\t| $//gi; $row[3] =~ s/\r|\n|\t| $//gi;
$pc++; $row[2] =~ s/\r|\n|\t| $//gi;
$ins_stmt.="('$row[0]', '$row[1]', '$row[2]', '$row[3]', '$row[4]', '$row[5]', '$row[6]', '$row[7]'), "; $row[1] =~ s/\r|\n|\t| $//gi;
if ($pc =~ /00$/) { $row[0] =~ s/\r|\n|\t| $//gi;
chop($ins_stmt); $ins_stmt.="('$row[0]', '$row[1]', '$row[2]', '$row[3]', '$row[4]', '$row[5]', '$row[6]', '$row[7]'), ";
chop($ins_stmt); if ($pc =~ /00$/)
$dbh->query($ins_stmt) || die "can't execute query: |$ins_stmt| $!\n"; {
$ins_stmt="insert into vicidial_phone_codes VALUES "; chop($ins_stmt);
print STDERR "$pc\n"; chop($ins_stmt);
$dbh->query($ins_stmt) || die "can't execute query: |$ins_stmt| $!\n";
$ins_stmt="insert into vicidial_phone_codes VALUES ";
print STDERR "$pc\n";
}
} }
else {$pc++;}
} }
chop($ins_stmt); chop($ins_stmt);
+25 -91
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# AST_VDauto_dial.pl version 0.10 # AST_VDauto_dial.pl version 0.11
# #
# DESCRIPTION: # DESCRIPTION:
# uses Net::MySQL to place auto_dial calls on the VICIDIAL dialer system # uses Net::MySQL to place auto_dial calls on the VICIDIAL dialer system
@@ -41,6 +41,10 @@
# 60120-1522 - corrected time error for hour variable, caused agi problems # 60120-1522 - corrected time error for hour variable, caused agi problems
# 60427-1223 - Fixed Blended in/out CLOSER campaign issue # 60427-1223 - Fixed Blended in/out CLOSER campaign issue
# 60608-1134 - Altered vac table field of call_type for IN OUT distinction # 60608-1134 - Altered vac table field of call_type for IN OUT distinction
# 60612-1324 - Altered dead call section to accept BUSY detection from VD_hangup
# - Altered dead call section to accept DISCONNECT detection from VD_hangup
# 60614-1142 - Added code to work with recycled leads, multi called_since_last_reset values
# - Removed gmt lead validation because it is already done by VDhopper
# #
@@ -324,80 +328,6 @@ while($one_day_interval > 0)
$user_CIPct = 0; $user_CIPct = 0;
foreach(@DBIPcampaign) foreach(@DBIPcampaign)
{ {
##### calculate what gmt_offset_now values are within the allowed local_call_time setting
if ($DBIPcalltime[$user_CIPct] =~ /24hours/)
{
$p='13';
$GMT_allowed = '|';
while ($p > -13)
{
$tz = sprintf("%.2f", $p); $GMT_allowed .= "$tz|";
$p = ($p - 0.25);
}
}
if ($DBIPcalltime[$user_CIPct] =~ /9am-9pm/)
{
$p='13';
$GMT_allowed = '|';
while ($p > -13)
{
$GMT_test = ($GMT_now + ($p * 3600));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test);
if ( ($hour >= 9) && ($hour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "$tz|";}
$p = ($p - 0.25);
}
}
if ($DBIPcalltime[$user_CIPct] =~ /9am-5pm/)
{
$p='13';
$GMT_allowed = '|';
while ($p > -13)
{
$GMT_test = ($GMT_now + ($p * 3600));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test);
if ( ($hour >= 9) && ($hour <= 16) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "$tz|";}
$p = ($p - 0.25);
}
}
if ($DBIPcalltime[$user_CIPct] =~ /12pm-5pm/)
{
$p='13';
$GMT_allowed = '|';
while ($p > -13)
{
$GMT_test = ($GMT_now + ($p * 3600));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test);
if ( ($hour >= 12) && ($hour <= 16) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "$tz|";}
$p = ($p - 0.25);
}
}
if ($DBIPcalltime[$user_CIPct] =~ /12pm-9pm/)
{
$p='13';
$GMT_allowed = '|';
while ($p > -13)
{
$GMT_test = ($GMT_now + ($p * 3600));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test);
if ( ($hour >= 12) && ($hour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "$tz|";}
$p = ($p - 0.25);
}
}
if ($local_call_time[$i] =~ /5pm-9pm/)
{
$p='13';
$GMT_allowed = '|';
while ($p > -13)
{
$GMT_test = ($GMT_now + ($p * 3600));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test);
if ( ($hour >= 17) && ($hour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "$tz|";}
$p = ($p - 0.25);
}
}
$event_string="$DBIPcampaign[$user_CIPct] $DBIPaddress[$user_CIPct]: CALLING"; $event_string="$DBIPcampaign[$user_CIPct] $DBIPaddress[$user_CIPct]: CALLING";
&event_logger; &event_logger;
$call_CMPIPct=0; $call_CMPIPct=0;
@@ -454,6 +384,7 @@ while($one_day_interval > 0)
while ( $record = $iter->each) while ( $record = $iter->each)
{ {
$gmt_offset_now = "$record->[8]"; $gmt_offset_now = "$record->[8]";
$called_since_last_reset = "$record->[9]";
$phone_code = "$record->[10]"; $phone_code = "$record->[10]";
$phone_number = "$record->[11]"; $phone_number = "$record->[11]";
$called_count = "$record->[30]"; $called_count = "$record->[30]";
@@ -461,24 +392,24 @@ while($one_day_interval > 0)
$rec_countCUSTDATA++; $rec_countCUSTDATA++;
} }
} }
if ( ($rec_countCUSTDATA) && ($GMT_allowed !~ /\|$gmt_offset_now\|/) )
{
$rec_countCUSTDATA=0;
$stmtA = "DELETE FROM vicidial_hopper where lead_id='$lead_id'";
$dbhA->query("$stmtA");
my $affected_rows = $dbhA->get_affected_rows_length;
# $GMT_allowed
$event_string = "| out of call time range lead DELETED $affected_rows|$lead_id|$phone_number|$gmt_offset_now|";
&event_logger;
}
if ($rec_countCUSTDATA) if ($rec_countCUSTDATA)
{ {
### update called_count ### update called_count
$called_count++; $called_count++;
if ($called_since_last_reset =~ /^Y/)
{
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';}
$stmtA = "UPDATE vicidial_list set called_since_last_reset='Y', called_count='$called_count',user='VDAD' where lead_id='$lead_id'"; $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR', called_count='$called_count',user='VDAD' where lead_id='$lead_id'";
$dbhA->query("$stmtA"); $dbhA->query("$stmtA");
my $affected_rows = $dbhA->get_affected_rows_length; my $affected_rows = $dbhA->get_affected_rows_length;
@@ -519,7 +450,6 @@ while($one_day_interval > 0)
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$DBIPaddress[$user_CIPct]','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','')"; $stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$DBIPaddress[$user_CIPct]','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','')";
$dbhA->query($stmtA); $dbhA->query($stmtA);
# $GMT_allowed
$event_string = "| number call dialed|$DBIPcampaign[$user_CIPct]|$VqueryCID|$stmtA|$gmt_offset_now|"; $event_string = "| number call dialed|$DBIPcampaign[$user_CIPct]|$VqueryCID|$stmtA|$gmt_offset_now|";
&event_logger; &event_logger;
@@ -642,12 +572,17 @@ while($one_day_interval > 0)
if ($CLstatus !~ /XFER|CLOSER/) if ($CLstatus !~ /XFER|CLOSER/)
{ {
if ($CLstatus =~ /BUSY/) {$CLnew_status = 'B';}
else
{
if ($CLstatus =~ /DISCONNECT/) {$CLnew_status = 'DC';}
else {$CLnew_status = 'NA';}
}
if ($CLstatus =~ /LIVE/) {$CLnew_status = 'DROP';} if ($CLstatus =~ /LIVE/) {$CLnew_status = 'DROP';}
else else
{ {
$CLnew_status = 'NA';
$end_epoch = ($now_date_epoch + 1); $end_epoch = ($now_date_epoch + 1);
$stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','NA','$CLphone_code','$CLphone_number','VDAD','N','1','$end_epoch')"; $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','$CLnew_status','$CLphone_code','$CLphone_number','VDAD','N','1','$end_epoch')";
if($M){print STDERR "\n|$stmtA|\n";} if($M){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA); $dbhA->query($stmtA);
@@ -857,7 +792,6 @@ exit;
sub get_time_now #get the current date and time and epoch for logging call lengths and datetimes sub get_time_now #get the current date and time and epoch for logging call lengths and datetimes
{ {
$secX = time();
$secX = time(); $secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secX); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secX);
$LOCAL_GMT_OFF = $SERVER_GMT; $LOCAL_GMT_OFF = $SERVER_GMT;
+134 -4
View File
@@ -34,6 +34,8 @@
# 60418-0947 - Added lead filter per campaign # 60418-0947 - Added lead filter per campaign
# 60509-1416 - Rewrite of local_call_time functions # 60509-1416 - Rewrite of local_call_time functions
# 60511-1150 - Added inserts into vicidial_campaign_stats table # 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
# #
# constants # constants
@@ -324,6 +326,7 @@ if ($dbhA->has_selected_record)
{$hopper_level[$rec_count] = "$CLIlevel";} {$hopper_level[$rec_count] = "$CLIlevel";}
$local_call_time[$rec_count] = "$record->[16]"; $local_call_time[$rec_count] = "$record->[16]";
$lead_filter_id[$rec_count] = "$record->[35]"; $lead_filter_id[$rec_count] = "$record->[35]";
$use_internal_dnc[$rec_count] = "$record->[43]";
$rec_count++; $rec_count++;
} }
} }
@@ -767,7 +770,65 @@ foreach(@campaign_id)
##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### ##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ###
##### BEGIN lead recycling parsing and prep ###
$stmtA = "SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id[$i]' and active='Y';";
$dbhA->query("$stmtA");
$rec_ct=0;
if ($dbhA->has_selected_record)
{
@recycle_status=@MT;
@recycle_delay=@MT;
@recycle_maximum=@MT;
@RSQLdate=@MT;
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$recycle_status[$rec_ct] = $record->[2];
$recycle_delay[$rec_ct] = $record->[3];
$recycle_maximum[$rec_ct] = $record->[4];
$rec_ct++;
}
}
if ($rec_ct > 0)
{
$rc=0;
$recycle_SQL = "( ";
while($rc < $rec_ct)
{
$secX = time();
$Rtarget = ($secX - $recycle_delay[$rc]);
($Rsec,$Rmin,$Rhour,$Rmday,$Rmon,$Ryear,$Rwday,$Ryday,$Risdst) = localtime($Rtarget);
$Ryear = ($Ryear + 1900);
$Rmon++;
if ($Rmon < 10) {$Rmon = "0$Rmon";}
if ($Rmday < 10) {$Rmday = "0$Rmday";}
if ($Rhour < 10) {$Rhour = "0$Rhour";}
if ($Rmin < 10) {$Rmin = "0$Rmin";}
if ($Rsec < 10) {$Rsec = "0$Rsec";}
$RSQLdate[$rc] = "$Ryear-$Rmon-$Rmday $Rhour:$Rmin:$Rsec";
$Y=1;
$recycle_Y = "'Y'";
while ($Y < $recycle_maximum[$rc])
{
$recycle_Y .= ",'Y$Y'";
$Y++;
}
if ($rc > 0) {$recycle_SQL .= " or ";}
$recycle_SQL .= "( (called_since_last_reset IN($recycle_Y)) and (status='$recycle_status[$rc]') and (modify_date < \"$RSQLdate[$rc]\") )";
if ($DBX) {print "RECYCLE: |$campaign_id[$i]|$recycle_status[$rc]|$recycle_delay[$rc]|$recycle_maximum[$rc]|$RSQLdate[$rc]|\n";}
$rc++;
}
$recycle_SQL .= " )";
if ($DBX) {print "RECYCLE SQL: |$recycle_SQL|\n";}
}
##### END lead recycling parsing and prep ###
if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] \n";} if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] \n";}
@@ -942,6 +1003,37 @@ foreach(@campaign_id)
if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;} if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;}
if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;} if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;}
### BEGIN recycle grab leads ###
if ($rec_ct > 0)
{
if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";}
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] limit 100;";
if ($DBX) {print " |$stmtA|\n";}
$REC_rec_countLEADS=0;
@REC_leads_to_hopper=@MT;
@REC_lists_to_hopper=@MT;
@REC_phone_to_hopper=@MT;
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$REC_leads_to_hopper[$REC_rec_countLEADS] = "$record->[0]";
$REC_lists_to_hopper[$REC_rec_countLEADS] = "$record->[1]";
$REC_gmt_to_hopper[$REC_rec_countLEADS] = "$record->[2]";
$REC_phone_to_hopper[$REC_rec_countLEADS] = "$record->[3]";
$REC_state_to_hopper[$REC_rec_countLEADS] = "$record->[4]";
if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";}
$REC_rec_countLEADS++;
}
}
if ($DB) {print " RECYCLE leads to call count: $REC_rec_countLEADS\n";}
if ($DBX) {print " |$stmtA|\n";}
}
### END recycle grab leads ###
if ($NEW_count > 0) if ($NEW_count > 0)
{ {
$NEW_level = int($hopper_level[$i] / $NEW_count); $NEW_level = int($hopper_level[$i] / $NEW_count);
@@ -973,8 +1065,6 @@ foreach(@campaign_id)
} }
if ($DB) {print " lead call order: $order_stmt\n";} 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) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $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('$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) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;";
if ($DBX) {print " |$stmtA|\n";} if ($DBX) {print " |$stmtA|\n";}
@@ -985,6 +1075,9 @@ foreach(@campaign_id)
$rec_countLEADS=0; $NEW_dec=99; $NEW_in=0; $rec_countLEADS=0; $NEW_dec=99; $NEW_in=0;
@leads_to_hopper=@MT; @leads_to_hopper=@MT;
@lists_to_hopper=@MT; @lists_to_hopper=@MT;
@gmt_to_hopper=@MT;
@state_to_hopper=@MT;
@phone_to_hopper=@MT;
while ( $record = $iter->each) while ( $record = $iter->each)
{ {
if ( ($NEW_count > 0) && ($NEW_rec_countLEADS > $NEW_in) ) if ( ($NEW_count > 0) && ($NEW_rec_countLEADS > $NEW_in) )
@@ -1000,16 +1093,28 @@ foreach(@campaign_id)
$lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]";
$gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]";
$state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]";
$phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]";
if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";}
$rec_countLEADS++; $rec_countLEADS++;
$NEW_in++; $NEW_in++;
$NEW_dec=2; $NEW_dec=2;
} }
} }
if ($REC_rec_countLEADS > $REC_insert_count)
{
$leads_to_hopper[$rec_countLEADS] = "$REC_leads_to_hopper[$REC_insert_count]";
$lists_to_hopper[$rec_countLEADS] = "$REC_lists_to_hopper[$REC_insert_count]";
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
$rec_countLEADS++;
$REC_insert_count++;
}
$leads_to_hopper[$rec_countLEADS] = "$record->[0]"; $leads_to_hopper[$rec_countLEADS] = "$record->[0]";
$lists_to_hopper[$rec_countLEADS] = "$record->[1]"; $lists_to_hopper[$rec_countLEADS] = "$record->[1]";
$gmt_to_hopper[$rec_countLEADS] = "$record->[2]"; $gmt_to_hopper[$rec_countLEADS] = "$record->[2]";
$state_to_hopper[$rec_countLEADS] = "$record->[4]"; $state_to_hopper[$rec_countLEADS] = "$record->[4]";
$phone_to_hopper[$rec_countLEADS] = "$record->[3]";
if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";}
$rec_countLEADS++; $rec_countLEADS++;
} }
@@ -1024,8 +1129,33 @@ foreach(@campaign_id)
{ {
if ($leads_to_hopper[$h] != '0') if ($leads_to_hopper[$h] != '0')
{ {
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');"; $DNClead=0;
$dbhA->query("$stmtA"); if ($use_internal_dnc[$i] =~ /Y/)
{
if ($DB) {print " Doinbg DNC Check: $phone_to_hopper[$h]\n";}
$stmtA = "SELECT count(*) from vicidial_dnc where phone_number='$phone_to_hopper[$h]';";
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
$rec_count=0;
while ( $record = $iter->each)
{
$DNClead = "$record->[0]";
}
}
if ($DNClead != '0')
{
$stmtA = "UPDATE vicidial_list SET status='DNCL' where lead_id='$leads_to_hopper[$h]';";
$dbhA->query("$stmtA");
if ($DB) {print "Flagging DNC lead: $leads_to_hopper[$h] $phone_to_hopper[$h]\n";}
}
}
if ($DNClead == '0')
{
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');";
$dbhA->query("$stmtA");
}
} }
$h++; $h++;
} }
+144 -3
View File
@@ -35,6 +35,8 @@
# 60418-0947 - Added lead filter per campaign # 60418-0947 - Added lead filter per campaign
# 60509-1416 - Rewrite of local_call_time functions # 60509-1416 - Rewrite of local_call_time functions
# 60511-1150 - Added inserts into vicidial_campaign_stats table # 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
# #
# constants # constants
@@ -303,6 +305,7 @@ while ($sthArows > $rec_count)
{$hopper_level[$rec_count] = "$CLIlevel";} {$hopper_level[$rec_count] = "$CLIlevel";}
$local_call_time[$rec_count] = "$aryA[16]"; $local_call_time[$rec_count] = "$aryA[16]";
$lead_filter_id[$rec_count] = "$aryA[35]"; $lead_filter_id[$rec_count] = "$aryA[35]";
$use_internal_dnc[$rec_count] = "$aryA[43]";
$rec_count++; $rec_count++;
} }
$sthA->finish(); $sthA->finish();
@@ -747,7 +750,65 @@ foreach(@campaign_id)
##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### ##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ###
##### BEGIN lead recycling parsing and prep ###
$stmtA = "SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id[$i]' and active='Y';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@recycle_status=@MT;
@recycle_delay=@MT;
@recycle_maximum=@MT;
@RSQLdate=@MT;
$rec_ct=0;
while ($sthArows > $rec_ct)
{
@aryA = $sthA->fetchrow_array;
$recycle_status[$rec_ct] = "$aryA[2]";
$recycle_delay[$rec_ct] = "$aryA[3]";
$recycle_maximum[$rec_ct] = "$aryA[4]";
$rec_ct++;
}
$sthA->finish();
if ($rec_ct > 0)
{
$rc=0;
$recycle_SQL = "( ";
while($rc < $rec_ct)
{
$secX = time();
$Rtarget = ($secX - $recycle_delay[$rc]);
($Rsec,$Rmin,$Rhour,$Rmday,$Rmon,$Ryear,$Rwday,$Ryday,$Risdst) = localtime($Rtarget);
$Ryear = ($Ryear + 1900);
$Rmon++;
if ($Rmon < 10) {$Rmon = "0$Rmon";}
if ($Rmday < 10) {$Rmday = "0$Rmday";}
if ($Rhour < 10) {$Rhour = "0$Rhour";}
if ($Rmin < 10) {$Rmin = "0$Rmin";}
if ($Rsec < 10) {$Rsec = "0$Rsec";}
$RSQLdate[$rc] = "$Ryear-$Rmon-$Rmday $Rhour:$Rmin:$Rsec";
$Y=1;
$recycle_Y = "'Y'";
while ($Y < $recycle_maximum[$rc])
{
$recycle_Y .= ",'Y$Y'";
$Y++;
}
if ($rc > 0) {$recycle_SQL .= " or ";}
$recycle_SQL .= "( (called_since_last_reset IN($recycle_Y)) and (status='$recycle_status[$rc]') and (modify_date < \"$RSQLdate[$rc]\") )";
if ($DBX) {print "RECYCLE: |$campaign_id[$i]|$recycle_status[$rc]|$recycle_delay[$rc]|$recycle_maximum[$rc]|$RSQLdate[$rc]|\n";}
$rc++;
}
$recycle_SQL .= " )";
if ($DBX) {print "RECYCLE SQL: |$recycle_SQL|\n";}
}
##### END lead recycling parsing and prep ###
if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] \n";} if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] \n";}
@@ -928,6 +989,44 @@ foreach(@campaign_id)
if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;} if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;}
if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;} if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;}
### BEGIN recycle grab leads ###
if ($rec_ct > 0)
{
if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";}
$stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] limit 100;";
if ($DBX) {print " |$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($DB) {print " RECYCLE leads to call count: $sthArows\n";}
if ($DBX) {print " |$stmtA|\n";}
$REC_rec_countLEADS=0;
@REC_leads_to_hopper=@MT;
@REC_lists_to_hopper=@MT;
@REC_phone_to_hopper=@MT;
while ($sthArows > $REC_rec_countLEADS)
{
@aryA = $sthA->fetchrow_array;
$REC_leads_to_hopper[$REC_rec_countLEADS] = "$aryA[0]";
$REC_lists_to_hopper[$REC_rec_countLEADS] = "$aryA[1]";
$REC_gmt_to_hopper[$REC_rec_countLEADS] = "$aryA[2]";
$REC_phone_to_hopper[$REC_rec_countLEADS] = "$aryA[3]";
$REC_state_to_hopper[$REC_rec_countLEADS] = "$aryA[4]";
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
$REC_rec_countLEADS++;
}
$sthA->finish();
}
### END recycle grab leads ###
if ($NEW_count > 0) if ($NEW_count > 0)
{ {
$NEW_level = int($hopper_level[$i] / $NEW_count); $NEW_level = int($hopper_level[$i] / $NEW_count);
@@ -967,7 +1066,11 @@ foreach(@campaign_id)
$rec_countLEADS=0; $NEW_dec=99; $NEW_in=0; $rec_countLEADS=0; $NEW_dec=99; $NEW_in=0;
@leads_to_hopper=@MT; @leads_to_hopper=@MT;
@lists_to_hopper=@MT; @lists_to_hopper=@MT;
@gmt_to_hopper=@MT;
@state_to_hopper=@MT;
@phone_to_hopper=@MT;
$rec_count=0; $rec_count=0;
$REC_insert_count=0;
while ($sthArows > $rec_count) while ($sthArows > $rec_count)
{ {
@aryA = $sthA->fetchrow_array; @aryA = $sthA->fetchrow_array;
@@ -984,16 +1087,28 @@ foreach(@campaign_id)
$lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]";
$gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]";
$state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]";
$phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]";
if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";}
$rec_countLEADS++; $rec_countLEADS++;
$NEW_in++; $NEW_in++;
$NEW_dec=2; $NEW_dec=2;
} }
} }
if ($REC_rec_countLEADS > $REC_insert_count)
{
$leads_to_hopper[$rec_countLEADS] = "$REC_leads_to_hopper[$REC_insert_count]";
$lists_to_hopper[$rec_countLEADS] = "$REC_lists_to_hopper[$REC_insert_count]";
$gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]";
$state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]";
$phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]";
$rec_countLEADS++;
$REC_insert_count++;
}
$leads_to_hopper[$rec_countLEADS] = "$aryA[0]"; $leads_to_hopper[$rec_countLEADS] = "$aryA[0]";
$lists_to_hopper[$rec_countLEADS] = "$aryA[1]"; $lists_to_hopper[$rec_countLEADS] = "$aryA[1]";
$gmt_to_hopper[$rec_countLEADS] = "$aryA[2]"; $gmt_to_hopper[$rec_countLEADS] = "$aryA[2]";
$state_to_hopper[$rec_countLEADS] = "$aryA[4]"; $state_to_hopper[$rec_countLEADS] = "$aryA[4]";
$phone_to_hopper[$rec_countLEADS] = "$aryA[3]";
if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";}
$rec_countLEADS++; $rec_countLEADS++;
$rec_count++; $rec_count++;
@@ -1008,9 +1123,35 @@ foreach(@campaign_id)
{ {
if ($leads_to_hopper[$h] != '0') if ($leads_to_hopper[$h] != '0')
{ {
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');"; $DNClead=0;
$affected_rows = $dbhA->do($stmtA); if ($use_internal_dnc[$i] =~ /Y/)
if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";} {
if ($DB) {print " Doinbg DNC Check: $phone_to_hopper[$h] - $use_internal_dnc[$i]\n";}
$stmtA = "SELECT count(*) from vicidial_dnc where phone_number='$phone_to_hopper[$h]';";
$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)
{
@aryA = $sthA->fetchrow_array;
$DNClead = "$aryA[0]";
$rec_count++;
}
$sthA->finish();
if ($DNClead != '0')
{
$stmtA = "UPDATE vicidial_list SET status='DNCL' where lead_id='$leads_to_hopper[$h]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h]\n";}
}
}
if ($DNClead == '0')
{
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";}
}
} }
$h++; $h++;
} }
+336
View File
@@ -0,0 +1,336 @@
#!/usr/bin/perl
# AST_agent_week.pl
#
# This script is designed to gather stats for all agent activity over the course
# of a week(Sunday to Saturday) and print it in an ASCI text file to be placed
# on a web server for viewing.
#
# CHANGES
# 60517-1100 - First version
#
$txt = '.txt';
$US = '_';
$MT[0] = '';
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help/i)
{
print "allowed run time options:\n [-q] = quiet\n [-t] = test\n\n";
exit;
}
else
{
if ($args =~ /--debug/i)
{
$DB=1;
print "\n-----DEBUG MODE-----\n\n";
}
if ($args =~ /-q/i)
{
$q=1; $Q=1;
}
if ($args =~ /-t/i)
{
$T=1; $TEST=1;
print "\n-----TESTING-----\n\n";
}
}
}
else
{
print "no command line options set\n";
}
### end parsing run-time options ###
$secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$filedate = "$year$mon$mday-$hour$min$sec";
$ABIfiledate = "$mon-$mday-$year$us$hour$min$sec";
$shipdate = "$year-$mon-$mday";
$datestamp = "$year/$mon/$mday $hour:$min";
$STARTtarget = ($secX - (86400 * $wday));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($STARTtarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$START_week = (($Syday/7)+1); $START_week = sprintf("%2d", $START_week);
$STARTtarget_date = "$Syear-$Smon-$Smday";
$ENDtarget = ($STARTtarget + (86400 * 6));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($ENDtarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$ENDtarget_date = "$Syear-$Smon-$Smday";
$PAST_STARTtarget = ($STARTtarget - (86400 * 7));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_STARTtarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_START_week = (($Syday/7)+1); $PAST_START_week = sprintf("%2d", $PAST_START_week);
$PAST_STARTtarget_date = "$Syear-$Smon-$Smday";
$PAST_ENDtarget = ($ENDtarget - (86400 * 7));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_ENDtarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_ENDtarget_date = "$Syear-$Smon-$Smday";
$PAST_date[0] = $PAST_STARTtarget_date;
$PAST_day[0] = 'Sunday ';
$PAST_date[6] = $PAST_ENDtarget_date;
$PAST_day[6] = 'Saturday ';
$PAST_Mondaytarget = ($STARTtarget - (86400 * 6));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Mondaytarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_date[1] = "$Syear-$Smon-$Smday";
$PAST_day[1] = 'Monday ';
$PAST_Tuesdaytarget = ($STARTtarget - (86400 * 5));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Tuesdaytarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_date[2] = "$Syear-$Smon-$Smday";
$PAST_day[2] = 'Tuesday ';
$PAST_Wednesdaytarget = ($STARTtarget - (86400 * 4));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Wednesdaytarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_date[3] = "$Syear-$Smon-$Smday";
$PAST_day[3] = 'Wednesday';
$PAST_Thursdaytarget = ($STARTtarget - (86400 * 3));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Thursdaytarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_date[4] = "$Syear-$Smon-$Smday";
$PAST_day[4] = 'Thursday ';
$PAST_Fridaytarget = ($STARTtarget - (86400 * 2));
($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Fridaytarget);
$Syear = ($Syear + 1900); $Smon++;
if ($Smon < 10) {$Smon = "0$Smon";}
if ($Smday < 10) {$Smday = "0$Smday";}
$PAST_date[5] = "$Syear-$Smon-$Smday";
$PAST_day[5] = 'Friday ';
print "\n\n\n\n\n\n\n\n\n\n\n\n-- AST_agent_week.pl --\n\n";
print "This program is designed to print stats to a file for agents' activity for the previous week. \n\n";
$TLoutfile = '';
$TLoutfile .= "TODAY: $shipdate\n";
$TLoutfile .= "THIS WEEK: week $START_week $STARTtarget_date - $ENDtarget_date\n";
$TLoutfile .= "LAST WEEK: week $PAST_START_week $PAST_STARTtarget_date - $PAST_ENDtarget_date\n\n";
#$h=0;
#foreach(@PAST_date)
#{
#$TLoutfile .= "$PAST_day[$h] $PAST_date[$h]\n";
#$h++;
#}
#print "$TLoutfile";
$outfile = "AGENT_HOURS_$PAST_STARTtarget_date$US$PAST_ENDtarget_date$txt";
#$dir = '/usr/local/apache2/htdocs';
$dir = '/home/www/htdocs';
### open the X out file for writing ###
open(out, ">$dir/vicidial/agent_reports/$outfile")
|| die "Can't open $outfile: $!\n";
### Make sure this file is in a libs path or put the absolute path to it
require("/home/cron/AST_SERVER_conf.pl"); # local configuration file
if (!$DB_port) {$DB_port='3306';}
use DBI;
$dbhA = DBI->connect("DBI:mysql:$DB_database:$DB_server:$DB_port", "$DB_user", "$DB_pass")
or die "Couldn't connect to database: " . DBI->errstr;
$dbhB = DBI->connect("DBI:mysql:$DB_database:$DB_server:$DB_port", "$DB_user", "$DB_pass")
or die "Couldn't connect to database: " . DBI->errstr;
#$vicidial_agent_log = 'vicidial_agent_log_archive';
$vicidial_agent_log = 'vicidial_agent_log';
###########################################################################
########### PAST WEEK STAT GATHERING LOOP #################################
###########################################################################
$h=0;
foreach(@PAST_date)
{
print out "\n$PAST_day[$h] $PAST_date[$h]\n\n";
print out "AGENT USER CALLS TALK PAUSE WAIT DISPO ACTIVE LOGTIME FIRST LAST \n";
print "\n$PAST_day[$h] $PAST_date[$h]\n\n";
print "AGENT USER CALLS TALK PAUSE WAIT DISPO ACTIVE LOGTIME FIRST LAST \n";
$stmtA = "select count(*) as calls, full_name,vicidial_users.user,sum(talk_sec),sum(pause_sec),sum(wait_sec),sum(dispo_sec) from vicidial_users,$vicidial_agent_log where event_time <= '$PAST_date[$h] 23:59:59' and event_time >= '$PAST_date[$h] 00:00:00' and vicidial_users.user=$vicidial_agent_log.user and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by vicidial_users.user order by full_name limit 10000;";
$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)
{
@aryA = $sthA->fetchrow_array;
$calls = sprintf("%7s", $aryA[0]);
$name = sprintf("%-20s", $aryA[1]); while(length($name)>20) {chop($name);}
$user = sprintf("%-8s", $aryA[2]);
### TOTAL ACTIVE TIME
$active = ($aryA[3] + $aryA[4] + $aryA[5] + $aryA[6]);
$TIME_S = $active;
$TIME_H = int($TIME_S / 3600);
$TIME_S = ($TIME_S - ($TIME_H * 3600));
$TIME_M = int($TIME_S / 60);
$TIME_S = ($TIME_S - ($TIME_M * 60));
if ($TIME_S < 10) {$TIME_S = "0$TIME_S";}
if ($TIME_M < 10) {$TIME_M = "0$TIME_M";}
$TIME_HMS = "$TIME_H:$TIME_M:$TIME_S";
$active = sprintf("%9s", $TIME_HMS);
### TOTAL TALK TIME
$TIME_S = $aryA[3];
$TIME_H = int($TIME_S / 3600);
$TIME_S = ($TIME_S - ($TIME_H * 3600));
$TIME_M = int($TIME_S / 60);
$TIME_S = ($TIME_S - ($TIME_M * 60));
if ($TIME_S < 10) {$TIME_S = "0$TIME_S";}
if ($TIME_M < 10) {$TIME_M = "0$TIME_M";}
$TIME_HMS = "$TIME_H:$TIME_M:$TIME_S";
$talk = sprintf("%9s", $TIME_HMS);
### TOTAL PAUSE TIME
$TIME_S = $aryA[4];
$TIME_H = int($TIME_S / 3600);
$TIME_S = ($TIME_S - ($TIME_H * 3600));
$TIME_M = int($TIME_S / 60);
$TIME_S = ($TIME_S - ($TIME_M * 60));
if ($TIME_S < 10) {$TIME_S = "0$TIME_S";}
if ($TIME_M < 10) {$TIME_M = "0$TIME_M";}
$TIME_HMS = "$TIME_H:$TIME_M:$TIME_S";
$pause = sprintf("%9s", $TIME_HMS);
### TOTAL WAIT TIME
$TIME_S = $aryA[5];
$TIME_H = int($TIME_S / 3600);
$TIME_S = ($TIME_S - ($TIME_H * 3600));
$TIME_M = int($TIME_S / 60);
$TIME_S = ($TIME_S - ($TIME_M * 60));
if ($TIME_S < 10) {$TIME_S = "0$TIME_S";}
if ($TIME_M < 10) {$TIME_M = "0$TIME_M";}
$TIME_HMS = "$TIME_H:$TIME_M:$TIME_S";
$wait = sprintf("%9s", $TIME_HMS);
### TOTAL DISPO TIME
$TIME_S = $aryA[6];
$TIME_H = int($TIME_S / 3600);
$TIME_S = ($TIME_S - ($TIME_H * 3600));
$TIME_M = int($TIME_S / 60);
$TIME_S = ($TIME_S - ($TIME_M * 60));
if ($TIME_S < 10) {$TIME_S = "0$TIME_S";}
if ($TIME_M < 10) {$TIME_M = "0$TIME_M";}
$TIME_HMS = "$TIME_H:$TIME_M:$TIME_S";
$dispo = sprintf("%9s", $TIME_HMS);
$stmtB = "select event_time,UNIX_TIMESTAMP(event_time) from $vicidial_agent_log where event_time <= '$PAST_date[$h] 23:59:59' and event_time >= '$PAST_date[$h] 00:00:00' and user='$aryA[2]' order by event_time limit 1;";
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
$sthB->execute or die "executing: $stmtA ", $dbhB->errstr;
@aryB = $sthB->fetchrow_array;
$first_time = sprintf("%21s", $aryB[0]);
$first_log = $aryB[1];
$stmtB = "select event_time,UNIX_TIMESTAMP(event_time) from $vicidial_agent_log where event_time <= '$PAST_date[$h] 23:59:59' and event_time >= '$PAST_date[$h] 00:00:00' and user='$aryA[2]' order by event_time desc limit 1;";
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
$sthB->execute or die "executing: $stmtA ", $dbhB->errstr;
@aryB = $sthB->fetchrow_array;
$last_time = sprintf("%21s", $aryB[0]);
$last_log = $aryB[1];
$TIME_S = ($last_log - $first_log);
$TIME_H = int($TIME_S / 3600);
$TIME_S = ($TIME_S - ($TIME_H * 3600));
$TIME_M = int($TIME_S / 60);
$TIME_S = ($TIME_S - ($TIME_M * 60));
if ($TIME_S < 10) {$TIME_S = "0$TIME_S";}
if ($TIME_M < 10) {$TIME_M = "0$TIME_M";}
$TIME_HMS = "$TIME_H:$TIME_M:$TIME_S";
$login_time = sprintf("%9s", $TIME_HMS);
print out "$name$user$calls$talk$pause$wait$dispo$active$login_time$first_time$last_time\n";
print "$name$user$calls$talk$pause$wait$dispo$active$login_time$first_time$last_time\n";
$rec_count++;
}
$sthA->finish();
#if ($h=='1')
# {
# exit;
# }
$h++;
}
close(out);
### calculate time to run script ###
$secY = time();
$secZ = ($secY - $secX);
$secZm = ($secZ /60);
print "script execution time in seconds: $secZ minutes: $secZm\n";
exit;
+21 -4
View File
@@ -82,7 +82,7 @@ ASTmgrSECRET VARCHAR(20) NOT NULL default '1234',
ASTmgrUSERNAMEupdate VARCHAR(20) NOT NULL default 'updatecron', ASTmgrUSERNAMEupdate VARCHAR(20) NOT NULL default 'updatecron',
ASTmgrUSERNAMElisten VARCHAR(20) NOT NULL default 'listencron', ASTmgrUSERNAMElisten VARCHAR(20) NOT NULL default 'listencron',
ASTmgrUSERNAMEsend VARCHAR(20) NOT NULL default 'sendcron', ASTmgrUSERNAMEsend VARCHAR(20) NOT NULL default 'sendcron',
local_gmt TINYINT(2) default '-5', local_gmt VARCHAR(5) default '-5',
voicemail_dump_exten VARCHAR(20) NOT NULL default '85026666666666', voicemail_dump_exten VARCHAR(20) NOT NULL default '85026666666666',
answer_transfer_agent VARCHAR(20) NOT NULL default '8365', answer_transfer_agent VARCHAR(20) NOT NULL default '8365',
ext_context VARCHAR(20) NOT NULL default 'default' ext_context VARCHAR(20) NOT NULL default 'default'
@@ -236,7 +236,7 @@ vendor_lead_code VARCHAR(20),
source_id VARCHAR(6), source_id VARCHAR(6),
list_id BIGINT(14) UNSIGNED, list_id BIGINT(14) UNSIGNED,
gmt_offset_now DECIMAL(4,2) DEFAULT '0.00', gmt_offset_now DECIMAL(4,2) DEFAULT '0.00',
called_since_last_reset ENUM('Y','N'), called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10') default 'N',
phone_code VARCHAR(10), phone_code VARCHAR(10),
phone_number VARCHAR(10), phone_number VARCHAR(10),
title VARCHAR(4), title VARCHAR(4),
@@ -306,7 +306,7 @@ index (last_call_finish)
auto_call_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE NOT NULL, auto_call_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE NOT NULL,
server_ip VARCHAR(15) NOT NULL, server_ip VARCHAR(15) NOT NULL,
campaign_id VARCHAR(20), campaign_id VARCHAR(20),
status ENUM('SENT','RINGING','LIVE','XFER','PAUSED','CLOSER') default 'PAUSED', status ENUM('SENT','RINGING','LIVE','XFER','PAUSED','CLOSER','BUSY','DISCONNECT') default 'PAUSED',
lead_id INT(9) UNSIGNED NOT NULL, lead_id INT(9) UNSIGNED NOT NULL,
uniqueid DOUBLE(18,7), uniqueid DOUBLE(18,7),
callerid VARCHAR(20), callerid VARCHAR(20),
@@ -468,7 +468,8 @@ safe_harbor_exten VARCHAR(20) default '8307',
display_dialable_count ENUM('Y','N') default 'Y', display_dialable_count ENUM('Y','N') default 'Y',
wrapup_seconds SMALLINT(3) UNSIGNED default '0', wrapup_seconds SMALLINT(3) UNSIGNED default '0',
wrapup_message VARCHAR(255) default 'Wrapup Call', wrapup_message VARCHAR(255) default 'Wrapup Call',
closer_campaigns TEXT default '' closer_campaigns TEXT default '',
use_internal_dnc ENUM('Y','N') default 'N'
); );
CREATE TABLE vicidial_lists ( CREATE TABLE vicidial_lists (
@@ -745,6 +746,22 @@ drops_onemin INT(9) UNSIGNED default '0',
drops_onemin_pct VARCHAR(6) default '0' drops_onemin_pct VARCHAR(6) default '0'
); );
CREATE TABLE vicidial_dnc (
phone_number VARCHAR(10) PRIMARY KEY NOT NULL
);
CREATE TABLE vicidial_lead_recycle (
recycle_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE NOT NULL,
campaign_id VARCHAR(8),
status VARCHAR(6) NOT NULL,
attempt_delay SMALLINT(5) UNSIGNED default '1800',
attempt_maximum TINYINT(3) UNSIGNED default '32',
active ENUM('Y','N') default 'N',
index (campaign_id)
);
INSERT INTO vicidial_call_times SET call_time_id='24hours',call_time_name='default 24 hours calling',ct_default_start='0',ct_default_stop='2400'; INSERT INTO vicidial_call_times SET call_time_id='24hours',call_time_name='default 24 hours calling',ct_default_start='0',ct_default_stop='2400';
INSERT INTO vicidial_call_times SET call_time_id='9am-9pm',call_time_name='default 9am to 9pm calling',ct_default_start='900',ct_default_stop='2100'; INSERT INTO vicidial_call_times SET call_time_id='9am-9pm',call_time_name='default 9am to 9pm calling',ct_default_start='900',ct_default_stop='2100';
INSERT INTO vicidial_call_times SET call_time_id='9am-5pm',call_time_name='default 9am to 5pm calling',ct_default_start='900',ct_default_stop='1700'; INSERT INTO vicidial_call_times SET call_time_id='9am-5pm',call_time_name='default 9am to 5pm calling',ct_default_start='900',ct_default_stop='1700';
+40 -2
View File
@@ -16,7 +16,6 @@ Delete Call Times -</B> This option allows the user to be able to delete vicidia
Modify Call Times -</B> This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen Modify Call Times -</B> This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen
Wrapup Seconds -</B> The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition Wrapup Seconds -</B> The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition
Wrapup Message -</B> This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set Wrapup Message -</B> This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set
Allowable Inbound Groups -</B> Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign
You are not authorized to view this page. Please go back You are not authorized to view this page. Please go back
Day and time options will appear once you have created the Call Time Definition Day and time options will appear once you have created the Call Time Definition
State Call Time ID, name and state must be at least 2 characters in length State Call Time ID, name and state must be at least 2 characters in length
@@ -104,6 +103,38 @@ Wrapup Message:
Alt Number Dialing Alt Number Dialing
no active lists selected for this campaign no active lists selected for this campaign
Realtime Screen Realtime Screen
Allowable Inbound Groups -</B> Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign
Allowed Inbound Groups
ADD NUMBER TO DNC
ADD A NUMBER TO THE DNC LIST
Add New DNC
Phone Number
VICIDIAL DNC List -</B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list
DNC NOT ADDED - This phone number is already in the Do Not Call List
DNC ADDED
Use Internal DNC List -</B> This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N
Use Internal DNC List
Campaign CallerID -</B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID
Login -</B> The login used for the phone user to login to the client applications
Password -</B> The password used for the phone user to login to the client applications
New Campaign Lead Recycle Addition
Modify Campaign Lead Recycle
Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0
CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status
CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered
status must be between 1 and 6 characters in length
attempt delay must be at least 120 seconds
maximum attempts must be from 1 to 10
CAMPAIGN LEAD RECYCLE ADDED
CAMPAIGN LEAD RECYCLE NOT DELETED
CAMPAIGN LEAD RECYCLE DELETED
Delete Lead Recycle
LEAD RECYCLING WITHIN THIS CAMPAIGN
ATTEMPT DELAY
ATTEMPT MAXIMUM
ADD NEW CAMPAIGN LEAD RECYCLE
Attempt Delay
Attempt Maximum
############################################################ CLIENT ############################################################ CLIENT
@@ -115,6 +146,12 @@ seconds remaining in wrapup
Call Wrapup: Call Wrapup:
YOU DO NOT NEED TO TRANSLATE BELOW THIS LINE
############################################################ CLIENT MANUAL ############################################################ CLIENT MANUAL
Added option to search for a manual-dial lead before inserting it in the system Added option to search for a manual-dial lead before inserting it in the system
@@ -123,5 +160,6 @@ Added Call Wrapup option and screen with override link to skip out early
############################################################ MANAGER MANUAL ############################################################ MANAGER MANUAL
Added Allowable Inbound Groups to CLOSER Campaign Detail screen
Added list ID override to lead importer
Added gmt offset lookup to lead importer
+102 -23
View File
@@ -12,14 +12,20 @@
# #
# ;VICIDIAL_auto_dialer transfer script: # ;VICIDIAL_auto_dialer transfer script:
# exten => h,1,DeadAGI(call_log.agi,${EXTEN}) # exten => h,1,DeadAGI(call_log.agi,${EXTEN})
# exten => h,2,DeadAGI(VD_hangup.agi,${EXTEN}) # exten => h,2,DeadAGI(VD_hangup.agi,PRI-----DEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
# #
# NOTES:
# - To disable Busy and Disconnect detection change the first field from PRI to NONPRI
# - To disable Debug output to file change the second field from DEBUG to NODEBUG
# #
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# #
# changes: # changes:
# 60203-1218 - fixed calleridname issue with 1.2 tree for custom CID # 60203-1218 - fixed calleridname issue with 1.2 tree for custom CID
# 60314-1250 - Altered to allow for ignoring of AGI-defined status # 60314-1250 - Altered to allow for ignoring of AGI-defined status
# 60612-1500 - Added option for text log of hangup codes
# - Added option for PRI hangup code dispositions: BUSY, DISCONNECT
# 60615-1101 - Fixed log updates for CLOSER transfer from fronter calls
# #
$V = 1; # set to 1 for verbose mode $V = 1; # set to 1 for verbose mode
@@ -62,6 +68,16 @@ if ($V) {print STDERR "Perl Environment Dump:\n";}
$i++; $i++;
} }
### list of command-line array arguments:
@ARGV_vars = split(/-----/, $ARGV[0]);
$PRI = $ARGV_vars[0];
$DEBUG = $ARGV_vars[1];
$hangup_cause = $ARGV_vars[2];
$dialstatus = $ARGV_vars[3];
$dial_time = $ARGV_vars[4];
$ring_time = $ARGV_vars[5];
if ($args =~ /--help/i) if ($args =~ /--help/i)
{ {
print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-debug] = verbose debug messages\n\n"; print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-debug] = verbose debug messages\n\n";
@@ -156,6 +172,18 @@ $VDADphone_code='';
if ($V) {print STDERR "AGI Environment Dump: |$unique_id|$channel|$extension|$type|$callerid|$calleridname|$priority|\n";} if ($V) {print STDERR "AGI Environment Dump: |$unique_id|$channel|$extension|$type|$callerid|$calleridname|$priority|\n";}
if ($DEBUG =~ /^DEBUG$/)
{
### open the error out file for writing ###
open(out, ">>/home/cron/HANGUP_test-output.txt")
|| die "Can't open /home/cron/HANGUP_test-output.txt: $!\n";
print out "$now_date|$hangup_cause|$dialstatus|$dial_time|$ring_time|$unique_id|$channel|$extension|$type|$callerid|$calleridname|$priority|\n";
close(out);
}
else {print STDERR "\nDEBUG: $DEBUG\n";}
$callerid =~ s/\"//gi; $callerid =~ s/\"//gi;
$CIDlead_id = $callerid; $CIDlead_id = $callerid;
@@ -166,11 +194,43 @@ if ($V) {print STDERR "\nVD_hangup : $callerid $channel $priority\n";}
if ($M) {print STDERR "+++++ VD hangup START : |$unique_id|$channel|$extension|$type|$callerid|$CIDlead_id|$now_date|$AST_ver|$priority|$calleridname|\n";} if ($M) {print STDERR "+++++ VD hangup START : |$unique_id|$channel|$extension|$type|$callerid|$CIDlead_id|$now_date|$AST_ver|$priority|$calleridname|\n";}
if ( ($channel =~ /Local/i) && ($AST_ver !~ /^1\.0\.8|^1\.0\.9/) ) if ($channel =~ /^Local/)
{ {
if ($M) {print STDERR "+++++ VDAD START LOCAL CHANNEL: EXITING- $priority\n";} if ( ($PRI =~ /^PRI$/) && ($callerid =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) && ( ($dialstatus =~ /BUSY/) || ( ($dialstatus =~ /CHANUNAVAIL/) && ($hangup_cause =~ /^1$|^28$/) ) ) )
if ($priority > 2) {sleep(1);} {
exit; my $dbhA = Net::MySQL->new(hostname=>"$DB_server", database=>"$DB_database", user=>"$DB_user", password=>"$DB_pass", port => "$DB_port") or die "Couldn't connect to database: $DB_server - $DB_database\n";
if ($dialstatus =~ /BUSY/) {$VDL_status = 'B'; $VDAC_status = 'BUSY';}
if ($dialstatus =~ /CHANUNAVAIL/) {$VDL_status = 'DC'; $VDAC_status = 'DISCONNECT';}
$stmtA = "UPDATE vicidial_auto_calls set status='$VDAC_status' where callerid = '$callerid';";
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
my $affected_rows = $dbhA->get_affected_rows_length;
if ($M) {print STDERR "-- VDAC update: |$affected_rows|$CIDlead_id\n";}
$stmtA = "UPDATE vicidial_list set status='$VDL_status' where lead_id = '$CIDlead_id';";
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
my $affected_rows = $dbhA->get_affected_rows_length;
if ($M) {print STDERR "-- VDAD vicidial_list update: |$affected_rows|$CIDlead_id\n";}
$stmtA = "UPDATE vicidial_log set status='$VDL_status' where uniqueid = '$uniqueid';";
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
my $affected_rows = $dbhA->get_affected_rows_length;
if ($M) {print STDERR "-- VDAD vicidial_log update: |$affected_rows|$uniqueid|\n";}
$dbhA->close;
}
else
{
if ($M) {print STDERR "-- VDhangup Local DEBUG: |$PRI|$callerid|$dialstatus|$hangup_cause|\n";}
}
if ($M) {print STDERR "+++++ VDAD START LOCAL CHANNEL: EXITING- $priority\n";}
if ($priority > 2) {sleep(1);}
exit;
} }
if (!$DB_port) {$DB_port='3306';} if (!$DB_port) {$DB_port='3306';}
@@ -211,6 +271,7 @@ $stmtA = "SELECT start_epoch,status FROM vicidial_log where uniqueid='$uniqueid'
if($M){print STDERR "\n\n|$stmtA|\n";} if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA"); $dbhA->query("$stmtA");
$epc_countCUSTDATA=0; $epc_countCUSTDATA=0;
$VD_closecallid='';
if ($dbhA->has_selected_record) if ($dbhA->has_selected_record)
{ {
$iter=$dbhA->create_record_iterator; $iter=$dbhA->create_record_iterator;
@@ -224,6 +285,38 @@ if ($dbhA->has_selected_record)
if (!$epc_countCUSTDATA) if (!$epc_countCUSTDATA)
{ {
if($M){print STDERR "\nVD hangup: no VDL record found: $uniqueid $calleridname $VD_lead_id $uniqueid\n";} if($M){print STDERR "\nVD hangup: no VDL record found: $uniqueid $calleridname $VD_lead_id $uniqueid\n";}
$secX = time();
$Rtarget = ($secX - 21600); # look for VDCL entry within last 6 hours
($Rsec,$Rmin,$Rhour,$Rmday,$Rmon,$Ryear,$Rwday,$Ryday,$Risdst) = localtime($Rtarget);
$Ryear = ($Ryear + 1900);
$Rmon++;
if ($Rmon < 10) {$Rmon = "0$Rmon";}
if ($Rmday < 10) {$Rmday = "0$Rmday";}
if ($Rhour < 10) {$Rhour = "0$Rhour";}
if ($Rmin < 10) {$Rmin = "0$Rmin";}
if ($Rsec < 10) {$Rsec = "0$Rsec";}
$RSQLdate = "$Ryear-$Rmon-$Rmday $Rhour:$Rmin:$Rsec";
$stmtA = "SELECT start_epoch,status,closecallid FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc limit 1;";
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
$epc_countCUSTDATA=0;
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$VD_start_epoch = "$record->[0]";
$VD_status = "$record->[1]";
$VD_closecallid = "$record->[2]";
$epc_countCUSTDATA++;
}
}
}
if (!$epc_countCUSTDATA)
{
if($M){print STDERR "\nVD hangup: no VDL or VDCL record found: $uniqueid $calleridname $VD_lead_id $uniqueid\n";}
exit; exit;
} }
$VD_seconds = ($now_date_epoch - $VD_start_epoch); $VD_seconds = ($now_date_epoch - $VD_start_epoch);
@@ -250,32 +343,18 @@ if ($M) {print STDERR "-- VDAD vicidial_log update: |$affected_rows|$uniqueid
########## FIND AND UPDATE vicidial_closer_log ########## ########## UPDATE vicidial_closer_log ##########
$stmtA = "SELECT closecallid,start_epoch FROM vicidial_closer_log where lead_id='$VD_lead_id' order by closecallid desc limit 1;"; if (length($VD_closecallid) < 1)
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
$epc_countCUSTDATA=0;
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$closecallid = "$record->[0]";
$VD_start_epoch = "$record->[1]";
$epc_countCUSTDATA++;
}
}
if (!$epc_countCUSTDATA)
{ {
if($M){print STDERR "\nVD hangup: no VDCL record found: $uniqueid $calleridname $VD_lead_id $uniqueid\n";} if($M){print STDERR "\nVD hangup: no VDCL record found: $uniqueid $calleridname $VD_lead_id $uniqueid\n";}
exit; exit;
} }
$VD_seconds = ($now_date_epoch - $VD_start_epoch); $VD_seconds = ($now_date_epoch - $VD_start_epoch);
$stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where closecallid = '$closecallid';"; $stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where closecallid = '$VD_closecallid';";
if($M){print STDERR "\n\n|$stmtA|\n";} if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA"); $dbhA->query("$stmtA");
my $affected_rows = $dbhA->get_affected_rows_length; my $affected_rows = $dbhA->get_affected_rows_length;
if ($M) {print STDERR "-- VDCL update: |$affected_rows|$uniqueid|$closecallid|\n";} if ($M) {print STDERR "-- VDCL update: |$affected_rows|$uniqueid|$VD_closecallid|\n";}
+570 -12
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# VICIDIAL_IN_new_leads_file.pl version 0.2 # VICIDIAL_IN_new_leads_file.pl version 0.3
# #
# DESCRIPTION: # DESCRIPTION:
# script lets you insert leads into the vicidial_list table from a TAB-delimited # script lets you insert leads into the vicidial_list table from a TAB-delimited
@@ -10,18 +10,26 @@
# #
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# #
#
# CHANGES
# 60615-1543 - Added gmt_offset_now lookup for each lead
# - Added option to force a gmt value(field after COMMENTS field)
# 60616-0958 - Added listID override feature to force all leads into same list
#
$secX = time(); $secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900); $year = ($year + 1900);
$mon++; $mon++;
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";} if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";} if ($sec < 10) {$sec = "0$sec";}
if ($mon < 10) {$mon = "0$mon";} if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";} if ($mday < 10) {$mday = "0$mday";}
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; $pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
$inSD = $pulldate0; $inSD = $pulldate0;
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
print "\n\n\n\n\n\n\n\n\n\n\n\n-- VICIDIAL_IN_new_leads_file.pl --\n\n"; print "\n\n\n\n\n\n\n\n\n\n\n\n-- VICIDIAL_IN_new_leads_file.pl --\n\n";
@@ -39,13 +47,23 @@ if (length($ARGV[0])>1)
if ($args =~ /--help|-h/i) if ($args =~ /--help|-h/i)
{ {
print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-h] = this help screen\n\n"; print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-forcegmt] = forces gmt value of column after comments column\n [-debug] = debug output\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n";
print "This script takes in lead files in the following order when they are placed in the /home/cron/VICIDIAL/LEADS_IN directory to be imported into the vicidial_list table:\n\n"; print "This script takes in lead files in the following order when they are placed in the /home/cron/VICIDIAL/LEADS_IN directory to be imported into the vicidial_list table:\n\n";
print "vendor_lead_code|source_code|list_id|phone_code|phone_number|title|first_name|middle|last_name|address1|address2|address3|city|state|province|postal_code|country|gender|date_of_birth|alt_phone|email|security_phrase|COMMENTS\n\n"; print "vendor_lead_code|source_code|list_id|phone_code|phone_number|title|first_name|middle|last_name|address1|address2|address3|city|state|province|postal_code|country|gender|date_of_birth|alt_phone|email|security_phrase|COMMENTS\n\n";
print "3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS\n\n"; print "3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS\n\n";
} }
else else
{ {
if ($args =~ /--debug/i)
{
$DB=1;
print "\n-----DEBUGGING -----\n\n";
}
if ($args =~ /--debugX/i)
{
$DBX=1;
print "\n----- SUPER-DUPER DEBUGGING -----\n\n";
}
if ($args =~ /-q/i) if ($args =~ /-q/i)
{ {
$q=1; $q=1;
@@ -54,8 +72,21 @@ if (length($ARGV[0])>1)
{ {
$T=1; $T=1;
$TEST=1; $TEST=1;
print "\n-----TESTING -----\n\n"; print "\n----- TESTING -----\n\n";
} }
if ($args =~ /-forcegmt/i)
{
$forcegmt=1;
print "\n----- FORCE GMT -----\n\n";
}
if ($args =~ /--forcelistid=/i)
{
@data_in = split(/--forcelistid=/,$args);
$forcelistid = $data_in[1];
print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n";
}
else
{$forcelistid = '';}
} }
} }
else else
@@ -134,6 +165,31 @@ use Net::MySQL;
or die "Couldn't connect to database: $DB_server - $DB_database\n"; or die "Couldn't connect to database: $DB_server - $DB_database\n";
### Grab Server values from the database
$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';";
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$DBSERVER_GMT = "$record->[0]";
if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;}
}
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
if ($isdst) {$LOCAL_GMT_OFF++;}
if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
print "\n\n SQL inserts will be put in $Toutfile\n\n"; print "\n\n SQL inserts will be put in $Toutfile\n\n";
@@ -151,7 +207,7 @@ use Net::MySQL;
while (<infile>) while (<infile>)
{ {
#print "$a| $number\n"; # print "$a| $number\n";
$number = $_; $number = $_;
chomp($number); chomp($number);
# $number =~ s/,/\|/gi; # $number =~ s/,/\|/gi;
@@ -172,17 +228,12 @@ use Net::MySQL;
#3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS #3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS
$entry_date = "$pulldate0";
$modify_date = "";
$status = "NEW";
$user = "";
$vendor_lead_code = $m[0]; chomp($vendor_lead_code); $vendor_lead_code = $m[0]; chomp($vendor_lead_code);
$source_code = $m[1]; chomp($source_code); $source_id = $source_code; $source_code = $m[1]; chomp($source_code); $source_id = $source_code;
$list_id = $m[2]; chomp($list_id); $list_id = $m[2]; chomp($list_id);
$campaign_id = '';
$called_since_last_reset='N';
$phone_code = $m[3]; chomp($phone_code); $phone_code =~ s/\D//gi; $phone_code = $m[3]; chomp($phone_code); $phone_code =~ s/\D//gi;
$phone_number = $m[4]; chomp($phone_number); $phone_number =~ s/\D//gi; $phone_number = $m[4]; chomp($phone_number); $phone_number =~ s/\D//gi;
$USarea = substr($phone_number, 0, 3);
$title = $m[5]; chomp($title); $title = $m[5]; chomp($title);
$first_name = $m[6]; chomp($first_name); $first_name = $m[6]; chomp($first_name);
$middle_initial = $m[7]; chomp($middle_initial); $middle_initial = $m[7]; chomp($middle_initial);
@@ -205,11 +256,168 @@ use Net::MySQL;
if (length($phone_number)>8) if (length($phone_number)>8)
{ {
# set default values
$entry_date = "$pulldate0";
$modify_date = "";
$status = "NEW";
$user = "";
$called_since_last_reset='N';
$gmt_offset = '0';
if (length($forcelistid) > 0)
{
$list_id = $forcelistid; # set list_id to override value
}
if ($forcegmt > 0)
{
$gmt_offset = $m[23]; # set GMT offset value to 24th field value
}
else
{
$PC_processed=0;
### UNITED STATES ###
if ($phone_code =~ /^1$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### MEXICO ###
if ($phone_code =~ /^52$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### AUSTRALIA ###
if ($phone_code =~ /^61$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### ALL OTHER COUNTRY CODES ###
if (!$PC_processed)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### Find out if DST to raise the gmt offset ###
$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD);
$AC_localtime = ($secX + (3600 * $AC_GMT_diff));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
$AC_processed=0;
if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) )
{
if ($DBX) {print " First Sunday April to Last Sunday October\n";}
&USA_dstcalc;
if ($DBX) {print " DST: $USA_DST\n";}
if ($USA_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) )
{
if ($DBX) {print " Last Sunday March to Last Sunday October\n";}
&GBR_dstcalc;
if ($DBX) {print " DST: $GBR_DST\n";}
if ($GBR_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) )
{
if ($DBX) {print " Last Sunday October to Last Sunday March\n";}
&AUS_dstcalc;
if ($DBX) {print " DST: $AUS_DST\n";}
if ($AUS_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) )
{
if ($DBX) {print " First Sunday October to Last Sunday March\n";}
&AUST_dstcalc;
if ($DBX) {print " DST: $AUST_DST\n";}
if ($AUST_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) )
{
if ($DBX) {print " First Sunday October to Third Sunday March\n";}
&NZL_dstcalc;
if ($DBX) {print " DST: $NZL_DST\n";}
if ($NZL_DST) {$gmt_offset++;}
$AC_processed++;
}
if (!$AC_processed)
{
if ($DBX) {print " No DST Method Found\n";}
if ($DBX) {print " DST: 0\n";}
$AC_processed++;
}
}
if ($multi_insert_counter > 8) if ($multi_insert_counter > 8)
{ {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments','0');"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments','0');";
if($DB){print STDERR "\n|$stmtZ|\n";} if($DB){print STDERR "\n|$stmtZ|\n";}
if (!$T) {$dbhA->query($stmtZ); } # or die "Couldn't execute query: |$stmtA|\n"; if (!$T) {$dbhA->query($stmtZ); } # or die "Couldn't execute query: |$stmtA|\n";
@@ -219,7 +427,7 @@ use Net::MySQL;
} }
else else
{ {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments','0'),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments','0'),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -307,3 +515,353 @@ $secZm = ($secZ /60);
print "script execution time in seconds: $secZ minutes: $secZm\n"; print "script execution time in seconds: $secZ minutes: $secZm\n";
exit; exit;
sub USA_dstcalc {
#**********************************************************************
# FSA-LSO
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in April and last Sunday in October at 2 am.
# INPUTS:
# mm INTEGER Month.
# dd INTEGER Day of the month.
# ns INTEGER Seconds into the day.
# dow INTEGER Day of week (0=Sunday, to 6=Saturday)
# OPTIONAL INPUT:
# timezone INTEGER hour difference UTC - local standard time
# (DEFAULT is blank)
# make calculations based on UTC time,
# which means shift at 10:00 UTC in April
# and 9:00 UTC in October
# OUTPUT:
# INTEGER 1 = DST, 0 = not DST
#**********************************************************************
$USA_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 4 || $mm > 10) {
$USA_DST=0; return 0;
} elsif ($mm >= 5 && $mm <= 9) {
$USA_DST=1; return 1;
} elsif ($mm == 4) {
if ($dd > 7) {
$USA_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$USA_DST=0; return 0;
} else {
$USA_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 7200) {
$USA_DST=0; return 0;
} else {
$USA_DST=1; return 1;
}
}
} else {
$USA_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$USA_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$USA_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (7200+($timezone-1)*3600)) {
$USA_DST=1; return 1;
} else {
$USA_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 7200) {
$USA_DST=1; return 1;
} else {
$USA_DST=0; return 0;
}
}
} else {
$USA_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub GBR_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in March and last Sunday in October at 1 am.
#**********************************************************************
$GBR_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$GBR_DST=0; return 0;
} elsif ($mm >= 4 && $mm <= 9) {
$GBR_DST=1; return 1;
} elsif ($mm == 3) {
if ($dd < 25) {
$GBR_DST=0; return 0;
} elsif ($dd < ($dow+25)) {
$GBR_DST=0; return 0;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=0; return 0;
} else {
$GBR_DST=1; return 1;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=0; return 0;
} else {
$GBR_DST=1; return 1;
}
}
} else {
$GBR_DST=1; return 1;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$GBR_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$GBR_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=1; return 1;
} else {
$GBR_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=1; return 1;
} else {
$GBR_DST=0; return 0;
}
}
} else {
$GBR_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub AUS_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUS_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUS_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$AUS_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 25) {
$AUS_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$AUS_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=1; return 1;
} else {
$AUS_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=1; return 1;
} else {
$AUS_DST=0; return 0;
}
}
} else {
$AUS_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$AUS_DST=0; return 0;
} elsif ($dd < ($dow+25)) {
$AUS_DST=0; return 0;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=0; return 0;
} else {
$AUS_DST=1; return 1;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=0; return 0;
} else {
$AUS_DST=1; return 1;
}
}
} else {
$AUS_DST=1; return 1;
}
} # end of month checks
} # end of subroutine dstcalc
sub AUST_dstcalc {
#**********************************************************************
# TASMANIA ONLY
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUST_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUST_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$AUST_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 25) {
$AUST_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$AUST_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUST_DST=1; return 1;
} else {
$AUST_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUST_DST=1; return 1;
} else {
$AUST_DST=0; return 0;
}
}
} else {
$AUST_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd > 7) {
$AUST_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$AUST_DST=0; return 0;
} else {
$AUST_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 3600) {
$AUST_DST=0; return 0;
} else {
$AUST_DST=1; return 1;
}
}
} else {
$AUST_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub NZL_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and third Sunday in March at 1 am.
#**********************************************************************
$NZL_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$NZL_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$NZL_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 14) {
$NZL_DST=1; return 1;
} elsif ($dd < ($dow+14)) {
$NZL_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$NZL_DST=1; return 1;
} else {
$NZL_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$NZL_DST=1; return 1;
} else {
$NZL_DST=0; return 0;
}
}
} else {
$NZL_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd > 7) {
$NZL_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$NZL_DST=0; return 0;
} else {
$NZL_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 3600) {
$NZL_DST=0; return 0;
} else {
$NZL_DST=1; return 1;
}
}
} else {
$NZL_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
+342 -108
View File
@@ -268,8 +268,14 @@ if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"]
elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];}
if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];}
elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];}
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];}
elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];}
if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];}
elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];}
if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];}
elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
@@ -328,12 +334,14 @@ if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"]
# - Added test dialable leads count popup to filter screen # - Added test dialable leads count popup to filter screen
# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen # 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen
# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen # 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen
# 60609-1051 - Added add-to-dnc in LISTS section
# 60613-1415 - Added lead recycling options to campaign detail screen
# #
# 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 # 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 = '1.1.11-9'; $version = '1.1.11-11';
$build = '60608-1401'; $build = '60613-1415';
$STARTtime = date("U"); $STARTtime = date("U");
@@ -421,6 +429,7 @@ if (!isset($ADD)) {$ADD=0;}
if ($ADD==1) {$hh='users'; echo "Add New User";} if ($ADD==1) {$hh='users'; echo "Add New User";}
if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";}
if ($ADD==111) {$hh='lists'; echo "Add New List";} if ($ADD==111) {$hh='lists'; echo "Add New List";}
if ($ADD==121) {$hh='lists'; echo "Add New DNC";}
if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";}
if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";}
if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";}
@@ -432,6 +441,7 @@ if ($ADD==2) {$hh='users'; echo "New User Addition";}
if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";}
if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";}
if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";}
if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";}
if ($ADD==211) {$hh='lists'; echo "New List Addition";} if ($ADD==211) {$hh='lists'; echo "New List Addition";}
if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";}
if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";}
@@ -459,6 +469,7 @@ if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";}
if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";} if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";}
if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";} if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";}
if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";} if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";}
if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";}
if ($ADD==411) {$hh='lists'; echo "Modify List";} if ($ADD==411) {$hh='lists'; echo "Modify List";}
if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";}
if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";}
@@ -481,6 +492,7 @@ if ($ADD==5111111111) {$hh='times'; echo "Delete State Call Time";}
if ($ADD==6) {$hh='users'; echo "Delete User";} if ($ADD==6) {$hh='users'; echo "Delete User";}
if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";}
if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";}
if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";}
if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==611) {$hh='lists'; echo "Delete List";}
if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";}
if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";}
@@ -512,14 +524,14 @@ if ( ($ADD>9) && ($ADD < 99998) )
{ {
##### get scripts listing for dynamic pulldown ##### get scripts listing for dynamic pulldown
$stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$scripts_to_print = mysql_num_rows($rsltx); $scripts_to_print = mysql_num_rows($rslt);
$scripts_list="<option value=\"\">NONE</option>\n"; $scripts_list="<option value=\"\">NONE</option>\n";
$o=0; $o=0;
while ($scripts_to_print > $o) while ($scripts_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$scriptname_list["$rowx[0]"] = "$rowx[1]"; $scriptname_list["$rowx[0]"] = "$rowx[1]";
$o++; $o++;
@@ -527,14 +539,14 @@ if ( ($ADD>9) && ($ADD < 99998) )
##### get filters listing for dynamic pulldown ##### get filters listing for dynamic pulldown
$stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$filters_to_print = mysql_num_rows($rsltx); $filters_to_print = mysql_num_rows($rslt);
$filters_list="<option value=\"\">NONE</option>\n"; $filters_list="<option value=\"\">NONE</option>\n";
$o=0; $o=0;
while ($filters_to_print > $o) while ($filters_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$filtername_list["$rowx[0]"] = "$rowx[1]"; $filtername_list["$rowx[0]"] = "$rowx[1]";
$filtersql_list["$rowx[0]"] = "$rowx[2]"; $filtersql_list["$rowx[0]"] = "$rowx[2]";
@@ -543,13 +555,13 @@ if ( ($ADD>9) && ($ADD < 99998) )
##### get call_times listing for dynamic pulldown ##### get call_times listing for dynamic pulldown
$stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$times_to_print = mysql_num_rows($rsltx); $times_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($times_to_print > $o) while ($times_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$call_timename_list["$rowx[0]"] = "$rowx[1]"; $call_timename_list["$rowx[0]"] = "$rowx[1]";
$o++; $o++;
@@ -560,28 +572,28 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==31) or ($ADD=
{ {
##### get server listing for dynamic pulldown ##### get server listing for dynamic pulldown
$stmt="SELECT server_ip,server_description from servers order by server_ip"; $stmt="SELECT server_ip,server_description from servers order by server_ip";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$servers_to_print = mysql_num_rows($rsltx); $servers_to_print = mysql_num_rows($rslt);
$servers_list=''; $servers_list='';
$o=0; $o=0;
while ($servers_to_print > $o) while ($servers_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
##### get campaigns listing for dynamic pulldown ##### get campaigns listing for dynamic pulldown
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rsltx); $campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list=''; $campaigns_list='';
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -618,15 +630,15 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==31) or ($ADD=
} }
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$groups_to_print = mysql_num_rows($rsltx); $groups_to_print = mysql_num_rows($rslt);
$groups_list=''; $groups_list='';
$groups_value=''; $groups_value='';
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$group_id_value = $rowx[0]; $group_id_value = $rowx[0];
$group_name_value = $rowx[1]; $group_name_value = $rowx[1];
$groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\"";
@@ -938,7 +950,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR> <BR>
<A NAME="vicidial_campaigns-campaign_cid"> <A NAME="vicidial_campaigns-campaign_cid">
<BR> <BR>
<B>Campaign CallerID -</B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. This option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on. This feature may also work with IAX2 trunks depending on what your provider allows. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. <B>Campaign CallerID -</B> This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID.
<BR> <BR>
<A NAME="vicidial_campaigns-campaign_vdad_exten"> <A NAME="vicidial_campaigns-campaign_vdad_exten">
@@ -1026,9 +1038,14 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<B>Wrapup Message -</B> This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. <B>Wrapup Message -</B> This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set.
<BR> <BR>
<A NAME="vicidial_campaigns-closer_campaigns"> <A NAME="vicidial_campaigns-wrapup_message">
<BR> <BR>
<B>Allowable Inbound Groups -</B> Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. <B>Wrapup Message -</B> This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set.
<BR>
<A NAME="vicidial_campaigns-use_internal_dnc">
<BR>
<B>Use Internal DNC List -</B> This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N.
@@ -1060,6 +1077,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR> <BR>
<B>Reset Lead-Called-Status for this list -</B> This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen. <B>Reset Lead-Called-Status for this list -</B> This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen.
<BR>
<A NAME="vicidial_list-dnc">
<BR>
<B>VICIDIAL DNC List -</B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list.
<BR><BR><BR><BR> <BR><BR><BR><BR>
@@ -1205,6 +1227,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_LEAD_RECYCLE TABLE</FONT></B><BR><BR>
<A NAME="vicidial_lead_recycle">
<BR>
<B>Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0.</B>
<BR><BR><BR><BR> <BR><BR><BR><BR>
@@ -1385,12 +1417,12 @@ if ($lead_filter_id=='')
} }
$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx); $lists_to_print = mysql_num_rows($rslt);
$camp_lists=''; $camp_lists='';
$o=0; $o=0;
while ($lists_to_print > $o) { while ($lists_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$o++; $o++;
if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";}
} }
@@ -1569,7 +1601,7 @@ if (strlen($campaigns_hh) > 1) {
<? } <? }
if (strlen($lists_hh) > 1) { if (strlen($lists_hh) > 1) {
?> ?>
<TR BGCOLOR=#FFCCCC><TD ALIGN=CENTER COLSPAN=10><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1><B> &nbsp; <a href="<? echo $PHP_SELF ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>SHOW LISTS</a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="<? echo $PHP_SELF ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>ADD NEW LIST</a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>SEARCH FOR A LEAD</a> | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; <a href="./listloaderMAIN.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>LOAD NEW LEADS</a></TD></TR> <TR BGCOLOR=#FFCCCC><TD ALIGN=CENTER COLSPAN=10><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1><B> &nbsp; <a href="<? echo $PHP_SELF ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>SHOW LISTS</a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="<? echo $PHP_SELF ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>ADD NEW LIST</a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>SEARCH FOR A LEAD</a> | &nbsp; &nbsp; <a href="<? echo $PHP_SELF ?>?ADD=121"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>ADD NUMBER TO DNC</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; <a href="./listloaderMAIN.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=1>LOAD NEW LEADS</a></TD></TR>
<? } <? }
if (strlen($scripts_hh) > 1) { if (strlen($scripts_hh) > 1) {
?> ?>
@@ -1643,13 +1675,13 @@ echo "</select>$NWB#vicidial_users-user_level$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>User Group: </td><td align=left><select size=1 name=user_group>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>User Group: </td><td align=left><select size=1 name=user_group>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$Ugroups_to_print = mysql_num_rows($rsltx); $Ugroups_to_print = mysql_num_rows($rslt);
$Ugroups_list=''; $Ugroups_list='';
$o=0; $o=0;
while ($Ugroups_to_print > $o) { while ($Ugroups_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$Ugroups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $Ugroups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -1715,13 +1747,13 @@ echo "<tr bgcolor=#B6D3FC><td align=right>List Name: </td><td align=left><input
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\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"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rsltx); $campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list=''; $campaigns_list='';
$o=0; $o=0;
while ($campaigns_to_print > $o) { while ($campaigns_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -1735,6 +1767,49 @@ echo "</TABLE></center>\n";
} }
######################
# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number
######################
if ($ADD==121)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if (strlen($phone_number) > 2)
{
$stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DNC NOT ADDED - This phone number is already in the Do Not Call List: $phone_number<BR><BR>\n";}
else
{
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC ADDED: $phone_number</B><BR><BR>\n";
### LOG INSERTION TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n");
fclose($fp);
}
}
}
echo "<br>ADD A NUMBER TO THE DNC LIST<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=121>\n";
echo "<center><TABLE width=600 cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Number: </td><td align=left><input type=text name=phone_number size=12 maxlength=10> (digits only)$NWB#vicidial_list-dnc$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";
}
###################### ######################
# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN # ADD=1111 display the ADD NEW INBOUND GROUP SCREEN
###################### ######################
@@ -2091,6 +2166,48 @@ $ADD=31;
} }
######################
# ADD=25 adds the new campaign lead recycle entry to the system
######################
if ($ADD==25)
{
$status = eregi_replace("-----.*",'',$status);
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) )
{
echo "<br>CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
echo "<br>attempt delay must be at least 120 seconds\n";
echo "<br>maximum attempts must be from 1 to 10\n";
}
else
{
echo "<br><B>CAMPAIGN LEAD RECYCLE ADDED: $campaign_id - $status - $attempt_delay</B>\n";
$stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');";
$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 LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
}
$ADD=31;
}
###################### ######################
# ADD=211 adds the new list to the system # ADD=211 adds the new list to the system
###################### ######################
@@ -2534,7 +2651,7 @@ if ($ADD==41)
{ {
echo "<br><B>CAMPAIGN MODIFIED: $campaign_id</B>\n"; echo "<br><B>CAMPAIGN MODIFIED: $campaign_id</B>\n";
$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', auto_dial_level='$auto_dial_level', 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='$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' 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', auto_dial_level='$auto_dial_level', 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='$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' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link); $rslt=mysql_query($stmtA, $link);
if ($reset_hopper == 'Y') if ($reset_hopper == 'Y')
@@ -2680,6 +2797,40 @@ if ($ADD==44)
$ADD=34; # go to campaign modification form below $ADD=34; # go to campaign modification form below
} }
######################
# ADD=45 modify campaign lead recycle in the system
######################
if ($ADD==45)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) )
{
echo "<br>CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
echo "<br>attempt delay must be at least 120 seconds\n";
echo "<br>maximum attempts must be from 1 to 10\n";
}
else
{
echo "<br><B>CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay</B>\n";
$stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
$ADD=31; # go to campaign modification form below
}
###################### ######################
# ADD=411 submit list modifications to the system # ADD=411 submit list modifications to the system
###################### ######################
@@ -3358,6 +3509,42 @@ if ($ADD==62)
$ADD='31'; # go to campaign modification below $ADD='31'; # go to campaign modification below
} }
######################
# ADD=65 delete campaign lead recycle in the system
######################
if ($ADD==65)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) )
{
echo "<br>CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>status must be between 1 and 6 characters in length\n";
echo "<br>attempt delay must be at least 120 seconds\n";
echo "<br>maximum attempts must be from 1 to 10\n";
}
else
{
echo "<br><B>CAMPAIGN LEAD RECYCLE DELETED: $campaign_id - $status - $attempt_delay</B>\n";
$stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';";
$rslt=mysql_query($stmt, $link);
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
$ADD=31; # go to campaign modification form below
}
###################### ######################
# ADD=611 delete list record and all leads within it # ADD=611 delete list record and all leads within it
###################### ######################
@@ -3612,13 +3799,13 @@ if ($ADD==6111111111)
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$sct_to_print = mysql_num_rows($rsltx); $sct_to_print = mysql_num_rows($rslt);
$sct_list=''; $sct_list='';
$o=0; $o=0;
while ($sct_to_print > $o) { while ($sct_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$sct_ids[$o] = "$rowx[0]"; $sct_ids[$o] = "$rowx[0]";
$sct_states[$o] = "$rowx[1]"; $sct_states[$o] = "$rowx[1]";
$o++; $o++;
@@ -3736,13 +3923,13 @@ else
echo "<tr bgcolor=#B6D3FC><td align=right>User Group: </td><td align=left><select size=1 name=user_group>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>User Group: </td><td align=left><select size=1 name=user_group>\n";
$stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$Ugroups_to_print = mysql_num_rows($rsltx); $Ugroups_to_print = mysql_num_rows($rslt);
$Ugroups_list=''; $Ugroups_list='';
$o=0; $o=0;
while ($Ugroups_to_print > $o) { while ($Ugroups_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$Ugroups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $Ugroups_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -3815,12 +4002,12 @@ if ($ADD==31)
if ($stage=='show_dialable') if ($stage=='show_dialable')
{ {
$stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
} }
if ($stage=='hide_dialable') if ($stage=='hide_dialable')
{ {
$stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
} }
echo "<TABLE><TR><TD>\n"; echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
@@ -3865,6 +4052,7 @@ echo "<TABLE><TR><TD>\n";
$wrapup_seconds = $row[40]; $wrapup_seconds = $row[40];
$wrapup_message = $row[41]; $wrapup_message = $row[41];
# $closer_campaigns = $row[42]; # $closer_campaigns = $row[42];
$use_internal_dnc = $row[43];
echo "<br>MODIFY A CAMPAIGNS RECORD: $row[0] - <a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\">Basic View</a>"; 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> | "; echo " | Detail View</a> | ";
@@ -3882,13 +4070,13 @@ echo "<tr bgcolor=#B6D3FC><td align=right>Allow Closers: </td><td align=left><se
echo "<tr bgcolor=#B6D3FC><td align=right>Dial status 1: </td><td align=left><select size=1 name=dial_status_a>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Dial status 1: </td><td align=left><select size=1 name=dial_status_a>\n";
$stmt="SELECT * from vicidial_statuses order by status"; $stmt="SELECT * from vicidial_statuses order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$statuses_list=''; $statuses_list='';
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$statname_list["$rowx[0]"] = "$rowx[1]"; $statname_list["$rowx[0]"] = "$rowx[1]";
if (eregi("Y",$rowx[2])) if (eregi("Y",$rowx[2]))
@@ -3897,12 +4085,12 @@ echo "<tr bgcolor=#B6D3FC><td align=right>Dial status 1: </td><td align=left><se
} }
$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status"; $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' and selectable='Y' order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rsltx); $Cstatuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($Cstatuses_to_print > $o) { while ($Cstatuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$statname_list["$rowx[0]"] = "$rowx[1]"; $statname_list["$rowx[0]"] = "$rowx[1]";
if (eregi("Y",$rowx[2])) if (eregi("Y",$rowx[2]))
@@ -3998,6 +4186,8 @@ echo "<tr bgcolor=#B6D3FC><td align=right>Wrapup Seconds: </td><td align=left><i
echo "<tr bgcolor=#B6D3FC><td align=right>Wrapup Message: </td><td align=left><input type=text name=wrapup_message size=40 maxlength=255 value=\"$wrapup_message\">$NWB#vicidial_campaigns-wrapup_message$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Wrapup Message: </td><td align=left><input type=text name=wrapup_message size=40 maxlength=255 value=\"$wrapup_message\">$NWB#vicidial_campaigns-wrapup_message$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Use Internal DNC List: </td><td align=left><select size=1 name=use_internal_dnc><option>Y</option><option>N</option><option SELECTED>$use_internal_dnc</option></select>$NWB#vicidial_campaigns-use_internal_dnc$NWE</td></tr>\n";
if (eregi("CLOSER", $campaign_id)) if (eregi("CLOSER", $campaign_id))
{ {
@@ -4020,13 +4210,13 @@ echo "<tr><td>LIST ID</td><td>LIST NAME</td><td>ACTIVE</td></tr>\n";
$active_lists = 0; $active_lists = 0;
$inactive_lists = 0; $inactive_lists = 0;
$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx); $lists_to_print = mysql_num_rows($rslt);
$camp_lists=''; $camp_lists='';
$o=0; $o=0;
while ($lists_to_print > $o) { while ($lists_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$o++; $o++;
if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
if (ereg("N", $rowx[1])) {$inactive_lists++;} if (ereg("N", $rowx[1])) {$inactive_lists++;}
@@ -4071,8 +4261,8 @@ else
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$hopper_leads = "$rowx[0]"; $hopper_leads = "$rowx[0]";
echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n"; echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n";
@@ -4089,11 +4279,11 @@ echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>DESCRIPTION</td><td>SELECTABLE</td><td>DELETE</td></tr>\n"; echo "<tr><td>STATUS</td><td>DESCRIPTION</td><td>SELECTABLE</td><td>DELETE</td></tr>\n";
$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$o++; $o++;
if (eregi("1$|3$|5$|7$|9$", $o)) if (eregi("1$|3$|5$|7$|9$", $o))
@@ -4124,11 +4314,11 @@ echo "<TABLE width=400 cellspacing=3>\n";
echo "<tr><td>HOTKEY</td><td>STATUS</td><td>DESCRIPTION</td><td>DELETE</td></tr>\n"; echo "<tr><td>HOTKEY</td><td>STATUS</td><td>DESCRIPTION</td><td>DELETE</td></tr>\n";
$stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$o++; $o++;
if (eregi("1$|3$|5$|7$|9$", $o)) if (eregi("1$|3$|5$|7$|9$", $o))
@@ -4162,6 +4352,49 @@ echo "$HKstatuses_list\n";
echo "</select> &nbsp; \n"; echo "</select> &nbsp; \n";
echo "<input type=submit name=submit value=ADD><BR>\n"; echo "<input type=submit name=submit value=ADD><BR>\n";
echo "<br><br><b>LEAD RECYCLING WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_lead_recycle$NWE</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>ATTEMPT DELAY</td><td>ATTEMPT MAXIMUM</td><td>ACTIVE</td><td> </td><td>DELETE</td></tr>\n";
$stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$recycle_to_print = mysql_num_rows($rslt);
$o=0;
while ($recycle_to_print > $o) {
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>$rowx[2]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=status value=\"$rowx[2]\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=ADD value=45></td>\n";
echo "<td><font size=1><input size=7 maxlength=5 name=attempt_delay value=\"$rowx[3]\"></td>\n";
echo "<td><font size=1><input size=5 maxlength=3 name=attempt_maximum value=\"$rowx[4]\"></td>\n";
echo "<td><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$rowx[5]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=65&campaign_id=$campaign_id&status=$rowx[2]\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW CAMPAIGN LEAD RECYCLE<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=25>\n";
echo "<input type=hidden name=active value=\"N\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Status: <select size=1 name=status>\n";
echo "$HKstatuses_list\n";
echo "</select> &nbsp; \n";
echo "Attempt Delay: <input size=7 maxlength=5 name=attempt_delay>\n";
echo "Attempt Maximum: <input size=5 maxlength=3 name=attempt_maximum>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</center></FORM><br>\n"; echo "</center></FORM><br>\n";
echo "<a href=\"$PHP_SELF?ADD=52&campaign_id=$campaign_id\">LOG ALL AGENTS OUT OF THIS CAMPAIGN</a><BR><BR>\n"; echo "<a href=\"$PHP_SELF?ADD=52&campaign_id=$campaign_id\">LOG ALL AGENTS OUT OF THIS CAMPAIGN</a><BR><BR>\n";
@@ -4183,12 +4416,12 @@ if ($ADD==34)
if ($stage=='show_dialable') if ($stage=='show_dialable')
{ {
$stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
} }
if ($stage=='hide_dialable') if ($stage=='hide_dialable')
{ {
$stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
} }
echo "<TABLE><TR><TD>\n"; echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"; echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
@@ -4233,25 +4466,25 @@ echo "<tr bgcolor=#B6D3FC><td align=right>Allow Closers: </td><td align=left>$ro
echo "<tr bgcolor=#B6D3FC><td align=right>Dial status 1: </td><td align=left><select size=1 name=dial_status_a>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Dial status 1: </td><td align=left><select size=1 name=dial_status_a>\n";
$stmt="SELECT * from vicidial_statuses order by status"; $stmt="SELECT * from vicidial_statuses order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$statuses_list=''; $statuses_list='';
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$statname_list["$rowx[0]"] = "$rowx[1]"; $statname_list["$rowx[0]"] = "$rowx[1]";
$o++; $o++;
} }
$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rsltx); $Cstatuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($Cstatuses_to_print > $o) { while ($Cstatuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$statname_list["$rowx[0]"] = "$rowx[1]"; $statname_list["$rowx[0]"] = "$rowx[1]";
$o++; $o++;
@@ -4304,13 +4537,13 @@ echo "<tr><td>LIST ID</td><td>LIST NAME</td><td>ACTIVE</td></tr>\n";
$active_lists = 0; $active_lists = 0;
$inactive_lists = 0; $inactive_lists = 0;
$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rsltx); $lists_to_print = mysql_num_rows($rslt);
$camp_lists=''; $camp_lists='';
$o=0; $o=0;
while ($lists_to_print > $o) { while ($lists_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$o++; $o++;
if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
if (ereg("N", $rowx[1])) {$inactive_lists++;} if (ereg("N", $rowx[1])) {$inactive_lists++;}
@@ -4354,8 +4587,8 @@ else
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$hopper_leads = "$rowx[0]"; $hopper_leads = "$rowx[0]";
echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n"; echo "This campaign has $hopper_leads leads in the dial hopper<br><br>\n";
@@ -4394,23 +4627,23 @@ echo "<TABLE><TR><TD>\n";
# grab names of global statuses and statuses in the selected campaign # grab names of global statuses and statuses in the selected campaign
$stmt="SELECT * from vicidial_statuses order by status"; $stmt="SELECT * from vicidial_statuses order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list["$rowx[0]"] = "$rowx[1]"; $statuses_list["$rowx[0]"] = "$rowx[1]";
$o++; $o++;
} }
$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$Cstatuses_to_print = mysql_num_rows($rsltx); $Cstatuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($Cstatuses_to_print > $o) { while ($Cstatuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list["$rowx[0]"] = "$rowx[1]"; $statuses_list["$rowx[0]"] = "$rowx[1]";
$o++; $o++;
} }
@@ -4427,13 +4660,13 @@ echo "<tr bgcolor=#B6D3FC><td align=right>List Name: </td><td align=left><input
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"; 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"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rsltx); $campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list=''; $campaigns_list='';
$o=0; $o=0;
while ($campaigns_to_print > $o) { while ($campaigns_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -4454,8 +4687,8 @@ echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td><
$leads_in_list_N = 0; $leads_in_list_N = 0;
$leads_in_list_Y = 0; $leads_in_list_Y = 0;
$stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
$lead_list['count'] = 0; $lead_list['count'] = 0;
@@ -4463,7 +4696,7 @@ echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td><
$lead_list['N_count'] = 0; $lead_list['N_count'] = 0;
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]); $lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N') if ($rowx[1] == 'N')
@@ -4476,7 +4709,7 @@ echo "<tr><td>STATUS</td><td>STATUS NAME</td><td>CALLED</td><td>NOT CALLED</td><
$since_reset = 'Y'; $since_reset = 'Y';
$since_resetX = 'N'; $since_resetX = 'N';
} }
$lead_list[$since_reset][$rowx[0]] = $rowx[2]; $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero #If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]])) if (!isset($lead_list[$since_resetX][$rowx[0]]))
@@ -4526,8 +4759,8 @@ echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>GMT OFFSET NOW (local time)</td><td>CALLED</td><td>NOT CALLED</td></tr>\n"; echo "<tr><td>GMT OFFSET NOW (local time)</td><td>CALLED</td><td>NOT CALLED</td></tr>\n";
$stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset"; $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
$plus='+'; $plus='+';
@@ -4536,7 +4769,7 @@ echo "<tr><td>GMT OFFSET NOW (local time)</td><td>CALLED</td><td>NOT CALLED</td>
$lead_list['N_count'] = 0; $lead_list['N_count'] = 0;
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$lead_list['count'] = ($lead_list['count'] + $rowx[2]); $lead_list['count'] = ($lead_list['count'] + $rowx[2]);
if ($rowx[1] == 'N') if ($rowx[1] == 'N')
@@ -4549,7 +4782,7 @@ echo "<tr><td>GMT OFFSET NOW (local time)</td><td>CALLED</td><td>NOT CALLED</td>
$since_reset = 'Y'; $since_reset = 'Y';
$since_resetX = 'N'; $since_resetX = 'N';
} }
$lead_list[$since_reset][$rowx[0]] = $rowx[2]; $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]);
$lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
#If opposite side is not set, it may not in the future so give it a value of zero #If opposite side is not set, it may not in the future so give it a value of zero
if (!isset($lead_list[$since_resetX][$rowx[0]])) if (!isset($lead_list[$since_resetX][$rowx[0]]))
@@ -4564,13 +4797,14 @@ echo "<tr><td>GMT OFFSET NOW (local time)</td><td>CALLED</td><td>NOT CALLED</td>
$LOCALzone=3600 * $tzone; $LOCALzone=3600 * $tzone;
$LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone);
if ($tzone >= 0) {$tzone = "$plus$tzone";} if ($tzone >= 0) {$DISPtzone = "$plus$tzone";}
else {$DISPtzone = "$tzone";}
if (eregi("1$|3$|5$|7$|9$", $o)) if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>".$tzone." &nbsp; &nbsp; ($LOCALdate)</td><td><font size=1>".$lead_list['Y'][$tzone]."</td><td><font size=1>".$lead_list['N'][$tzone]."</td></tr>\n"; echo "<tr $bgcolor><td><font size=1>".$DISPtzone." &nbsp; &nbsp; ($LOCALdate)</td><td><font size=1>".$lead_list['Y'][$tzone]."</td><td><font size=1>".$lead_list['N'][$tzone]."</td></tr>\n";
} }
echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n"; echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
@@ -4589,8 +4823,8 @@ unset($lead_list);
$leads_in_list_N = 0; $leads_in_list_N = 0;
$leads_in_list_Y = 0; $leads_in_list_Y = 0;
$stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$status_called_to_print = mysql_num_rows($rsltx); $status_called_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
$sts=0; $sts=0;
@@ -4599,7 +4833,7 @@ unset($lead_list);
$all_called_last=0; $all_called_last=0;
while ($status_called_to_print > $o) while ($status_called_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$leads_in_list = ($leads_in_list + $rowx[2]); $leads_in_list = ($leads_in_list + $rowx[2]);
$count_statuses[$o] = "$rowx[0]"; $count_statuses[$o] = "$rowx[0]";
$count_called[$o] = "$rowx[1]"; $count_called[$o] = "$rowx[1]";
@@ -4946,14 +5180,14 @@ echo "</TABLE></center></form>\n";
##### get campaigns listing for dynamic pulldown ##### get campaigns listing for dynamic pulldown
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rsltx); $campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list=''; $campaigns_list='';
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -5108,13 +5342,13 @@ if (strlen($srs_SQL)>2)
else else
{$srs_SQL='';} {$srs_SQL='';}
$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; $stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$sct_to_print = mysql_num_rows($rsltx); $sct_to_print = mysql_num_rows($rslt);
$sct_list=''; $sct_list='';
$o=0; $o=0;
while ($sct_to_print > $o) { while ($sct_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$sct_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $sct_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -5811,8 +6045,8 @@ if (isset($camp_lists))
$stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$Gct_default_start = "$rowx[3]"; $Gct_default_start = "$rowx[3]";
$Gct_default_stop = "$rowx[4]"; $Gct_default_stop = "$rowx[4]";
$Gct_sunday_start = "$rowx[5]"; $Gct_sunday_start = "$rowx[5]";
@@ -6085,11 +6319,11 @@ if (isset($camp_lists))
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL";
#$DB=1; #$DB=1;
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$rsltx_rows = mysql_num_rows($rsltx); $rslt_rows = mysql_num_rows($rslt);
if ($rsltx_rows) if ($rslt_rows)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$active_leads = "$rowx[0]"; $active_leads = "$rowx[0]";
} }
else {$active_leads = '0';} else {$active_leads = '0';}
@@ -96,6 +96,7 @@ if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];}
# #
# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user # 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user
# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60609-1112 - Added DNC list addition if status changed to DNC
# #
$STARTtime = date("U"); $STARTtime = date("U");
@@ -200,6 +201,16 @@ $call_length = ($STARTtime - $call_began);
echo "<BR>vicidial_callback record inactivated: $lead_id<BR>\n"; echo "<BR>vicidial_callback record inactivated: $lead_id<BR>\n";
} }
if ( ($dispo != $status) and ($status == 'DNC') )
{
### add lead to the internal DNC list
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
echo "<BR>Lead added to DNC List: $lead_id - $phone_number<BR>\n";
}
} }
else else
{ {
@@ -309,15 +320,15 @@ else
echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n";
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status"; $stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$statuses_list=''; $statuses_list='';
$o=0; $o=0;
$DS=0; $DS=0;
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
if ($dispo == "$rowx[0]") if ($dispo == "$rowx[0]")
{$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;} {$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else else
@@ -338,9 +349,9 @@ else
### find any vicidial_callback records for this lead ### find any vicidial_callback records for this lead
$stmt="select * from vicidial_callbacks where lead_id='$lead_id' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; $stmt="select * from vicidial_callbacks where lead_id='$lead_id' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$CB_to_print = mysql_num_rows($rsltx); $CB_to_print = mysql_num_rows($rslt);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
if ($CB_to_print>0) if ($CB_to_print>0)
{ {
+3 -3
View File
@@ -257,13 +257,13 @@ else
echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n";
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status"; $stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$statuses_list=''; $statuses_list='';
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
+521 -17
View File
@@ -9,9 +9,10 @@
# 50602-1640 - First version created by Joe Johnson # 50602-1640 - First version created by Joe Johnson
# 51128-1108 - Removed PHP global vars requirement # 51128-1108 - Removed PHP global vars requirement
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60616-1006 - added listID override and gmt_offset lookup while loading
# #
# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time.
#
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -23,13 +24,18 @@ $PHP_SELF=$_SERVER['PHP_SELF'];
$leadfile=$_FILES["leadfile"]; $leadfile=$_FILES["leadfile"];
$LF_orig = $_FILES['leadfile']['name']; $LF_orig = $_FILES['leadfile']['name'];
$LF_path = $_FILES['leadfile']['tmp_name']; $LF_path = $_FILES['leadfile']['tmp_name'];
$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} $submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];}
$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} $list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];}
$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} $list_id_override = (preg_replace("/\D/","",$list_id_override));
$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];}
$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];}
$version = '1.1.11'; #$DB=1;
$build = '60421-1043'; #$DBX=1;
$version = '1.1.12';
$build = '60616-1006';
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
@@ -42,9 +48,53 @@ $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
$hour = date("H");
$min = date("i");
$sec = date("s");
$mon = date("m");
$mday = date("d");
$year = date("Y");
$isdst = date("I");
$Shour = date("H");
$Smin = date("i");
$Ssec = date("s");
$Smon = date("m");
$Smday = date("d");
$Syear = date("Y");
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
$inSD = $pulldate0;
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
### Grab Server GMT value from the database
$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';";
$rslt=mysql_query($stmt, $link);
$gmt_recs = mysql_num_rows($rslt);
if ($gmt_recs > 0)
{
$row=mysql_fetch_row($rslt);
$DBSERVER_GMT = "$row[0]";
if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;}
if ($isdst) {$SERVER_GMT++;}
}
else
{
$SERVER_GMT = date("O");
$SERVER_GMT = eregi_replace("\+","",$SERVER_GMT);
$SERVER_GMT = ($SERVER_GMT + 0);
$SERVER_GMT = ($SERVER_GMT / 100);
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
echo "<html>\n"; echo "<html>\n";
echo "<head>\n"; echo "<head>\n";
echo "<!-- VERSION: $version BUILD: $build -->\n"; echo "<!-- VERSION: $version BUILD: $build -->\n";
echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF DST: $isdst -->\n";
?> ?>
@@ -68,6 +118,10 @@ function ShowProgress(good, bad, total) {
<td align=right width="25%"><font face="arial, helvetica" size=2>Load leads from this file:</font></td> <td align=right width="25%"><font face="arial, helvetica" size=2>Load leads from this file:</font></td>
<td align=left width="75%"><input type=file name="leadfile" value="<?=$leadfile ?>"> <? echo "$NWB#vicidial_list_loader$NWE"; ?></td> <td align=left width="75%"><input type=file name="leadfile" value="<?=$leadfile ?>"> <? echo "$NWB#vicidial_list_loader$NWE"; ?></td>
</tr> </tr>
<tr>
<td align=right width="25%"><font face="arial, helvetica" size=2>List ID Override: </font></td>
<td align=left width="75%"><font face="arial, helvetica" size=1><input type=text value="" name='list_id_override' size=10 maxlength=8> (numbers only or leave blank for values in the file)</td>
</tr>
<tr> <tr>
<td align=center><input type=submit value="SUBMIT" name='submit_file'></td> <td align=center><input type=submit value="SUBMIT" name='submit_file'></td>
<td align=center><input type=button onClick="javascript:document.location='listloader.php'" value="START OVER" name='reload_page'></td> <td align=center><input type=button onClick="javascript:document.location='listloader.php'" value="START OVER" name='reload_page'></td>
@@ -79,7 +133,7 @@ function ShowProgress(good, bad, total) {
#echo "|$LF_orig|$LF_path|\n"; #echo "|$LF_orig|$LF_path|\n";
if ($leadfile && filesize($LF_path)<=8388608) { if ($leadfile and filesize($LF_path)<=8388608) {
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>"; print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>";
flush(); flush();
copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt");
@@ -100,6 +154,12 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$file=fopen("./vicidial_temp_file.txt", "r"); $file=fopen("./vicidial_temp_file.txt", "r");
$total=0; $good=0; $bad=0; $total=0; $good=0; $bad=0;
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n";
if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
while (!feof($file)) { while (!feof($file)) {
$record++; $record++;
$buffer=rtrim(fgets($file, 4096)); $buffer=rtrim(fgets($file, 4096));
@@ -107,18 +167,13 @@ if ($leadfile && filesize($LF_path)<=8388608) {
if (strlen($buffer)>0) { if (strlen($buffer)>0) {
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer));
$entry_date = "$pulldate";
$modify_date = "";
$status = "NEW";
$user = "";
$vendor_lead_code = $row[0]; $vendor_lead_code = $row[0];
$source_code = $row[1]; $source_code = $row[1];
$source_id=$source_code; $source_id=$source_code;
$list_id = $row[2]; $list_id = $row[2];
$campaign_id = '';
$called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_code = eregi_replace("[^0-9]", "", $row[3]);
$phone_number = eregi_replace("[^0-9]", "", $row[4]); $phone_number = eregi_replace("[^0-9]", "", $row[4]);
$USarea = substr($phone_number, 0, 3);
$title = $row[5]; $title = $row[5];
$first_name = $row[6]; $first_name = $row[6];
$middle_initial = $row[7]; $middle_initial = $row[7];
@@ -138,11 +193,460 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$security_phrase = $row[21]; $security_phrase = $row[21];
$comments = trim($row[22]); $comments = trim($row[22]);
if (strlen($phone_number)>8) { if (strlen($phone_number)>8)
{
$entry_date = "$pulldate";
$modify_date = "";
$status = "NEW";
$user = "";
$gmt_offset = '0';
$called_since_last_reset='N';
if (strlen($list_id_override)>0)
{
# print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
$list_id = $list_id_override;
}
$PC_processed=0;
### UNITED STATES ###
if ($phone_code =='1')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### MEXICO ###
if ($phone_code =='52')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### AUSTRALIA ###
if ($phone_code =='61')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### ALL OTHER COUNTRY CODES ###
if (!$PC_processed)
{
$PC_processed++;
$stmt="select * from vicidial_phone_codes where country_code='$phone_code';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### Find out if DST to raise the gmt offset ###
$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD);
$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear);
$hour = date("H",$AC_localtime);
$min = date("i",$AC_localtime);
$sec = date("s",$AC_localtime);
$mon = date("m",$AC_localtime);
$mday = date("d",$AC_localtime);
$wday = date("w",$AC_localtime);
$year = date("Y",$AC_localtime);
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
$AC_processed=0;
if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') )
{
if ($DBX) {print " First Sunday April to Last Sunday October\n";}
#**********************************************************************
# FSA-LSO
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in April and last Sunday in October at 2 am.
# INPUTS:
# mm INTEGER Month.
# dd INTEGER Day of the month.
# ns INTEGER Seconds into the day.
# dow INTEGER Day of week (0=Sunday, to 6=Saturday)
# OPTIONAL INPUT:
# timezone INTEGER hour difference UTC - local standard time
# (DEFAULT is blank)
# make calculations based on UTC time,
# which means shift at 10:00 UTC in April
# and 9:00 UTC in October
# OUTPUT:
# INTEGER 1 = DST, 0 = not DST
#**********************************************************************
$USA_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 4 || $mm > 10) {
$USA_DST=0;
} elseif ($mm >= 5 and $mm <= 9) {
$USA_DST=1;
} elseif ($mm == 4) {
if ($dd > 7) {
$USA_DST=1;
} elseif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
$USA_DST=0;
} else {
$USA_DST=1;
}
} else {
if ($dow == 0 and $ns < 7200) {
$USA_DST=0;
} else {
$USA_DST=1;
}
}
} else {
$USA_DST=0;
}
} elseif ($mm == 10) {
if ($dd < 25) {
$USA_DST=1;
} elseif ($dd < ($dow+25)) {
$USA_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (7200+($timezone-1)*3600)) {
$USA_DST=1;
} else {
$USA_DST=0;
}
} else { # local time calculations
if ($ns < 7200) {
$USA_DST=1;
} else {
$USA_DST=0;
}
}
} else {
$USA_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $USA_DST\n";}
if ($USA_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') )
{
if ($DBX) {print " Last Sunday March to Last Sunday October\n";}
#**********************************************************************
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in March and last Sunday in October at 1 am.
#**********************************************************************
$GBR_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$GBR_DST=0;
} elseif ($mm >= 4 and $mm <= 9) {
$GBR_DST=1;
} elseif ($mm == 3) {
if ($dd < 25) {
$GBR_DST=0;
} elseif ($dd < ($dow+25)) {
$GBR_DST=0;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=0;
} else {
$GBR_DST=1;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=0;
} else {
$GBR_DST=1;
}
}
} else {
$GBR_DST=1;
}
} elseif ($mm == 10) {
if ($dd < 25) {
$GBR_DST=1;
} elseif ($dd < ($dow+25)) {
$GBR_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=1;
} else {
$GBR_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=1;
} else {
$GBR_DST=0;
}
}
} else {
$GBR_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $GBR_DST\n";}
if ($GBR_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') )
{
if ($DBX) {print " Last Sunday October to Last Sunday March\n";}
#**********************************************************************
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUS_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUS_DST=1;
} elseif ($mm >= 4 and $mm <= 9) {
$AUS_DST=0;
} elseif ($mm == 3) {
if ($dd < 25) {
$AUS_DST=1;
} elseif ($dd < ($dow+25)) {
$AUS_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=1;
} else {
$AUS_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=1;
} else {
$AUS_DST=0;
}
}
} else {
$AUS_DST=0;
}
} elseif ($mm == 10) {
if ($dd < 25) {
$AUS_DST=0;
} elseif ($dd < ($dow+25)) {
$AUS_DST=0;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=0;
} else {
$AUS_DST=1;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=0;
} else {
$AUS_DST=1;
}
}
} else {
$AUS_DST=1;
}
} # end of month checks
if ($DBX) {print " DST: $AUS_DST\n";}
if ($AUS_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') )
{
if ($DBX) {print " First Sunday October to Last Sunday March\n";}
#**********************************************************************
# TASMANIA ONLY
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUST_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUST_DST=1;
} elseif ($mm >= 4 and $mm <= 9) {
$AUST_DST=0;
} elseif ($mm == 3) {
if ($dd < 25) {
$AUST_DST=1;
} elseif ($dd < ($dow+25)) {
$AUST_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUST_DST=1;
} else {
$AUST_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUST_DST=1;
} else {
$AUST_DST=0;
}
}
} else {
$AUST_DST=0;
}
} elseif ($mm == 10) {
if ($dd > 7) {
$AUST_DST=1;
} elseif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
$AUST_DST=0;
} else {
$AUST_DST=1;
}
} else {
if ($dow == 0 and $ns < 3600) {
$AUST_DST=0;
} else {
$AUST_DST=1;
}
}
} else {
$AUST_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $AUST_DST\n";}
if ($AUST_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') )
{
if ($DBX) {print " First Sunday October to Third Sunday March\n";}
#**********************************************************************
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and third Sunday in March at 1 am.
#**********************************************************************
$NZL_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$NZL_DST=1;
} elseif ($mm >= 4 and $mm <= 9) {
$NZL_DST=0;
} elseif ($mm == 3) {
if ($dd < 14) {
$NZL_DST=1;
} elseif ($dd < ($dow+14)) {
$NZL_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$NZL_DST=1;
} else {
$NZL_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$NZL_DST=1;
} else {
$NZL_DST=0;
}
}
} else {
$NZL_DST=0;
}
} elseif ($mm == 10) {
if ($dd > 7) {
$NZL_DST=1;
} elseif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
$NZL_DST=0;
} else {
$NZL_DST=1;
}
} else {
if ($dow == 0 and $ns < 3600) {
$NZL_DST=0;
} else {
$NZL_DST=1;
}
}
} else {
$NZL_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $NZL_DST\n";}
if ($NZL_DST) {$gmt_offset++;}
$AC_processed++;
}
if (!$AC_processed)
{
if ($DBX) {print " No DST Method Found\n";}
if ($DBX) {print " DST: 0\n";}
$AC_processed++;
}
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$rslt=mysql_query($stmtZ, $link); $rslt=mysql_query($stmtZ, $link);
if ($WeBRooTWritablE > 0) if ($WeBRooTWritablE > 0)
{fwrite($stmt_file, $stmtZ."\r\n");} {fwrite($stmt_file, $stmtZ."\r\n");}
@@ -150,7 +654,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -185,4 +689,4 @@ if ($leadfile && filesize($LF_path)<=8388608) {
} }
?> ?>
</body> </body>
</html> </html>
+561 -3
View File
@@ -4,6 +4,41 @@
### ###
### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 ### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
### ###
#
#
# CHANGES
# 60616-1548 - Added listID override feature to force all leads into same list
# - Added gmt_offset_now lookup for each lead
#
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help|-h/i)
{
print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n";
}
else
{
if ($args =~ /--forcelistid=/i)
{
@data_in = split(/--forcelistid=/,$args);
$forcelistid = $data_in[1];
print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n";
}
else
{$forcelistid = '';}
}
}
### end parsing run-time options ###
use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel;
use Time::Local; use Time::Local;
@@ -19,12 +54,42 @@ $dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", us
$|=0; $|=0;
$secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900); $year = ($year + 1900);
$mon++; $mon++;
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
if ($mon < 10) {$mon = "0$mon";} if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";} if ($mday < 10) {$mday = "0$mday";}
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
$pulldate="$year-$mon-$mday $hour:$min:$sec"; $pulldate="$year-$mon-$mday $hour:$min:$sec";
$inSD = $pulldate0;
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
### Grab Server values from the database
$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';";
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$DBSERVER_GMT = "$record->[0]";
if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;}
}
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
if ($isdst) {$LOCAL_GMT_OFF++;}
if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
$total=0; $good=0; $bad=0; $total=0; $good=0; $bad=0;
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing Excel file...\n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing Excel file...\n";
@@ -47,7 +112,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
$source_id=$source_code; $source_id=$source_code;
$oWkC = $oWkS->{Cells}[$iR][2]; $oWkC = $oWkS->{Cells}[$iR][2];
if ($oWkC) {$list_id=$oWkC->Value; } if ($oWkC) {$list_id=$oWkC->Value; }
$campaign_id = ''; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$oWkC = $oWkS->{Cells}[$iR][3]; $oWkC = $oWkS->{Cells}[$iR][3];
if ($oWkC) {$phone_code=$oWkC->Value; } if ($oWkC) {$phone_code=$oWkC->Value; }
@@ -55,6 +120,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
$oWkC = $oWkS->{Cells}[$iR][4]; $oWkC = $oWkS->{Cells}[$iR][4];
if ($oWkC) {$phone_number=$oWkC->Value; } if ($oWkC) {$phone_number=$oWkC->Value; }
$phone_number=~s/[^0-9]//g; $phone_number=~s/[^0-9]//g;
$USarea = substr($phone_number, 0, 3);
$oWkC = $oWkS->{Cells}[$iR][5]; $oWkC = $oWkS->{Cells}[$iR][5];
if ($oWkC) {$title=$oWkC->Value; } if ($oWkC) {$title=$oWkC->Value; }
$oWkC = $oWkS->{Cells}[$iR][6]; $oWkC = $oWkS->{Cells}[$iR][6];
@@ -94,17 +160,160 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
$comments=~s/^\s*(.*?)\s*$/$1/; $comments=~s/^\s*(.*?)\s*$/$1/;
if (length($phone_number)>8) { if (length($phone_number)>8) {
if (length($forcelistid) > 0)
{
$list_id = $forcelistid; # set list_id to override value
}
$PC_processed=0;
### UNITED STATES ###
if ($phone_code =~ /^1$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### MEXICO ###
if ($phone_code =~ /^52$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### AUSTRALIA ###
if ($phone_code =~ /^61$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### ALL OTHER COUNTRY CODES ###
if (!$PC_processed)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### Find out if DST to raise the gmt offset ###
$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD);
$AC_localtime = ($secX + (3600 * $AC_GMT_diff));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
$AC_processed=0;
if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) )
{
if ($DBX) {print " First Sunday April to Last Sunday October\n";}
&USA_dstcalc;
if ($DBX) {print " DST: $USA_DST\n";}
if ($USA_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) )
{
if ($DBX) {print " Last Sunday March to Last Sunday October\n";}
&GBR_dstcalc;
if ($DBX) {print " DST: $GBR_DST\n";}
if ($GBR_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) )
{
if ($DBX) {print " Last Sunday October to Last Sunday March\n";}
&AUS_dstcalc;
if ($DBX) {print " DST: $AUS_DST\n";}
if ($AUS_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) )
{
if ($DBX) {print " First Sunday October to Last Sunday March\n";}
&AUST_dstcalc;
if ($DBX) {print " DST: $AUST_DST\n";}
if ($AUST_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) )
{
if ($DBX) {print " First Sunday October to Third Sunday March\n";}
&NZL_dstcalc;
if ($DBX) {print " DST: $NZL_DST\n";}
if ($NZL_DST) {$gmt_offset++;}
$AC_processed++;
}
if (!$AC_processed)
{
if ($DBX) {print " No DST Method Found\n";}
if ($DBX) {print " DST: 0\n";}
$AC_processed++;
}
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$dbhA->query("$stmtZ"); $dbhA->query("$stmtZ");
print STMT_FILE $stmtZ."\r\n"; print STMT_FILE $stmtZ."\r\n";
$multistmt=''; $multistmt='';
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -130,3 +339,352 @@ if ($multi_insert_counter > 0) {
print "<BR><BR>Done</B> GOOD: $good &nbsp; &nbsp; &nbsp; BAD: $bad &nbsp; &nbsp; &nbsp; TOTAL: $total</font></center>"; print "<BR><BR>Done</B> GOOD: $good &nbsp; &nbsp; &nbsp; BAD: $bad &nbsp; &nbsp; &nbsp; TOTAL: $total</font></center>";
exit;
sub USA_dstcalc {
#**********************************************************************
# FSA-LSO
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in April and last Sunday in October at 2 am.
# INPUTS:
# mm INTEGER Month.
# dd INTEGER Day of the month.
# ns INTEGER Seconds into the day.
# dow INTEGER Day of week (0=Sunday, to 6=Saturday)
# OPTIONAL INPUT:
# timezone INTEGER hour difference UTC - local standard time
# (DEFAULT is blank)
# make calculations based on UTC time,
# which means shift at 10:00 UTC in April
# and 9:00 UTC in October
# OUTPUT:
# INTEGER 1 = DST, 0 = not DST
#**********************************************************************
$USA_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 4 || $mm > 10) {
$USA_DST=0; return 0;
} elsif ($mm >= 5 && $mm <= 9) {
$USA_DST=1; return 1;
} elsif ($mm == 4) {
if ($dd > 7) {
$USA_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$USA_DST=0; return 0;
} else {
$USA_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 7200) {
$USA_DST=0; return 0;
} else {
$USA_DST=1; return 1;
}
}
} else {
$USA_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$USA_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$USA_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (7200+($timezone-1)*3600)) {
$USA_DST=1; return 1;
} else {
$USA_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 7200) {
$USA_DST=1; return 1;
} else {
$USA_DST=0; return 0;
}
}
} else {
$USA_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub GBR_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in March and last Sunday in October at 1 am.
#**********************************************************************
$GBR_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$GBR_DST=0; return 0;
} elsif ($mm >= 4 && $mm <= 9) {
$GBR_DST=1; return 1;
} elsif ($mm == 3) {
if ($dd < 25) {
$GBR_DST=0; return 0;
} elsif ($dd < ($dow+25)) {
$GBR_DST=0; return 0;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=0; return 0;
} else {
$GBR_DST=1; return 1;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=0; return 0;
} else {
$GBR_DST=1; return 1;
}
}
} else {
$GBR_DST=1; return 1;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$GBR_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$GBR_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=1; return 1;
} else {
$GBR_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=1; return 1;
} else {
$GBR_DST=0; return 0;
}
}
} else {
$GBR_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub AUS_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUS_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUS_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$AUS_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 25) {
$AUS_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$AUS_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=1; return 1;
} else {
$AUS_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=1; return 1;
} else {
$AUS_DST=0; return 0;
}
}
} else {
$AUS_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$AUS_DST=0; return 0;
} elsif ($dd < ($dow+25)) {
$AUS_DST=0; return 0;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=0; return 0;
} else {
$AUS_DST=1; return 1;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=0; return 0;
} else {
$AUS_DST=1; return 1;
}
}
} else {
$AUS_DST=1; return 1;
}
} # end of month checks
} # end of subroutine dstcalc
sub AUST_dstcalc {
#**********************************************************************
# TASMANIA ONLY
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUST_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUST_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$AUST_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 25) {
$AUST_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$AUST_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUST_DST=1; return 1;
} else {
$AUST_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUST_DST=1; return 1;
} else {
$AUST_DST=0; return 0;
}
}
} else {
$AUST_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd > 7) {
$AUST_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$AUST_DST=0; return 0;
} else {
$AUST_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 3600) {
$AUST_DST=0; return 0;
} else {
$AUST_DST=1; return 1;
}
}
} else {
$AUST_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub NZL_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and third Sunday in March at 1 am.
#**********************************************************************
$NZL_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$NZL_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$NZL_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 14) {
$NZL_DST=1; return 1;
} elsif ($dd < ($dow+14)) {
$NZL_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$NZL_DST=1; return 1;
} else {
$NZL_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$NZL_DST=1; return 1;
} else {
$NZL_DST=0; return 0;
}
}
} else {
$NZL_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd > 7) {
$NZL_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$NZL_DST=0; return 0;
} else {
$NZL_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 3600) {
$NZL_DST=0; return 0;
} else {
$NZL_DST=1; return 1;
}
}
} else {
$NZL_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
+560 -3
View File
@@ -4,6 +4,40 @@
### ###
### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2 ### Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
### ###
#
#
# CHANGES
# 60616-1548 - Added listID override feature to force all leads into same list
# - Added gmt_offset_now lookup for each lead
#
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help|-h/i)
{
print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n";
}
else
{
if ($args =~ /--forcelistid=/i)
{
@data_in = split(/--forcelistid=/,$args);
$forcelistid = $data_in[1];
print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n";
}
else
{$forcelistid = '';}
}
}
### end parsing run-time options ###
use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel;
use Time::Local; use Time::Local;
@@ -22,12 +56,42 @@ $vars=$ARGV[0];
@xls_fields=split(/\,/, $vars); @xls_fields=split(/\,/, $vars);
$|=0; $|=0;
$secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900); $year = ($year + 1900);
$mon++; $mon++;
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
if ($mon < 10) {$mon = "0$mon";} if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";} if ($mday < 10) {$mday = "0$mday";}
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
$pulldate="$year-$mon-$mday $hour:$min:$sec"; $pulldate="$year-$mon-$mday $hour:$min:$sec";
$inSD = $pulldate0;
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
### Grab Server values from the database
$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';";
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$DBSERVER_GMT = "$record->[0]";
if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;}
}
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
if ($isdst) {$LOCAL_GMT_OFF++;}
if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
$total=0; $good=0; $bad=0; $total=0; $good=0; $bad=0;
open(STMT_FILE, "> listloader_stmts.txt"); open(STMT_FILE, "> listloader_stmts.txt");
@@ -49,7 +113,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
$source_id=$source_code; $source_id=$source_code;
$oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]]; $oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]];
if ($oWkC) {$list_id=$oWkC->Value; } if ($oWkC) {$list_id=$oWkC->Value; }
$campaign_id = ''; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]]; $oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]];
if ($oWkC) {$phone_code=$oWkC->Value; } if ($oWkC) {$phone_code=$oWkC->Value; }
@@ -57,6 +121,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
$oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]]; $oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]];
if ($oWkC) {$phone_number=$oWkC->Value; } if ($oWkC) {$phone_number=$oWkC->Value; }
$phone_number=~s/[^0-9]//g; $phone_number=~s/[^0-9]//g;
$USarea = substr($phone_number, 0, 3);
$oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]]; $oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]];
if ($oWkC) {$title=$oWkC->Value; } if ($oWkC) {$title=$oWkC->Value; }
$oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]]; $oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]];
@@ -96,17 +161,160 @@ foreach $oWkS (@{$oBook->{Worksheet}}) {
$comments=~s/^\s*(.*?)\s*$/$1/; $comments=~s/^\s*(.*?)\s*$/$1/;
if (length($phone_number)>8) { if (length($phone_number)>8) {
if (length($forcelistid) > 0)
{
$list_id = $forcelistid; # set list_id to override value
}
$PC_processed=0;
### UNITED STATES ###
if ($phone_code =~ /^1$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### MEXICO ###
if ($phone_code =~ /^52$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### AUSTRALIA ###
if ($phone_code =~ /^61$/)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### ALL OTHER COUNTRY CODES ###
if (!$PC_processed)
{
$stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$dbhA->query($stmtA);
$rec_countW=0;
if ($dbhA->has_selected_record)
{
$iterA=$dbhA->create_record_iterator;
while ($recordA = $iterA->each)
{
$gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi;
$dst = $recordA->[5];
$dst_range = $recordA->[6];
$PC_processed++;
}
}
}
### Find out if DST to raise the gmt offset ###
$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD);
$AC_localtime = ($secX + (3600 * $AC_GMT_diff));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$hour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
$AC_processed=0;
if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) )
{
if ($DBX) {print " First Sunday April to Last Sunday October\n";}
&USA_dstcalc;
if ($DBX) {print " DST: $USA_DST\n";}
if ($USA_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) )
{
if ($DBX) {print " Last Sunday March to Last Sunday October\n";}
&GBR_dstcalc;
if ($DBX) {print " DST: $GBR_DST\n";}
if ($GBR_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) )
{
if ($DBX) {print " Last Sunday October to Last Sunday March\n";}
&AUS_dstcalc;
if ($DBX) {print " DST: $AUS_DST\n";}
if ($AUS_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) )
{
if ($DBX) {print " First Sunday October to Last Sunday March\n";}
&AUST_dstcalc;
if ($DBX) {print " DST: $AUST_DST\n";}
if ($AUST_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) )
{
if ($DBX) {print " First Sunday October to Third Sunday March\n";}
&NZL_dstcalc;
if ($DBX) {print " DST: $NZL_DST\n";}
if ($NZL_DST) {$gmt_offset++;}
$AC_processed++;
}
if (!$AC_processed)
{
if ($DBX) {print " No DST Method Found\n";}
if ($DBX) {print " DST: 0\n";}
$AC_processed++;
}
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$dbhA->query("$stmtZ"); $dbhA->query("$stmtZ");
print STMT_FILE $stmtZ."\r\n"; print STMT_FILE $stmtZ."\r\n";
$multistmt=''; $multistmt='';
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -132,3 +340,352 @@ if ($multi_insert_counter > 0) {
print "<BR><BR>Done</B> GOOD: $good &nbsp; &nbsp; &nbsp; BAD: $bad &nbsp; &nbsp; &nbsp; TOTAL: $total</font></center>"; print "<BR><BR>Done</B> GOOD: $good &nbsp; &nbsp; &nbsp; BAD: $bad &nbsp; &nbsp; &nbsp; TOTAL: $total</font></center>";
exit;
sub USA_dstcalc {
#**********************************************************************
# FSA-LSO
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in April and last Sunday in October at 2 am.
# INPUTS:
# mm INTEGER Month.
# dd INTEGER Day of the month.
# ns INTEGER Seconds into the day.
# dow INTEGER Day of week (0=Sunday, to 6=Saturday)
# OPTIONAL INPUT:
# timezone INTEGER hour difference UTC - local standard time
# (DEFAULT is blank)
# make calculations based on UTC time,
# which means shift at 10:00 UTC in April
# and 9:00 UTC in October
# OUTPUT:
# INTEGER 1 = DST, 0 = not DST
#**********************************************************************
$USA_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 4 || $mm > 10) {
$USA_DST=0; return 0;
} elsif ($mm >= 5 && $mm <= 9) {
$USA_DST=1; return 1;
} elsif ($mm == 4) {
if ($dd > 7) {
$USA_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$USA_DST=0; return 0;
} else {
$USA_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 7200) {
$USA_DST=0; return 0;
} else {
$USA_DST=1; return 1;
}
}
} else {
$USA_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$USA_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$USA_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (7200+($timezone-1)*3600)) {
$USA_DST=1; return 1;
} else {
$USA_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 7200) {
$USA_DST=1; return 1;
} else {
$USA_DST=0; return 0;
}
}
} else {
$USA_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub GBR_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in March and last Sunday in October at 1 am.
#**********************************************************************
$GBR_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$GBR_DST=0; return 0;
} elsif ($mm >= 4 && $mm <= 9) {
$GBR_DST=1; return 1;
} elsif ($mm == 3) {
if ($dd < 25) {
$GBR_DST=0; return 0;
} elsif ($dd < ($dow+25)) {
$GBR_DST=0; return 0;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=0; return 0;
} else {
$GBR_DST=1; return 1;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=0; return 0;
} else {
$GBR_DST=1; return 1;
}
}
} else {
$GBR_DST=1; return 1;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$GBR_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$GBR_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=1; return 1;
} else {
$GBR_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=1; return 1;
} else {
$GBR_DST=0; return 0;
}
}
} else {
$GBR_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub AUS_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUS_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUS_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$AUS_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 25) {
$AUS_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$AUS_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=1; return 1;
} else {
$AUS_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=1; return 1;
} else {
$AUS_DST=0; return 0;
}
}
} else {
$AUS_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd < 25) {
$AUS_DST=0; return 0;
} elsif ($dd < ($dow+25)) {
$AUS_DST=0; return 0;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=0; return 0;
} else {
$AUS_DST=1; return 1;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=0; return 0;
} else {
$AUS_DST=1; return 1;
}
}
} else {
$AUS_DST=1; return 1;
}
} # end of month checks
} # end of subroutine dstcalc
sub AUST_dstcalc {
#**********************************************************************
# TASMANIA ONLY
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUST_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUST_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$AUST_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 25) {
$AUST_DST=1; return 1;
} elsif ($dd < ($dow+25)) {
$AUST_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUST_DST=1; return 1;
} else {
$AUST_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUST_DST=1; return 1;
} else {
$AUST_DST=0; return 0;
}
}
} else {
$AUST_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd > 7) {
$AUST_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$AUST_DST=0; return 0;
} else {
$AUST_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 3600) {
$AUST_DST=0; return 0;
} else {
$AUST_DST=1; return 1;
}
}
} else {
$AUST_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
sub NZL_dstcalc {
#**********************************************************************
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and third Sunday in March at 1 am.
#**********************************************************************
$NZL_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$NZL_DST=1; return 1;
} elsif ($mm >= 4 && $mm <= 9) {
$NZL_DST=0; return 0;
} elsif ($mm == 3) {
if ($dd < 14) {
$NZL_DST=1; return 1;
} elsif ($dd < ($dow+14)) {
$NZL_DST=1; return 1;
} elsif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$NZL_DST=1; return 1;
} else {
$NZL_DST=0; return 0;
}
} else { # local time calculations
if ($ns < 3600) {
$NZL_DST=1; return 1;
} else {
$NZL_DST=0; return 0;
}
}
} else {
$NZL_DST=0; return 0;
}
} elsif ($mm == 10) {
if ($dd > 7) {
$NZL_DST=1; return 1;
} elsif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 && $ns < (7200+$timezone*3600)) {
$NZL_DST=0; return 0;
} else {
$NZL_DST=1; return 1;
}
} else {
if ($dow == 0 && $ns < 3600) {
$NZL_DST=0; return 0;
} else {
$NZL_DST=1; return 1;
}
}
} else {
$NZL_DST=0; return 0;
}
} # end of month checks
} # end of subroutine dstcalc
@@ -10,9 +10,14 @@
# 51128-1108 - Removed PHP global vars requirement # 51128-1108 - Removed PHP global vars requirement
# 60113-1603 - Fixed a few bugs in Excel import # 60113-1603 - Fixed a few bugs in Excel import
# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60616-1240 - added listID override
# 60616-1604 - added gmt lookup for each lead
# #
# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time.
$version = '1.1.12';
$build = '60616-1604';
require("dbconnect.php"); require("dbconnect.php");
@@ -85,11 +90,11 @@ if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["sec
elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];}
if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];}
elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];}
if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];}
elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];}
$list_id_override = (preg_replace("/\D/","",$list_id_override));
# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];}
$version = '1.1.11';
$build = '60421-1624';
$STARTtime = date("U"); $STARTtime = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -153,9 +158,53 @@ $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
$secX = date("U");
$hour = date("H");
$min = date("i");
$sec = date("s");
$mon = date("m");
$mday = date("d");
$year = date("Y");
$isdst = date("I");
$Shour = date("H");
$Smin = date("i");
$Ssec = date("s");
$Smon = date("m");
$Smday = date("d");
$Syear = date("Y");
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
$inSD = $pulldate0;
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
### Grab Server GMT value from the database
$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';";
$rslt=mysql_query($stmt, $link);
$gmt_recs = mysql_num_rows($rslt);
if ($gmt_recs > 0)
{
$row=mysql_fetch_row($rslt);
$DBSERVER_GMT = "$row[0]";
if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;}
if ($isdst) {$SERVER_GMT++;}
}
else
{
$SERVER_GMT = date("O");
$SERVER_GMT = eregi_replace("\+","",$SERVER_GMT);
$SERVER_GMT = ($SERVER_GMT + 0);
$SERVER_GMT = ($SERVER_GMT / 100);
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
echo "<html>\n"; echo "<html>\n";
echo "<head>\n"; echo "<head>\n";
echo "<!-- VERSION: $version BUILD: $build -->\n"; echo "<!-- VERSION: $version BUILD: $build -->\n";
echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF DST: $isdst -->\n";
function macfontfix($fontsize) { function macfontfix($fontsize) {
@@ -222,6 +271,10 @@ function ParseFileName() {
<td align=right width="35%"><B><font face="arial, helvetica" size=2>Load leads from this file:</font></B></td> <td align=right width="35%"><B><font face="arial, helvetica" size=2>Load leads from this file:</font></B></td>
<td align=left width="65%"><input type=file name="leadfile" value="<?=$leadfile ?>"> <? echo "$NWB#vicidial_list_loader$NWE"; ?></td> <td align=left width="65%"><input type=file name="leadfile" value="<?=$leadfile ?>"> <? echo "$NWB#vicidial_list_loader$NWE"; ?></td>
</tr> </tr>
<tr>
<td align=right width="25%"><font face="arial, helvetica" size=2>List ID Override: </font></td>
<td align=left width="75%"><font face="arial, helvetica" size=1><input type=text value="<?=$list_id_override ?>" name='list_id_override' size=10 maxlength=8> (numbers only or leave blank for values in the file)</td>
</tr>
<tr> <tr>
<td align=right><B><font face="arial, helvetica" size=2>File layout to use:</font></B></td> <td align=right><B><font face="arial, helvetica" size=2>File layout to use:</font></B></td>
<td align=left><font face="arial, helvetica" size=2><input type=radio name="file_layout" value="standard" checked>Standard VICIDIAL&nbsp;&nbsp;&nbsp;&nbsp;<input type=radio name="file_layout" value="custom">Custom layout</td> <td align=left><font face="arial, helvetica" size=2><input type=radio name="file_layout" value="standard" checked>Standard VICIDIAL&nbsp;&nbsp;&nbsp;&nbsp;<input type=radio name="file_layout" value="custom">Custom layout</td>
@@ -237,7 +290,7 @@ function ParseFileName() {
<? <?
if ($OK_to_process) { if ($OK_to_process) {
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>"; print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>";
flush(); flush();
$total=0; $good=0; $bad=0; $total=0; $good=0; $bad=0;
@@ -257,6 +310,12 @@ function ParseFileName() {
flush(); flush();
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r");
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file...\n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file...\n";
if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
while (!feof($file)) { while (!feof($file)) {
$record++; $record++;
$buffer=rtrim(fgets($file, 4096)); $buffer=rtrim(fgets($file, 4096));
@@ -274,10 +333,11 @@ function ParseFileName() {
$source_code = $row[$source_id_field]; $source_code = $row[$source_id_field];
$source_id=$source_code; $source_id=$source_code;
$list_id = $row[$list_id_field]; $list_id = $row[$list_id_field];
$campaign_id = ''; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]);
$phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]);
$USarea = substr($phone_number, 0, 3);
$title = $row[$title_field]; $title = $row[$title_field];
$first_name = $row[$first_name_field]; $first_name = $row[$first_name_field];
$middle_initial = $row[$middle_initial_field]; $middle_initial = $row[$middle_initial_field];
@@ -299,9 +359,18 @@ function ParseFileName() {
if (strlen($phone_number)>8) { if (strlen($phone_number)>8) {
if (strlen($list_id_override)>0)
{
# print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
$list_id = $list_id_override;
}
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear);
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$rslt=mysql_query($stmtZ, $link); $rslt=mysql_query($stmtZ, $link);
if ($WeBRooTWritablE > 0) if ($WeBRooTWritablE > 0)
{fwrite($stmt_file, $stmtZ."\r\n");} {fwrite($stmt_file, $stmtZ."\r\n");}
@@ -309,7 +378,7 @@ function ParseFileName() {
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -343,14 +412,22 @@ function ParseFileName() {
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r");
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing Excel file... \n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing Excel file... \n";
# print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; if (strlen($list_id_override)>0)
passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"); {
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>\n";
}
# print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field";
passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override");
} else { } else {
# copy($leadfile, "./vicidial_temp_file.csv"); # copy($leadfile, "./vicidial_temp_file.csv");
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r");
$stmt_file=fopen("listloader_stmts.txt", "w"); $stmt_file=fopen("listloader_stmts.txt", "w");
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n";
if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
while($row=fgetcsv($file, 1000, ",")) { while($row=fgetcsv($file, 1000, ",")) {
@@ -363,10 +440,11 @@ function ParseFileName() {
$source_code = $row[$source_id_field]; $source_code = $row[$source_id_field];
$source_id=$source_code; $source_id=$source_code;
$list_id = $row[$list_id_field]; $list_id = $row[$list_id_field];
$campaign_id = ''; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]);
$phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]);
$USarea = substr($phone_number, 0, 3);
$title = $row[$title_field]; $title = $row[$title_field];
$first_name = $row[$first_name_field]; $first_name = $row[$first_name_field];
$middle_initial = $row[$middle_initial_field]; $middle_initial = $row[$middle_initial_field];
@@ -387,9 +465,19 @@ function ParseFileName() {
$comments = trim($row[$comments_field]); $comments = trim($row[$comments_field]);
if (strlen($phone_number)>8) { if (strlen($phone_number)>8) {
if (strlen($list_id_override)>0)
{
# print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
$list_id = $list_id_override;
}
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear);
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$rslt=mysql_query($stmtZ, $link); $rslt=mysql_query($stmtZ, $link);
if ($WeBRooTWritablE > 0) if ($WeBRooTWritablE > 0)
{fwrite($stmt_file, $stmtZ."\r\n");} {fwrite($stmt_file, $stmtZ."\r\n");}
@@ -397,7 +485,7 @@ function ParseFileName() {
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -450,7 +538,11 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r");
$total=0; $good=0; $bad=0; $total=0; $good=0; $bad=0;
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n";
while (!feof($file)) { if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
while (!feof($file)) {
$record++; $record++;
$buffer=rtrim(fgets($file, 4096)); $buffer=rtrim(fgets($file, 4096));
$buffer=stripslashes($buffer); $buffer=stripslashes($buffer);
@@ -467,10 +559,11 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$source_code = $row[1]; $source_code = $row[1];
$source_id=$source_code; $source_id=$source_code;
$list_id = $row[2]; $list_id = $row[2];
$campaign_id = ''; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_code = eregi_replace("[^0-9]", "", $row[3]);
$phone_number = eregi_replace("[^0-9]", "", $row[4]); $phone_number = eregi_replace("[^0-9]", "", $row[4]);
$USarea = substr($phone_number, 0, 3);
$title = $row[5]; $title = $row[5];
$first_name = $row[6]; $first_name = $row[6];
$middle_initial = $row[7]; $middle_initial = $row[7];
@@ -492,9 +585,18 @@ if ($leadfile && filesize($LF_path)<=8388608) {
if (strlen($phone_number)>8) { if (strlen($phone_number)>8) {
if (strlen($list_id_override)>0)
{
# print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
$list_id = $list_id_override;
}
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear);
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$rslt=mysql_query($stmtZ, $link); $rslt=mysql_query($stmtZ, $link);
if ($WeBRooTWritablE > 0) if ($WeBRooTWritablE > 0)
{fwrite($stmt_file, $stmtZ."\r\n");} {fwrite($stmt_file, $stmtZ."\r\n");}
@@ -502,7 +604,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -535,7 +637,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls");
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r");
passthru("$WeBServeRRooT/vicidial/listloader.pl"); passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override");
} else { } else {
copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv");
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r");
@@ -543,6 +645,11 @@ if ($leadfile && filesize($LF_path)<=8388608) {
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n";
if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
while($row=fgetcsv($file, 1000, ",")) { while($row=fgetcsv($file, 1000, ",")) {
$pulldate=date("Y-m-d H:i:s"); $pulldate=date("Y-m-d H:i:s");
$entry_date = "$pulldate"; $entry_date = "$pulldate";
@@ -553,10 +660,11 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$source_code = $row[1]; $source_code = $row[1];
$source_id=$source_code; $source_id=$source_code;
$list_id = $row[2]; $list_id = $row[2];
$campaign_id = ''; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_code = eregi_replace("[^0-9]", "", $row[3]);
$phone_number = eregi_replace("[^0-9]", "", $row[4]); $phone_number = eregi_replace("[^0-9]", "", $row[4]);
$USarea = substr($phone_number, 0, 3);
$title = $row[5]; $title = $row[5];
$first_name = $row[6]; $first_name = $row[6];
$middle_initial = $row[7]; $middle_initial = $row[7];
@@ -577,9 +685,19 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$comments = trim($row[22]); $comments = trim($row[22]);
if (strlen($phone_number)>8) { if (strlen($phone_number)>8) {
if (strlen($list_id_override)>0)
{
# print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
$list_id = $list_id_override;
}
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear);
if ($multi_insert_counter > 8) { if ($multi_insert_counter > 8) {
### insert good deal into pending_transactions table ### ### insert good deal into pending_transactions table ###
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);";
$rslt=mysql_query($stmtZ, $link); $rslt=mysql_query($stmtZ, $link);
if ($WeBRooTWritablE > 0) if ($WeBRooTWritablE > 0)
{fwrite($stmt_file, $stmtZ."\r\n");} {fwrite($stmt_file, $stmtZ."\r\n");}
@@ -587,7 +705,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$multi_insert_counter=0; $multi_insert_counter=0;
} else { } else {
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),";
$multi_insert_counter++; $multi_insert_counter++;
} }
@@ -624,7 +742,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
print " <th><font class='standard' color='white'>File data</font></th>\r\n"; print " <th><font class='standard' color='white'>File data</font></th>\r\n";
print " </tr>\r\n"; print " </tr>\r\n";
$tbl_rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link);
if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) {
@@ -642,15 +760,19 @@ if ($leadfile && filesize($LF_path)<=8388608) {
$file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r");
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file...\n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file...\n";
if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
$buffer=rtrim(fgets($file, 4096)); $buffer=rtrim(fgets($file, 4096));
$buffer=stripslashes($buffer); $buffer=stripslashes($buffer);
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer));
for ($i=0; $i<mysql_num_fields($tbl_rslt); $i++) { for ($i=0; $i<mysql_num_fields($rslt); $i++) {
print " <tr bgcolor=#D9E6FE>\r\n"; print " <tr bgcolor=#D9E6FE>\r\n";
print " <td align=right><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($tbl_rslt, $i))).": </font></td>\r\n"; print " <td align=right><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n";
print " <td align=center><select name='".mysql_field_name($tbl_rslt, $i)."_field'>\r\n"; print " <td align=center><select name='".mysql_field_name($rslt, $i)."_field'>\r\n";
print " <option value='-1'>(none)</option>\r\n"; print " <option value='-1'>(none)</option>\r\n";
for ($j=0; $j<count($row); $j++) { for ($j=0; $j<count($row); $j++) {
@@ -672,7 +794,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
#print " <option value='vendor_lead_code'>Vendor lead code</option>\r\n"; #print " <option value='vendor_lead_code'>Vendor lead code</option>\r\n";
#print " <option value='source_id'>Source ID</option>\r\n"; #print " <option value='source_id'>Source ID</option>\r\n";
#print " <option value='list_id'>List ID</option>\r\n"; #print " <option value='list_id'>List ID</option>\r\n";
#print " <option value='campaign_id'>Campaign ID</option>\r\n"; #print " <option value='gmt_offset'>Campaign ID</option>\r\n";
#print " <option value='called_since_last_reset'>Called since last reset</option>\r\n"; #print " <option value='called_since_last_reset'>Called since last reset</option>\r\n";
#print " <option value='phone_code'>Phone code</option>\r\n"; #print " <option value='phone_code'>Phone code</option>\r\n";
#print " <option value='phone_number'>Phone number</option>\r\n"; #print " <option value='phone_number'>Phone number</option>\r\n";
@@ -707,12 +829,17 @@ if ($leadfile && filesize($LF_path)<=8388608) {
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n"; print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n";
if (strlen($list_id_override)>0)
{
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
}
$total=0; $good=0; $bad=0; $total=0; $good=0; $bad=0;
$row=fgetcsv($file, 1000, ","); $row=fgetcsv($file, 1000, ",");
for ($i=0; $i<mysql_num_fields($tbl_rslt); $i++) { for ($i=0; $i<mysql_num_fields($rslt); $i++) {
print " <tr bgcolor=#D9E6FE>\r\n"; print " <tr bgcolor=#D9E6FE>\r\n";
print " <td align=right><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($tbl_rslt, $i))).": </font></td>\r\n"; print " <td align=right><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n";
print " <td align=center><select name='".mysql_field_name($tbl_rslt, $i)."_field'>\r\n"; print " <td align=center><select name='".mysql_field_name($rslt, $i)."_field'>\r\n";
print " <option value='-1'>(none)</option>\r\n"; print " <option value='-1'>(none)</option>\r\n";
for ($j=0; $j<count($row); $j++) { for ($j=0; $j<count($row); $j++) {
@@ -734,7 +861,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
#print " <option value='vendor_lead_code'>Vendor lead code</option>\r\n"; #print " <option value='vendor_lead_code'>Vendor lead code</option>\r\n";
#print " <option value='source_id'>Source ID</option>\r\n"; #print " <option value='source_id'>Source ID</option>\r\n";
#print " <option value='list_id'>List ID</option>\r\n"; #print " <option value='list_id'>List ID</option>\r\n";
#print " <option value='campaign_id'>Campaign ID</option>\r\n"; #print " <option value='gmt_offset'>Campaign ID</option>\r\n";
#print " <option value='called_since_last_reset'>Called since last reset</option>\r\n"; #print " <option value='called_since_last_reset'>Called since last reset</option>\r\n";
#print " <option value='phone_code'>Phone code</option>\r\n"; #print " <option value='phone_code'>Phone code</option>\r\n";
#print " <option value='phone_number'>Phone number</option>\r\n"; #print " <option value='phone_number'>Phone number</option>\r\n";
@@ -761,6 +888,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
} }
} }
print " <tr bgcolor='#330099'>\r\n"; print " <tr bgcolor='#330099'>\r\n";
print " <input type=hidden name=list_id_override value=\"$list_id_override\">\r\n";
print " <th colspan=2><input type=submit name='OK_to_process' value='OK TO PROCESS'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button onClick=\"javascript:document.location='new_listloader_superL.php'\" value=\"START OVER\" name='reload_page'></th>\r\n"; print " <th colspan=2><input type=submit name='OK_to_process' value='OK TO PROCESS'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button onClick=\"javascript:document.location='new_listloader_superL.php'\" value=\"START OVER\" name='reload_page'></th>\r\n";
print " </tr>\r\n"; print " </tr>\r\n";
print "</table>\r\n"; print "</table>\r\n";
@@ -774,3 +902,456 @@ if ($leadfile && filesize($LF_path)<=8388608) {
</form> </form>
</body> </body>
</html> </html>
<?
exit;
function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear)
{
require("dbconnect.php");
$PC_processed=0;
### UNITED STATES ###
if ($phone_code =='1')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### MEXICO ###
if ($phone_code =='52')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### AUSTRALIA ###
if ($phone_code =='61')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### ALL OTHER COUNTRY CODES ###
if (!$PC_processed)
{
$PC_processed++;
$stmt="select * from vicidial_phone_codes where country_code='$phone_code';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
}
}
### Find out if DST to raise the gmt offset ###
$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD);
$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear);
$hour = date("H",$AC_localtime);
$min = date("i",$AC_localtime);
$sec = date("s",$AC_localtime);
$mon = date("m",$AC_localtime);
$mday = date("d",$AC_localtime);
$wday = date("w",$AC_localtime);
$year = date("Y",$AC_localtime);
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
$AC_processed=0;
if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') )
{
if ($DBX) {print " First Sunday April to Last Sunday October\n";}
#**********************************************************************
# FSA-LSO
# This is returns 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in April and last Sunday in October at 2 am.
# INPUTS:
# mm INTEGER Month.
# dd INTEGER Day of the month.
# ns INTEGER Seconds into the day.
# dow INTEGER Day of week (0=Sunday, to 6=Saturday)
# OPTIONAL INPUT:
# timezone INTEGER hour difference UTC - local standard time
# (DEFAULT is blank)
# make calculations based on UTC time,
# which means shift at 10:00 UTC in April
# and 9:00 UTC in October
# OUTPUT:
# INTEGER 1 = DST, 0 = not DST
#**********************************************************************
$USA_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 4 || $mm > 10) {
$USA_DST=0;
} elseif ($mm >= 5 and $mm <= 9) {
$USA_DST=1;
} elseif ($mm == 4) {
if ($dd > 7) {
$USA_DST=1;
} elseif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
$USA_DST=0;
} else {
$USA_DST=1;
}
} else {
if ($dow == 0 and $ns < 7200) {
$USA_DST=0;
} else {
$USA_DST=1;
}
}
} else {
$USA_DST=0;
}
} elseif ($mm == 10) {
if ($dd < 25) {
$USA_DST=1;
} elseif ($dd < ($dow+25)) {
$USA_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (7200+($timezone-1)*3600)) {
$USA_DST=1;
} else {
$USA_DST=0;
}
} else { # local time calculations
if ($ns < 7200) {
$USA_DST=1;
} else {
$USA_DST=0;
}
}
} else {
$USA_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $USA_DST\n";}
if ($USA_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') )
{
if ($DBX) {print " Last Sunday March to Last Sunday October\n";}
#**********************************************************************
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in March and last Sunday in October at 1 am.
#**********************************************************************
$GBR_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$GBR_DST=0;
} elseif ($mm >= 4 and $mm <= 9) {
$GBR_DST=1;
} elseif ($mm == 3) {
if ($dd < 25) {
$GBR_DST=0;
} elseif ($dd < ($dow+25)) {
$GBR_DST=0;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=0;
} else {
$GBR_DST=1;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=0;
} else {
$GBR_DST=1;
}
}
} else {
$GBR_DST=1;
}
} elseif ($mm == 10) {
if ($dd < 25) {
$GBR_DST=1;
} elseif ($dd < ($dow+25)) {
$GBR_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$GBR_DST=1;
} else {
$GBR_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$GBR_DST=1;
} else {
$GBR_DST=0;
}
}
} else {
$GBR_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $GBR_DST\n";}
if ($GBR_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') )
{
if ($DBX) {print " Last Sunday October to Last Sunday March\n";}
#**********************************************************************
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on last Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUS_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUS_DST=1;
} elseif ($mm >= 4 and $mm <= 9) {
$AUS_DST=0;
} elseif ($mm == 3) {
if ($dd < 25) {
$AUS_DST=1;
} elseif ($dd < ($dow+25)) {
$AUS_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=1;
} else {
$AUS_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=1;
} else {
$AUS_DST=0;
}
}
} else {
$AUS_DST=0;
}
} elseif ($mm == 10) {
if ($dd < 25) {
$AUS_DST=0;
} elseif ($dd < ($dow+25)) {
$AUS_DST=0;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUS_DST=0;
} else {
$AUS_DST=1;
}
} else { # local time calculations
if ($ns < 3600) {
$AUS_DST=0;
} else {
$AUS_DST=1;
}
}
} else {
$AUS_DST=1;
}
} # end of month checks
if ($DBX) {print " DST: $AUS_DST\n";}
if ($AUS_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') )
{
if ($DBX) {print " First Sunday October to Last Sunday March\n";}
#**********************************************************************
# TASMANIA ONLY
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and last Sunday in March at 1 am.
#**********************************************************************
$AUST_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$AUST_DST=1;
} elseif ($mm >= 4 and $mm <= 9) {
$AUST_DST=0;
} elseif ($mm == 3) {
if ($dd < 25) {
$AUST_DST=1;
} elseif ($dd < ($dow+25)) {
$AUST_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$AUST_DST=1;
} else {
$AUST_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$AUST_DST=1;
} else {
$AUST_DST=0;
}
}
} else {
$AUST_DST=0;
}
} elseif ($mm == 10) {
if ($dd > 7) {
$AUST_DST=1;
} elseif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
$AUST_DST=0;
} else {
$AUST_DST=1;
}
} else {
if ($dow == 0 and $ns < 3600) {
$AUST_DST=0;
} else {
$AUST_DST=1;
}
}
} else {
$AUST_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $AUST_DST\n";}
if ($AUST_DST) {$gmt_offset++;}
$AC_processed++;
}
if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') )
{
if ($DBX) {print " First Sunday October to Third Sunday March\n";}
#**********************************************************************
# This is s 1 if Daylight Savings Time is in effect and 0 if
# Standard time is in effect.
# Based on first Sunday in October and third Sunday in March at 1 am.
#**********************************************************************
$NZL_DST=0;
$mm = $mon;
$dd = $mday;
$ns = $dsec;
$dow= $wday;
if ($mm < 3 || $mm > 10) {
$NZL_DST=1;
} elseif ($mm >= 4 and $mm <= 9) {
$NZL_DST=0;
} elseif ($mm == 3) {
if ($dd < 14) {
$NZL_DST=1;
} elseif ($dd < ($dow+14)) {
$NZL_DST=1;
} elseif ($dow == 0) {
if ($timezone) { # UTC calculations
if ($ns < (3600+($timezone-1)*3600)) {
$NZL_DST=1;
} else {
$NZL_DST=0;
}
} else { # local time calculations
if ($ns < 3600) {
$NZL_DST=1;
} else {
$NZL_DST=0;
}
}
} else {
$NZL_DST=0;
}
} elseif ($mm == 10) {
if ($dd > 7) {
$NZL_DST=1;
} elseif ($dd >= ($dow+1)) {
if ($timezone) {
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
$NZL_DST=0;
} else {
$NZL_DST=1;
}
} else {
if ($dow == 0 and $ns < 3600) {
$NZL_DST=0;
} else {
$NZL_DST=1;
}
}
} else {
$NZL_DST=0;
}
} # end of month checks
if ($DBX) {print " DST: $NZL_DST\n";}
if ($NZL_DST) {$gmt_offset++;}
$AC_processed++;
}
if (!$AC_processed)
{
if ($DBX) {print " No DST Method Found\n";}
if ($DBX) {print " DST: 0\n";}
$AC_processed++;
}
return $gmt_offset;
}
+3 -3
View File
@@ -256,13 +256,13 @@ else
echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n";
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status"; $stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$statuses_to_print = mysql_num_rows($rsltx); $statuses_to_print = mysql_num_rows($rslt);
$statuses_list=''; $statuses_list='';
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
+9 -9
View File
@@ -166,28 +166,28 @@ if (strlen($ADD)>4)
{ {
##### get server listing for dynamic pulldown ##### get server listing for dynamic pulldown
$stmt="SELECT server_ip,server_description from servers order by server_ip"; $stmt="SELECT server_ip,server_description from servers order by server_ip";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$servers_to_print = mysql_num_rows($rsltx); $servers_to_print = mysql_num_rows($rslt);
$servers_list=''; $servers_list='';
$o=0; $o=0;
while ($servers_to_print > $o) while ($servers_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
##### get campaigns listing for dynamic pulldown ##### get campaigns listing for dynamic pulldown
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rsltx); $campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list=''; $campaigns_list='';
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++; $o++;
} }
@@ -204,15 +204,15 @@ if (strlen($ADD)>4)
} }
$stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$groups_to_print = mysql_num_rows($rsltx); $groups_to_print = mysql_num_rows($rslt);
$groups_list=''; $groups_list='';
$groups_value=''; $groups_value='';
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$group_id_value = $rowx[0]; $group_id_value = $rowx[0];
$group_name_value = $rowx[1]; $group_name_value = $rowx[1];
$groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\"";
+2 -2
View File
@@ -363,8 +363,8 @@ else
while ($favorites_count > $o) while ($favorites_count > $o)
{ {
$stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
$favorites_names[$o] = $rowx[0]; $favorites_names[$o] = $rowx[0];
$favorites_listX .= "$rowx[1]/$favorites[$o],"; $favorites_listX .= "$rowx[1]/$favorites[$o],";
$o++; $o++;
+56 -28
View File
@@ -66,7 +66,7 @@
# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) # - $CallBackDatETimE - ('2006-04-21 14:30:00',...)
# - $recipient - ('ANYONE,'USERONLY') # - $recipient - ('ANYONE,'USERONLY')
# - $callback_id - ('12345','12346',...) # - $callback_id - ('12345','12346',...)
# # - $use_internal_dnc - ('Y','N')
# changes # changes
# 50629-1044 - First build of script # 50629-1044 - First build of script
@@ -101,10 +101,11 @@
# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE # 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE
# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60427-1236 - Fixed closer_choice error for CLOSER campaigns # 60427-1236 - Fixed closer_choice error for CLOSER campaigns
# 60609-1148 - Added ability to check for manual dial numbers in DNC
# #
$version = '0.0.31'; $version = '0.0.32';
$build = '60427-1236'; $build = '60609-1148';
require("dbconnect.php"); require("dbconnect.php");
@@ -368,40 +369,56 @@ if ($ACTION == 'manDiaLnextCaLL')
{ {
if (strlen($phone_number)>3) if (strlen($phone_number)>3)
{ {
if ($stage=='lookup') if ($use_internal_dnc=='Y')
{ {
$stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$man_leadID_ct = mysql_num_rows($rslt); $row=mysql_fetch_row($rslt);
if ($man_leadID_ct > 0)
if ($row[0] > 0)
{ {
$row=mysql_fetch_row($rslt); echo "DNC NUMBER\n";
$affected_rows=1; exit;
$lead_id =$row[0];
$CBleadIDset=1;
} }
else else
{ {
### insert a new lead in the system with this phone number if ($stage=='lookup')
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; {
if ($DB) {echo "$stmt\n";} $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link); if ($DB) {echo "$stmt\n";}
$lead_id = mysql_insert_id(); $man_leadID_ct = mysql_num_rows($rslt);
$CBleadIDset=1; if ($man_leadID_ct > 0)
{
$row=mysql_fetch_row($rslt);
$affected_rows=1;
$lead_id =$row[0];
$CBleadIDset=1;
}
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
}
}
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
}
} }
} }
else
{
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$lead_id = mysql_insert_id();
$CBleadIDset=1;
}
} }
else else
{ {
@@ -1254,6 +1271,17 @@ if ($ACTION == 'updateDISPO')
$stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') )
{
$stmt = "select phone_number from vicidial_list where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
}
} }
$dispo_sec=0; $dispo_sec=0;
+16 -10
View File
@@ -109,6 +109,7 @@
# - Fixed recording filename display to not overrun 25 characters # - Fixed recording filename display to not overrun 25 characters
# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo # 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo
# 60608-1453 - Added CLOSER campaign allowable in-groups limitations # 60608-1453 - Added CLOSER campaign allowable in-groups limitations
# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -145,8 +146,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];}
$forever_stop=0; $forever_stop=0;
$version = '1.1.83'; $version = '1.1.84';
$build = '60608-1453'; $build = '60609-1123';
if ($force_logout) if ($force_logout)
{ {
@@ -212,13 +213,13 @@ $camp_form_code = "<select size=1 name=VD_campaign>\n";
$camp_form_code .= "<option value=\"\"></option>\n"; $camp_form_code .= "<option value=\"\"></option>\n";
$stmt="SELECT campaign_id from vicidial_campaigns where active='Y' order by campaign_id"; $stmt="SELECT campaign_id from vicidial_campaigns where active='Y' order by campaign_id";
$rsltx=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rsltx); $camps_to_print = mysql_num_rows($rslt);
$o=0; $o=0;
while ($camps_to_print > $o) while ($camps_to_print > $o)
{ {
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rslt);
if ($VD_campaign) if ($VD_campaign)
{ {
if (eregi("$VD_campaign",$rowx[0])) if (eregi("$VD_campaign",$rowx[0]))
@@ -501,7 +502,7 @@ $VDloginDISPLAY=0;
$HKstatusnames = substr("$HKstatusnames", 0, -1); $HKstatusnames = substr("$HKstatusnames", 0, -1);
##### grab the statuses to be dialed for your campaign as well as other campaign settings ##### grab the statuses to be dialed for your campaign as well as other campaign settings
$stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
@@ -534,6 +535,7 @@ $VDloginDISPLAY=0;
$wrapup_seconds=$row[26]; $wrapup_seconds=$row[26];
$wrapup_message=$row[27]; $wrapup_message=$row[27];
$closer_campaigns=$row[28]; $closer_campaigns=$row[28];
$use_internal_dnc=$row[29];
if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') )
{$scheduled_callbacks='1';} {$scheduled_callbacks='1';}
@@ -1326,6 +1328,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var wrapup_message = '<? echo $wrapup_message ?>' var wrapup_message = '<? echo $wrapup_message ?>'
var wrapup_counter = 0; var wrapup_counter = 0;
var wrapup_waiting = 0; var wrapup_waiting = 0;
var use_internal_dnc = '<? echo $use_internal_dnc ?>'
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>"; var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\"Pause\"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">"; var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\"Pause\"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">"; var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
@@ -2548,7 +2551,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
} }
if (xmlhttp) if (xmlhttp)
{ {
manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE ; manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc ;
xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(manDiaLnext_query); xmlhttp.send(manDiaLnext_query);
@@ -2562,9 +2565,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var MDnextResponse_array=MDnextResponse.split("\n"); var MDnextResponse_array=MDnextResponse.split("\n");
MDnextCID = MDnextResponse_array[0]; MDnextCID = MDnextResponse_array[0];
if (MDnextCID == "HOPPER EMPTY") if ( (MDnextCID == "HOPPER EMPTY") || (MDnextCID == "DNC NUMBER") )
{ {
alert("No more leads in the hopper for campaign:\n" + campaign); if (MDnextCID == "HOPPER EMPTY")
{alert("No more leads in the hopper for campaign:\n" + campaign);}
else
{alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR);}
} }
else else
{ {
@@ -3784,7 +3790,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
} }
if (xmlhttp) if (xmlhttp)
{ {
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&comments=" + CallBackCommenTs; DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&comments=" + CallBackCommenTs;
xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(DSupdate_query); xmlhttp.send(DSupdate_query);
+2 -2
View File
@@ -375,12 +375,12 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR> <BR>
<A NAME="phones-login"> <A NAME="phones-login">
<BR> <BR>
<B>Login -</B> The login used for the phone user to get to admin functions. <B>Login -</B> The login used for the phone user to login to the client applications.
<BR> <BR>
<A NAME="phones-pass"> <A NAME="phones-pass">
<BR> <BR>
<B>Password -</B> The password used for the phone user to get to admin functions. <B>Password -</B> The password used for the phone user to login to the client applications.
<BR> <BR>
<A NAME="phones-status"> <A NAME="phones-status">
+25 -8
View File
@@ -23,8 +23,8 @@ tested it in production yet.
If you want to use app_conference instead of meetme for VICIDIAL then follow these instructions: If you want to use app_conference instead of meetme for VICIDIAL then follow these instructions:
cd /usr/src/asterisk cd /usr/src/asterisk
wget http://www.eflo.net/files/VD_app_conference_0.5.zip wget http://www.eflo.net/files/VD_app_conference_0.6.zip
unzip VD_app_conference_0.5.zip unzip VD_app_conference_0.6.zip
cd app_conference cd app_conference
make clean make clean
make make
@@ -34,25 +34,25 @@ make install
In your extensions.conf file you would replace these lines: In your extensions.conf file you would replace these lines:
exten => 8600051,1,Meetme,8600051 exten => 8600051,1,Meetme,8600051
exten => 8600052,1,Meetme,8600052 exten => 8600052,1,Meetme,8600052
... ...continue through 8600100...
exten => 78600051,1,Meetme,8600051|q exten => 78600051,1,Meetme,8600051|q
exten => 78600052,1,Meetme,8600052|q exten => 78600052,1,Meetme,8600052|q
... ...continue through 78600100...
exten => 68600051,1,Meetme,8600051|mq exten => 68600051,1,Meetme,8600051|mq
exten => 68600052,1,Meetme,8600052|mq exten => 68600052,1,Meetme,8600052|mq
... ...continue through 68600100...
with these lines: with these lines:
exten => 8600051,1,Conference(8600051) exten => 8600051,1,Conference(8600051)
exten => 8600052,1,Conference(8600052) exten => 8600052,1,Conference(8600052)
... ...continue through 8600100...
exten => 78600051,1,Conference(8600051|q) exten => 78600051,1,Conference(8600051|q)
exten => 78600052,1,Conference(8600052|q) exten => 78600052,1,Conference(8600052|q)
... ...continue through 78600100...
exten => 68600051,1,Conference(8600051|Lq) exten => 68600051,1,Conference(8600051|Lq)
exten => 68600052,1,Conference(8600052|Lq) exten => 68600052,1,Conference(8600052|Lq)
...continue through 68600100...
NOTES: NOTES:
Here are the possible feature flags for this version of app_conference: Here are the possible feature flags for this version of app_conference:
@@ -67,3 +67,20 @@ Here are the possible feature flags for this version of app_conference:
o i: use inband dtmf broadcast. o i: use inband dtmf broadcast.
o t: use rfc dtmf signal broadcast. o t: use rfc dtmf signal broadcast.
COMPILE NOTES:
Some Makefile alterations may be necessary for your system:
From Alek Barkley:
I am running FC4 with latest updates ( 2.6.16 kernel )
My CPU is AMD K6 and GCC 4.0.2.
I edited Makefile in app_conference distribution.
To enter CPU architecture in my case -march=k6
========================================================
PROC = k6
# this is fun for x86
#CFLAGS += -march=pentium3 -msse -mfpmath=sse,387
CFLAGS += -march=k6
===========================================================
+7 -3
View File
@@ -1,5 +1,5 @@
+------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+
| Asterisk GUI client - astguiclient - twenty-fourth public release 1.1.12 | | Asterisk GUI client - astguiclient - twenty-fifth public release 1.1.12 |
| created by astGUIclient group <astguiclient@eflo.net> | | created by astGUIclient group <astguiclient@eflo.net> |
| project started 2003-10-06 http://sourceforge.net/projects/astguiclient/ | | project started 2003-10-06 http://sourceforge.net/projects/astguiclient/ |
+------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+
@@ -681,13 +681,17 @@ UPGRADE NOTES:
* if upgrading from 1.1.10 run the upgrade_1.1.11.sql script in MySQL * if upgrading from 1.1.10 run the upgrade_1.1.11.sql script in MySQL
(\. /home/cron/astguiclient/upgrade_1.1.11.sql) (\. /home/cron/astguiclient/upgrade_1.1.11.sql)
1.1.12 - Twenty-Fifth public release - 2006-0X-XX 1.1.12 - Twenty-Fifth public release - 2006-06-XX
- Completely redesigned local call time system in VICIDIAL for more flexibility - Completely redesigned local call time system in VICIDIAL for more flexibility
- Added Drop-call and safe-harbor campaign and inbound options - Added Drop-call and safe-harbor campaign and inbound options
- Added option for allowing wrapup time between calls in vicidial.php - Added option for allowing wrapup time between calls in vicidial.php
- Multi-language translation rewritten for more flexibility and easy of use - Multi-language translation rewritten for more flexibility and easy of use
- Added more user-permission options/restrictions for both agents and admins - Added more user-permission options/restrictions for both agents and admins
- Many other small changes listed in the TODO.txt file - Added option of using app_conference instead of meetme engine
- Added internal DNC list for Do-Not-Call entries across the system
- Added automatic lead recycling to call back Busy calls at definable intervals
- Added listID override and timezone lookup to all lead importing scripts
- Many other changes and bug fixes listed in the TODO.txt file
UPGRADE NOTES: UPGRADE NOTES:
* if upgrading from 1.1.11 you need to: * if upgrading from 1.1.11 you need to:
- download the new version from the project website - download the new version from the project website
+1
View File
@@ -7,6 +7,7 @@ Requirements for installing astGUIclient/VICIDIAL on an Asterisk server:
- Zap trunks(T1/E1 or PSTN lines), IAX2 trunks or SIP trunks required - Zap trunks(T1/E1 or PSTN lines), IAX2 trunks or SIP trunks required
- If using VOIP trunks and VICIDIAL auto-dial, you must have trunks registered - If using VOIP trunks and VICIDIAL auto-dial, you must have trunks registered
- You must have a zaptel timer like a PSTN/T1/E1 card or ztdummy - You must have a zaptel timer like a PSTN/T1/E1 card or ztdummy
or you can use the experimental app_conference module
- Client phones can be SIP/IAX/Zap - Client phones can be SIP/IAX/Zap
- In extensions.conf you must use the 'o' Dial flag on your outbound extensions - In extensions.conf you must use the 'o' Dial flag on your outbound extensions
- In extensions.conf you must have thee following line in your default context: - In extensions.conf you must have thee following line in your default context:
+43 -25
View File
@@ -314,12 +314,30 @@ in and out as separate files
- you are done - you are done
LAME is an MP3 encoder used to convert audio files from WAV to MP3. We prefer GSM
usually, but some users have standardized on MP3 so they would need this utility
to be loaded to use that option.
*OPTIONAL*
2. Go to http://lame.sourceforge.net/ and download the lame package
- to install this directly on the command line type:
- cd /usr/local
-wget http://umn.dl.sourceforge.net/sourceforge/lame/lame-3.96.1.tar.gz
-gunzip lame-3.96.1.tar.gz
-tar xvf lame-3.96.1.tar
-cd lame-3.96.1
-./configure
-make
-make install
- you are done
mpg123 is the mp3 player for asterisk and is used for music-on-hold mpg123 is the mp3 player for asterisk and is used for music-on-hold
applications. We do not usually use it on our system, but to be more applications. We do not usually use it on our system, but to be more
comprehensive we will give the directions to install it. comprehensive we will give the directions to install it.
*OPTIONAL* (only if you want to use Astrisk's music-on-hold) *OPTIONAL* (only if you want to use Astrisk's music-on-hold)
2. Go to http://www.mpg123.de/ and download the mpg123 package 3. Go to http://www.mpg123.de/ and download the mpg123 package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz - wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
@@ -340,7 +358,7 @@ the ability to log output and still attach to the screen that executed asterisk
originally. originally.
*REQUIRED* *REQUIRED*
3. Go to http://www.gnu.org/software/screen/ and download the screen package 4. Go to http://www.gnu.org/software/screen/ and download the screen package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://ftp.gnu.org/gnu/screen/screen-4.0.2.tar.gz - wget http://ftp.gnu.org/gnu/screen/screen-4.0.2.tar.gz
@@ -360,7 +378,7 @@ graphical time-based scrolling graph. We use it to view how loaded the system is
and it visualizes load spikes very well and it visualizes load spikes very well
*OPTIONAL* (only for obsessive admins like me) *OPTIONAL* (only for obsessive admins like me)
4. Go to http://www.daveltd.com/src/util/ttyload/ and download the ttyload 5. Go to http://www.daveltd.com/src/util/ttyload/ and download the ttyload
package package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
@@ -378,7 +396,7 @@ with the time of a master server somewhere in the world. We use it to make sure
the time is the same on our client computers and our servers. the time is the same on our client computers and our servers.
*MANDITORY FOR VICIDIAL USERS* (install on server and all clients) *MANDITORY FOR VICIDIAL USERS* (install on server and all clients)
5. Go to http://www.ntp.org/ and download the ntpd package 6. Go to http://www.ntp.org/ and download the ntpd package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-stable-4.2.0a-20060224.tar.gz - wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-stable-4.2.0a-20060224.tar.gz
@@ -401,7 +419,7 @@ aftpd is a tftp server which is a file transfer method used by many VOIP phones
to get their firmware and/or configuration files. This is optional. to get their firmware and/or configuration files. This is optional.
*OPTIONAL* (only if you want it for a VOIP phone you are going to use) *OPTIONAL* (only if you want it for a VOIP phone you are going to use)
6. Go to ftp://ftp.mamalinux.com/pub/atftp and download the aftpd package 7. Go to ftp://ftp.mamalinux.com/pub/atftp and download the aftpd package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- ncftpget ftp://ftp.mamalinux.com/pub/atftp/atftp-0.7.tar.gz - ncftpget ftp://ftp.mamalinux.com/pub/atftp/atftp-0.7.tar.gz
@@ -421,7 +439,7 @@ iftop is a good console bandwidth visualization tool that shows you active
connections, where they are going to/from and how much of your precious bandwidth connections, where they are going to/from and how much of your precious bandwidth
they are using. *OPTIONAL* they are using. *OPTIONAL*
7. Go to http://www.ex-parrot.com/~pdw/iftop/ and download the package 8. Go to http://www.ex-parrot.com/~pdw/iftop/ and download the package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://www.tcpdump.org/release/libpcap-0.8.3.tar.gz - wget http://www.tcpdump.org/release/libpcap-0.8.3.tar.gz
@@ -448,7 +466,7 @@ within PNG files simply by creating a config file and a data file. We use this
package along with the included PHP script to generate server performance graphs package along with the included PHP script to generate server performance graphs
that can be displayed real-time on a web page. *OPTIONAL* that can be displayed real-time on a web page. *OPTIONAL*
8. Go to http://ploticus.sourceforge.net/ and download the package 9. Go to http://ploticus.sourceforge.net/ and download the package
- to install this directly on the command line type: - to install this directly on the command line type:
NOTE: you may have to edit the Makefile to remove X11 if you don't have it NOTE: you may have to edit the Makefile to remove X11 if you don't have it
- cd /usr/local - cd /usr/local
@@ -462,7 +480,7 @@ that can be displayed real-time on a web page. *OPTIONAL*
- you are done - you are done
NOTE: for the graphics to work on the AST_server_performance page you will NOTE: for the graphics to work on the AST_server_performance page you will
need the 'pl' script to be linked or copied into your htdocs/vicidial/ploticus directory need the 'pl' script to be linked or copied into your htdocs/vicidial/ploticus directory
NOTE: you may need to edit the Makefile for ploticus if you do not have X11
MySQL is a fast database system that is very easy to integrate with any MySQL is a fast database system that is very easy to integrate with any
application. You can either install it on the local Asterisk system or have one application. You can either install it on the local Asterisk system or have one
@@ -473,7 +491,7 @@ so we will need to install mysql on this machine.
on another machine) on another machine)
NOTE: a minimum of MySQL 4.0.X is required NOTE: a minimum of MySQL 4.0.X is required
9. Go to http://www.mysql.com/ and download the mysql package 10. Go to http://www.mysql.com/ and download the mysql package
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-4.0/mysql-4.0.26.tar.gz - wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-4.0/mysql-4.0.26.tar.gz
@@ -533,7 +551,7 @@ updated on your system, so we're going to install a new version now.
*OPTIONAL* (only updated as a precaution, not manditory) *OPTIONAL* (only updated as a precaution, not manditory)
[NOTE: newer zlib is needed before installing] [NOTE: newer zlib is needed before installing]
10. Go to http://www.openssh.org/ and download the linux source for openssh 11. Go to http://www.openssh.org/ and download the linux source for openssh
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://www.zlib.net/zlib-1.2.3.tar.gz - wget http://www.zlib.net/zlib-1.2.3.tar.gz
@@ -559,7 +577,7 @@ locally and have it work with apache, you need it installed on your machine
*OPTIONAL* (only install openssl if you want to use SSL secured web pages on *OPTIONAL* (only install openssl if you want to use SSL secured web pages on
your locally installed copy of Apache web server) your locally installed copy of Apache web server)
11. Go to http://www.openssl.org/ and download the linux source for openssl 12. Go to http://www.openssl.org/ and download the linux source for openssl
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://www.openssl.org/source/openssl-0.9.8b.tar.gz - wget http://www.openssl.org/source/openssl-0.9.8b.tar.gz
@@ -578,7 +596,7 @@ functionalities we need to have Apache and PHP installed on this machine.
*OPTIONAL* (only install Apache and PHP locally if you don't want to use an *OPTIONAL* (only install Apache and PHP locally if you don't want to use an
installation on another machine) installation on another machine)
12. Go to http://www.apache.org/ and download the apache unix source 13. Go to http://www.apache.org/ and download the apache unix source
Go to http://www.php.net/ and download the php unix source code Go to http://www.php.net/ and download the php unix source code
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
@@ -616,7 +634,7 @@ the load of your web traffic across many servers. If you are running more than
another cheap web server to handle the extra load. another cheap web server to handle the extra load.
*OPTIONAL* *OPTIONAL*
13. Go to http://balance.sourceforge.net to download the most recent source version 14. Go to http://balance.sourceforge.net to download the most recent source version
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://voxel.dl.sourceforge.net/sourceforge/balance/balance-3.34.tgz - wget http://voxel.dl.sourceforge.net/sourceforge/balance/balance-3.34.tgz
@@ -636,7 +654,7 @@ you want to use the latest development code of Asterisk you will need to have
this loaded on your system. this loaded on your system.
*OPTIONAL* *OPTIONAL*
14. Go to http://subversion.tigris.org to download the most recent source version 15. Go to http://subversion.tigris.org to download the most recent source version
- to install this directly on the command line type: - to install this directly on the command line type:
- cd /usr/local - cd /usr/local
- wget http://subversion.tigris.org/downloads/subversion-1.3.0.tar.gz - wget http://subversion.tigris.org/downloads/subversion-1.3.0.tar.gz
@@ -653,10 +671,10 @@ PHASE 4: INSTALLING ASTERISK
OK, all the prep work is done, now it's time to start having fun with Asterisk. OK, all the prep work is done, now it's time to start having fun with Asterisk.
There are four basic ways to install Asterisk, an official release(at the time of There are four basic ways to install Asterisk, an official release(at the time of
this writing the official release is 1.2.8), the CVS_v1-0 branch(1.0 this writing the official release is 1.2.9.1), the CVS_v1-0 branch(1.0
with bug fixes not yet packaged and released) and the SVN_DEV version(development with bug fixes not yet packaged and released) and the SVN_DEV version(development
branch). Because there are bugs that affect astGUIclient in releases 1.0.8 and branch). Because there are bugs that affect astGUIclient in releases 1.0.8 and
1.0.9, we recommend using Asterisk 1.2.8 or 1.0.10. These instructions are how we 1.0.9, we recommend using Asterisk 1.2.9.1 or 1.0.11.1. These instructions are how we
get our Asterisk system with it's T1 line installed with our 2 SIP VOIP devices get our Asterisk system with it's T1 line installed with our 2 SIP VOIP devices
and one IAX2 softphone. and one IAX2 softphone.
@@ -665,27 +683,27 @@ CVS_v1-0_Stable branch where the issues are fixed, or patching your 1.0.8/1.0.9
with the following patch: with the following patch:
(http://astguiclient.sourceforge.net/experimental_code/localmasq.patch) (http://astguiclient.sourceforge.net/experimental_code/localmasq.patch)
- If you do patch your system make sure you put the asterisk version - If you do patch your system make sure you put the asterisk version
field for the server on the admin pages as '1.0.10' field for the server on the admin pages as '1.0.11.1'
1. follow these command line steps: 1. follow these command line steps:
- mkdir /usr/src/asterisk - mkdir /usr/src/asterisk
- cd /usr/src/asterisk - cd /usr/src/asterisk
A. if you want 1.2 release (reliable with new features): A. if you want 1.2 release (reliable with new features):
- wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.8.tar.gz - wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.9.1.tar.gz
- wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.6.tar.gz - wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.6.tar.gz
- wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.3.tar.gz - wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.3.tar.gz
- gunzip asterisk-1.2.8.tar.gz - gunzip asterisk-1.2.9.1.tar.gz
- tar xvf asterisk-1.2.8.tar - tar xvf asterisk-1.2.9.1.tar
- gunzip zaptel-1.2.6.tar.gz - gunzip zaptel-1.2.6.tar.gz
- tar xvf zaptel-1.2.6.tar - tar xvf zaptel-1.2.6.tar
- gunzip libpri-1.2.3.tar.gz - gunzip libpri-1.2.3.tar.gz
- tar xvf libpri-1.2.3.tar - tar xvf libpri-1.2.3.tar
B. If you want latest 1.0 tree stable release: B. If you want latest 1.0 tree stable release:
- wget http://ftp.digium.com/pub/asterisk/old-releases/asterisk-1.0.10.tar.gz - wget http://ftp.digium.com/pub/asterisk/old-releases/asterisk-1.0.11.1.tar.gz
- wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.0.10.tar.gz - wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.0.10.tar.gz
- wget http://ftp.digium.com/pub/libpri/releases/libpri-1.0.9.tar.gz - wget http://ftp.digium.com/pub/libpri/releases/libpri-1.0.9.tar.gz
- gunzip asterisk-1.0.10.tar.gz - gunzip asterisk-1.0.11.1.tar.gz
- tar xvf asterisk-1.0.10.tar - tar xvf asterisk-1.0.11.1.tar
- gunzip zaptel-1.0.10.tar.gz - gunzip zaptel-1.0.10.tar.gz
- tar xvf zaptel-1.0.10.tar - tar xvf zaptel-1.0.10.tar
- gunzip libpri-1.0.9.tar.gz - gunzip libpri-1.0.9.tar.gz
@@ -720,7 +738,7 @@ with the following patch:
- make clean - make clean
- make - make
- make install - make install
- cd ../asterisk-1.2.8 - cd ../asterisk-1.2.9.1
- (1.2 tree) If you want to include Answering Machine Detection ability - (1.2 tree) If you want to include Answering Machine Detection ability
you will need to download app_amd.c and amd.conf and alter the you will need to download app_amd.c and amd.conf and alter the
apps/Makefile to compile it properly apps/Makefile to compile it properly
@@ -1544,7 +1562,7 @@ effected extension groups are show):
##### you will have problems if it is not in your dialplan! ##### you will have problems if it is not in your dialplan!
;exten => h,1,AGI(call_log.agi,${EXTEN}) ; use regular AGI for older versions ;exten => h,1,AGI(call_log.agi,${EXTEN}) ; use regular AGI for older versions
exten => h,1,DeadAGI(call_log.agi,${EXTEN}) ; DeadAGI is new exten => h,1,DeadAGI(call_log.agi,${EXTEN}) ; DeadAGI is new
exten => h,2,DeadAGI(VD_hangup.agi,${EXTEN}) exten => h,2,DeadAGI(VD_hangup.agi,PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
; Extension 3429 - Inbound 800 number (1-800-555-3429) ; Extension 3429 - Inbound 800 number (1-800-555-3429)
exten => _**3429,1,Ringing exten => _**3429,1,Ringing
+49 -18
View File
@@ -74,16 +74,40 @@
- DONE Fix active calls stats for multiple CLOSER campaigns in Realtime Campaign screen. - DONE Fix active calls stats for multiple CLOSER campaigns in Realtime Campaign screen.
- DONE Add internal DNC list of phone numbers(vicidial_dnc table) that would be scrubbed against by the AST_VDhopper.pl script while putting leads into the hopper to be dialed and it would kick the internal DNC matches out with a special status as DNCL(Do-Not-Call-Load) so they would be in the system but unable to be dialed. Would need to add a mechanism to add a lead to this list upon agent-dispo of a call as DNC within vicidial.php. Would need to create a new admin page section to manually add leads to DNC list, ADD TO DNC link in the LISTS section. Also, would add a parameter to vicidial_campaigns(dnc_list_enabled ENUM('Y','N')) where a campaign could be exempted from the system's DNC list restrictions if set to N(would not be active by default 'N').
- DONE Add option for PRI T1 system usage with VICIDIAL outbound to automatically grab Busy and Disconnect information from PRI call termincation codes and use those for NA dispositions. VD_hangup.agi and AST_VDauto_dial.pl modified.
- DONE Remove gmt time validation of leads from AST_VDauto-dial because AST_VDhopper already removes leads that are outside of the appropriate range of GMT offsets when it is run every minute. Removing this redundancy should speed up the dialing slightly.
- DONE Fix VD_hangup to work with CLOSER transfer-from-fronter calls, different log contents than from CLOSER inbound call.
- DONE Add option for disposition-based lead recycling on an automated and timed basis per campaign. It will be some sort of method to be able to auto-insert Busy/Ring-no-answer/other-NA calls back into the hopper after a certain timeout. there will be a minimum of 120 seconds before the lead will be allowed to go back into the hopper and a lead can only go back into the hopper a maximum of 10 times before the list would need to be reset. The vicidial_list.called_since_last_reset field needs to be altered to allow for counting of recycle attempts. All scripts need to be able to keep the state of call_since_last_reset. A new table: vicidial_lead_recycle that will function somewhat like HotKeys on the campaign screen. admin.php and AST_VDhopper.pl will need to be modified.
- DONE Change ADMIN_area_code_populate.pl script to ignore the header row of the phone codes gmt file DB import
- DONE Add database GMT lookup to the VICIDIAL_IN_new_leads_file.pl lead loader lead import process.
- DONE Change ADMIN_adjust_GMTnow_on_leads.pl script to use database instead of flat text file.
- DONE Fix display issues with LIST MODIFY page on admin.php for statuses because of lead recycling and with GMT offset for positive GMT offsets.
- DONE Add listID override feature to the VICIDIAL_IN_new_leads_file.pl lead loader lead import process to force all leads being loaded into the same list_id.
- DONE Add listID override feature to the basic web-based lead loader lead import process to force all leads being loaded into the same list_id.
- DONE Add database GMT lookup to the basic web-based lead loader lead import process.
- DONE Add listID override feature to the super web-based lead loader lead import process to force all leads being loaded into the same list_id.
- DONE Add database GMT lookup to the super web-based lead loader lead import process. This one is more difficult because of the many scripts and sections used to parse and insert leads: listloader_super.pl, listloader.pl, new_listloader_superL.php
- DONE standardize the query results variable in PHP scripts to $rslt.
- HIGH Add internal DNC list of phone numbers(vicidial_dnc table) that would be scrubbed against by the AST_VDhopper.pl script while putting leads into the hopper to be dialed and it would kick the internal DNC matches out with a special status as DNCL(Do-Not-Call-Load) so they would be in the system but unable to be dialed. Would need to add a mechanism to add a lead to this list upon agent-dispo of a call as DNC within vicidial.php. Would need to create a new admin page section to manually add leads to DNC list. Also, would add a parameter to vicidial_campaigns(dnc_list_enabled ENUM('Y','N')) where a campaign could be exempted from the system's DNC list restrictions(would be active by default 'Y').
- HIGH Add optional set of scripts for PRI system usage with VICIDIAL outbound to automatically grab Busy and disconnect information from PRI call termincation codes and use those for NA dispositions. The problem with these is that they are not 100% accurate.
- HIGH Add option for disposition-based lead recycling on an automated and timed basis per campaign. It will be some sort of method to be able to auto-insert Busy/Ring-no-answer/other-NA calls back into the hopper after a certain timeout. Not sure on a method or formula yet.
- HIGH Fix call_log entries for Zap client phones where call information is in different places than if calls are placed from SIP or IAX client phones. call_log AGI scripts. - HIGH Fix call_log entries for Zap client phones where call information is in different places than if calls are placed from SIP or IAX client phones. call_log AGI scripts.
@@ -91,9 +115,11 @@
- MEDIUM fix MySQL error on campaign modify page for dialable leads when no active lists for campaign.
- MEDIUM add option to disable detailed logging for VICIDIAL and astGUIclient server apps. - MEDIUM add option to disable detailed logging for VICIDIAL and astGUIclient server apps.
- MEDIUM add new ALLFORCE to recording method for campaigns. will force recording of all calls and disable the button for agents no matter their setting. - MEDIUM add new ALLFORCE to recording method for campaigns. will force recording of all calls and disable the button for agents no matter their vicidial_users setting.
- MEDIUM add a basic predictive/adaptive algorithm to VICIDIAL to automatically speed-up and slow-down dialing by altering the dial_level at regular intervals. Would need more settings in the vicidial_campaigns table for adaptive like maximum lines per agent, dropped call ratio, dropped call rule to guide the predictive app. Would also need to change dial_level to be a DOUBLE or VARCHAR field to allow for different fractional increments. The admin.php page would have to be altered to ignore auto_dial_level changes when adaptive dialing is activated. The minimum dial_level would be set to '1' for adaptive dialing - MEDIUM add a basic predictive/adaptive algorithm to VICIDIAL to automatically speed-up and slow-down dialing by altering the dial_level at regular intervals. Would need more settings in the vicidial_campaigns table for adaptive like maximum lines per agent, dropped call ratio, dropped call rule to guide the predictive app. Would also need to change dial_level to be a DOUBLE or VARCHAR field to allow for different fractional increments. The admin.php page would have to be altered to ignore auto_dial_level changes when adaptive dialing is activated. The minimum dial_level would be set to '1' for adaptive dialing
auto_dial_level VARCHAR(6), # allow for just about anything. precision decimal too auto_dial_level VARCHAR(6), # allow for just about anything. precision decimal too
@@ -102,13 +128,19 @@
adaptive_dropped_percentage SMALLINT(3), # percentage of accaptable dropped calls adaptive_dropped_percentage SMALLINT(3), # percentage of accaptable dropped calls
adaptive_dropped_rule ENUM('HARD_LIMIT','TAPERED','AVERAGE'), # method for adhearing to % limit adaptive_dropped_rule ENUM('HARD_LIMIT','TAPERED','AVERAGE'), # method for adhearing to % limit
- MEDIUM room manager documentation - manual. Probably a free 2 chapter black and white manual and a full color print book available for sale.
- MEDIUM Rewrite the inbound and closer call handling to allow for music on hold per in-group and a single queue app instead of multiple AGIs each running their own queries. Currently with large queues and long wait times a lot of load is generated with calls on hold in the queue. Switching to a central queue application would reduce the load and speed things up.
- MEDIUM Add optional field to phones table to allow for different recording file names in astguiclient.php, Similar to vicidial options. - MEDIUM Add optional field to phones table to allow for different recording file names in astguiclient.php, Similar to vicidial options.
- MEDIUM make 3rd party consultative transfers work for Local extensions, also for internal/local transfer to vicidial closers if possible. - MEDIUM make 3rd party consultative transfers work for Local extensions, also for internal/local transfer to vicidial closers if possible.
- MEDIUM Add ChanSpy functionality to listen-in on VOIP channels in astguiclient.php. Maybe not since Chanspy can cause problems like crashing the Asterisk server. - MEDIUM Attempt to make some kind of holiday schedule function for national and state holidays that would be able block out states on specific no-call days. This is rather difficult because of the way some holidays are scheduled, I.E. Easter.
- MEDIUM Create a script to allow vicidial agents to dial into an AGI script that would ask for user/pass and then pass them onto their vicidial.php-defined sessionid. - MEDIUM Add ChanSpy functionality to listen-in on VOIP channels in astguiclient.php. Maybe not since Chanspy can cause problems like crashing the Asterisk server. Need to do more testing.
- MEDIUM Create a script to allow vicidial agents to dial into an AGI script that would ask for user/pass and then place them onto their vicidial.php-defined sessionid.
- MEDIUM add link in astguiclient to login and logout from Asterisk Queues - MEDIUM add link in astguiclient to login and logout from Asterisk Queues
@@ -117,27 +149,23 @@
- MEDIUM add new tab to astguiclient.php script to show status of Asterisk queues - MEDIUM add new tab to astguiclient.php script to show status of Asterisk queues
- MEDIUM Convert all scripts to DBD::MySQL perl library in place of Net::MySQL. DBD::MySQL is faster because it uses the MySQL client libs on the machine. One problem is that you need the mysqlclientlibs installed on every - MEDIUM Convert all scripts to DBD::MySQL perl library in place of Net::MySQL. DBD::MySQL is faster because it uses the MySQL client libs on the machine. One problem is that you need the mysqlclientlibs installed on every
Asterisk server and the default installation of only the MySQL client libs will result in having to do a force install of cpan DBD::MySQL(because it tries to test with the local DB). Not to mention all of the code changes that would need to be made. There are also MySQL client licensing issues for certain installation circumstances(Net::MySQL doesn't use mysql client libs so it doesn't have those issues) but I really don't want to get into that discussion. Asterisk server and the default installation of only the MySQL client libs will result in having to do a force install of cpan DBD::MySQL(because it tries to test with the local DB). Not to mention all of the code changes that would need to be made. There are also MySQL client licensing issues for certain installation circumstances(Net::MySQL doesn't use mysql client libs so it doesn't have those issues) but I really don't want to get into that discussion. We will start by converting at least one perl script for each release until we have converted then all, then we will no longer support Net::MySQL. This will probably take some time, but the scripts that are added to the DBI-scripts folder will be drop-in replacements for the Net versions that are installed by default.
- MEDIUM add ability to call CLOSER campaigns "BLEND" or "INBND". would require many script changes from server side to client side, not set in stone yet, but considering it. - MEDIUM add ability to call CLOSER campaigns "BLEND" or "INBND". would require many script changes from server side to client side, not set in stone yet, but considering it.
- MEDIUM add new method for capping the maximum number of attempts to try leads of a specific status. This would be set up like HotKeys are, per campaign where you would select the status and define the maximum number of attempts for that type of status for that campaign and the VDhopper wouldn't allow that kind of lead into the hopper if it was over the max value of call_count.(having filters reduced the priority of this item since you can do a lot of custom coding to duplicate this feature in vicidial_lead_filters)
- MEDIUM add some kind of intelligent call-routing to astguiclient so that you can auto-forward calls to another extension from within astguiclient.php instead of using your phone or something like Queues which can mess up other things. This will need it's own table in the DB and probably some extensions.conf entries and an AGI script or two to do the actual call routing. - MEDIUM add some kind of intelligent call-routing to astguiclient so that you can auto-forward calls to another extension from within astguiclient.php instead of using your phone or something like Queues which can mess up other things. This will need it's own table in the DB and probably some extensions.conf entries and an AGI script or two to do the actual call routing.
- MEDIUM add a new script for using SoX to analyze the first 5 seconds of a ring-time recording within 15 minutes of the NA call ending and detecting if it has the SIT tone at the beginning of it so the lead can be taken out of the list as a DC
- MEDIUM add skills-based routing to give the ability for a manager to set an agent at a higher or lower level per campaign or in-group. Defaults to level 0 possible values will be -9 through 9 - MEDIUM add skills-based routing to give the ability for a manager to set an agent at a higher or lower level per campaign or in-group. Defaults to level 0 possible values will be -9 through 9
- MEDIUM add all possible fields to the SCRIPT tab to auto-populate like in-group for inbound/closer, campaign and others - MEDIUM add all possible fields to the SCRIPT tab to auto-populate like in-group for inbound/closer, campaign and others
- MEDIUM add ability to specify list_id in lead loader at time of picking fields - MEDIUM add ability to scrub leads being imported in the lead loader against the vicidial_dnc list as they are being imported.
- MEDIUM add ability upon vicidial.php login to take a number to dial as a password and a reserved word(something like MANUAL in all caps) that would allow the use of an EXTERNAL phone without setting it up as a aasterisk.phones entry. - MEDIUM add ability upon vicidial.php login to take a number to dial as a password and a reserved word(something like MANUAL in all caps) that would allow the use of an EXTERNAL phone without setting it up as an asterisk.phones entry.
- MEDIUM rebuild the vdremote.php remote agents pages to use AJAX(PHP/Javascript/XMLHTTPRequest) for real-time popups of call data. - MEDIUM rebuild the vdremote.php remote agents pages to use AJAX(PHP/Javascript/XMLHTTPRequest) for real-time popups of call data.
- MEDIUM allow custom audio welcome message for vicidial campaigns. - MEDIUM allow custom audio welcome message for vicidial campaigns. This might be an app_conference only feature.
- MEDIUM create a cron script and method for creating new extensions in the sip.conf/iax.conf files as well as dialplan entries(extensions.conf). This will require more fields in the phones table to account for variables available to the protocols. The conf files would need to be altered before to have a flag for the beginning and ending of the auto-generated content. This would also necessitate a TEXT area for the extensions.conf content(that would be default generated but could be manually altered). The cron script would be run every 5 minutes or so to see if any phones had altered content, and if so generate new auto-content and do a 'reload' on the asterisk server to activate the new content. - MEDIUM create a cron script and method for creating new extensions in the sip.conf/iax.conf files as well as dialplan entries(extensions.conf). This will require more fields in the phones table to account for variables available to the protocols. The conf files would need to be altered before to have a flag for the beginning and ending of the auto-generated content. This would also necessitate a TEXT area for the extensions.conf content(that would be default generated but could be manually altered). The cron script would be run every 5 minutes or so to see if any phones had altered content, and if so generate new auto-content and do a 'reload' on the asterisk server to activate the new content.
@@ -151,8 +179,6 @@ Asterisk server and the default installation of only the MySQL client libs will
- MEDIUM Add method of picking up astGUIclient parked calls by only dialing digits on a regular extension without using the astGUIclient. - MEDIUM Add method of picking up astGUIclient parked calls by only dialing digits on a regular extension without using the astGUIclient.
- MEDIUM room manager documentation - manual. Probably a free text-only manual and a full color print book available for sale
- MEDIUM admin/installer/maintainer documentation as well as troubleshooting guide - MEDIUM admin/installer/maintainer documentation as well as troubleshooting guide
- MEDIUM Run some lab-style load tests on VICIDIAL and show recommended configurations as well as "highest recommended" settings - MEDIUM Run some lab-style load tests on VICIDIAL and show recommended configurations as well as "highest recommended" settings
@@ -167,8 +193,13 @@ Asterisk server and the default installation of only the MySQL client libs will
- LOW Revisit possibility of using something other than CallerIDname to tag a call process, probably a long shot without altering the Asterisk code, but that may be an option. - LOW Revisit possibility of using something other than CallerIDname to tag a call process, probably a long shot without altering the Asterisk code, but that may be an option.
- LOW add new method for capping the maximum number of attempts to try leads of a specific status. This would be set up like HotKeys are, per campaign where you would select the status and define the maximum number of attempts for that type of status for that campaign and the VDhopper wouldn't allow that kind of lead into the hopper if it was over the max value of call_count.(having filters reduced the priority of this item since you can do a lot of custom coding to duplicate this feature in vicidial_lead_filters)
- LOW add a new script for using SoX to analyze the first 5 seconds of a ring-time recording within 15 minutes of the NA call ending and detecting if it has the SIT tone at the beginning of it so the lead can be taken out of the list as a DC. adding PRI hangup codes has reduced priority for this item.
- ON-HOLD We are also looking at creating an inbound-agent-specific GUI that would ideally work with Asterisk queues but that is not very likely given the current lack of events being given off by queues(this is much less likely to be built now that VICIDIAL takes inbound calls) - ON-HOLD We are also looking at creating an inbound-agent-specific GUI that would ideally work with Asterisk queues but that is not very likely given the current lack of events being given off by queues(this is much less likely to be built now that VICIDIAL takes inbound calls)
- ON-HOLD add a way of checking that there is no more than 1 channel in the meetme room with the agent before another call to that agent. Currently this happens less than 0.1% of the time(mostly on heavily loaded systems), but another check might change that to zero. - ON-HOLD add a way of checking that there is no more than 1 channel in the meetme room with the agent before another call to that agent. Currently this happens less than 0.1% of the time(mostly on heavily loaded systems), but another check might change that to zero.
- ON-HOLD Localization of each server based on Intl. dial codes and/or country codes. very difficult to do this based on dial-codes, if used in other country, best to not use the adjust_gmt script. - ON-HOLD Localization of each server based on Intl. dial codes and/or country codes. very difficult to do this based on dial-codes, if used in other country, best to not use the adjust_gmt script.
+13 -13
View File
@@ -1,13 +1,13 @@
100001|10001|107|1|7275551213|MR|I|P|FREELY01|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100001|10001|107|1|7275551213|MR|I|P|FREELY01|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100002|10002|107|1|7275551213|MR|I|P|FREELY02|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100002|10002|107|1|7275551213|MR|I|P|FREELY02|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100003|10003|107|1|7275551213|MR|I|P|FREELY03|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100003|10003|107|1|7275551213|MR|I|P|FREELY03|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100004|10004|107|1|7275551213|MR|I|P|FREELY04|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100004|10004|107|1|7275551213|MR|I|P|FREELY04|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100005|10005|107|1|7275551213|MR|I|P|FREELY05|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100005|10005|107|1|7275551213|MR|I|P|FREELY05|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100006|10006|107|1|7275551213|MR|I|P|FREELY06|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100006|10006|107|1|7275551213|MR|I|P|FREELY06|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100007|10007|107|1|7275551213|MR|I|P|FREELY07|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100007|10007|107|1|7275551213|MR|I|P|FREELY07|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100008|10008|107|1|7275551213|MR|I|P|FREELY08|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100008|10008|107|1|7275551213|MR|I|P|FREELY08|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100009|10009|107|1|7275551213|MR|I|P|FREELY09|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100009|10009|107|1|7275551213|MR|I|P|FREELY09|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100010|10010|107|1|7275551213|MR|I|P|FREELY10|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100010|10010|107|1|7275551213|MR|I|P|FREELY10|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100011|10011|107|1|7275551213|MR|I|P|FREELY11|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100011|10011|107|1|7275551213|MR|I|P|FREELY11|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100012|10012|107|1|7275551213|MR|I|P|FREELY12|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100012|10012|107|1|7275551213|MR|I|P|FREELY12|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
100013|10013|107|1|7275551213|MR|I|P|FREELY13|249 MUNDON ROAD|MALDON|FL||||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS 100013|10013|107|1|7275551213|MR|I|P|FREELY13|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS
+23
View File
@@ -115,6 +115,29 @@ ALTER TABLE vicidial_auto_calls ADD call_type ENUM('IN','OUT') default 'OUT';
ALTER TABLE vicidial_campaigns ADD closer_campaigns TEXT default ''; ALTER TABLE vicidial_campaigns ADD closer_campaigns TEXT default '';
CREATE TABLE vicidial_dnc (
phone_number VARCHAR(10) PRIMARY KEY NOT NULL
);
INSERT IGNORE INTO vicidial_dnc SELECT phone_number from vicidial_list where status='DNC';
ALTER TABLE vicidial_campaigns ADD use_internal_dnc ENUM('Y','N') default 'N';
ALTER TABLE vicidial_auto_calls MODIFY status ENUM('SENT','RINGING','LIVE','XFER','PAUSED','CLOSER','BUSY','DISCONNECT') default 'PAUSED';
CREATE TABLE vicidial_lead_recycle (
recycle_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE NOT NULL,
campaign_id VARCHAR(8),
status VARCHAR(6) NOT NULL,
attempt_delay SMALLINT(5) UNSIGNED default '1800',
attempt_maximum TINYINT(3) UNSIGNED default '32',
active ENUM('Y','N') default 'N',
index (campaign_id)
);
ALTER TABLE vicidial_list MODIFY called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10') default 'N';
ALTER TABLE servers MODIFY local_gmt VARCHAR(5) default '-5';