From af2d33c881ba8a26d7594b42961e60911b1c4326 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 2 Sep 2008 11:10:33 +0000 Subject: [PATCH] added campaign option to allow for restriction of manual dialing to only the leads within the lists for the active campaigns added option (for IE users only) to copy a field to the agent computer's clipboard upon a call being sent to an agent added new method for alternate number dialing, allowing over 65,000 alternate numbers per lead. Leads must be loaded using the CLI lead loader git-svn-id: svn://192.168.202.10@945 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 6 + agi/agi-VDAD_ALL_outbound.agi | 6 +- bin/AST_VDauto_dial.pl | 190 ++- bin/AST_VDauto_dial_FILL.pl | 36 +- bin/FastAGI_log.pl | 155 ++- bin/VICIDIAL_IN_new_leads_file.pl | 1052 +++++++++-------- docs/ALTERNATE_NUMBER_DIALING.txt | 65 + docs/QC_PROCESS.txt | 5 + docs/REQUIRED_APPS_INSTALL.txt | 1 + docs/SCRATCH_INSTALL.txt | 1 + extras/MySQL_AST_CREATE_tables.sql | 26 +- extras/performance_test_alt_multi.txt | 14 + extras/test_VICIDIAL_lead_file.txt | 27 +- extras/upgrade_2.0.5.sql | 29 + .../TO_BE_TRANSLATED_2.0.5.txt | 17 + www/agc/vdc_db_query.php | 262 +++- www/agc/vicidial.php | 281 ++++- www/vicidial/AST_timeonVDADall.php | 82 +- www/vicidial/admin.php | 50 +- 19 files changed, 1669 insertions(+), 636 deletions(-) create mode 100644 extras/performance_test_alt_multi.txt diff --git a/UPGRADE b/UPGRADE index b5378004..2c7976b2 100644 --- a/UPGRADE +++ b/UPGRADE @@ -144,7 +144,13 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom ; quiet monitor-only entry and leaving conferences for VICIDIAL (recording) exten => _58600XXX,1,Meetme,${EXTEN:1}|Fmq +33. Added option (for Internet Explorer users only) to copy a field to the + clipboard of the agent computer upon a call being sent to the agent. +34. Added new alternate number dialing method which allows for over 65,000 alt + phone numbers per lead. Currently these extra numbers are only available for + auto dialing. These extra alternate number leads must be imported with the + CLI lead loader(VICIDIAL_IN_new_leads_file.pl) diff --git a/agi/agi-VDAD_ALL_outbound.agi b/agi/agi-VDAD_ALL_outbound.agi index afa04683..c8b7d521 100644 --- a/agi/agi-VDAD_ALL_outbound.agi +++ b/agi/agi-VDAD_ALL_outbound.agi @@ -53,6 +53,7 @@ # 80430-1144 - added term_reason to vicidial_log, QUEUETIMEOUT # 80520-0059 - added SURVEY ability and digit maps # 80527-2329 - added SURVEYCAMP ability to pull settings from database +# 80831-0353 - added logging of alt_dial field # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -342,7 +343,7 @@ if ($affected_rows > 0) $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD vicidial_list PU update: |$affected_rows|$uniqueid|"; &agi_output;} - $stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;"; + $stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time,alt_dial FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -355,6 +356,7 @@ if ($affected_rows > 0) $VDADphone_code = "$aryA[2]"; $VDADlead_id = "$aryA[3]"; $VDADcall_time = "$aryA[4]"; + $VDADalt_dial = "$aryA[5]"; $rec_count++; } $sthA->finish(); @@ -383,7 +385,7 @@ if ($affected_rows > 0) } $sthA->finish(); - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N')"; + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); diff --git a/bin/AST_VDauto_dial.pl b/bin/AST_VDauto_dial.pl index c53be6dc..94d6236b 100644 --- a/bin/AST_VDauto_dial.pl +++ b/bin/AST_VDauto_dial.pl @@ -68,6 +68,7 @@ # 80227-0406 - added queue_priority # 80525-1040 - Added IVR vac status compatibility for inbound calls # 80713-0624 - Added vicidial_list_last_local_call_time field +# 80829-2359 - Added extended alt dial and dnc checkon all alt dial hopper insertions # @@ -794,7 +795,7 @@ while($one_day_interval > 0) if ($Lsec < 10) {$Lsec = "0$Lsec";} $LLCT_DATE = "$Lyear-$Lmon-$Lmday $Lhour:$Lmin:$Lsec"; - if ( ($alt_dial =~ /ALT|ADDR3/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT|ADDR/) ) + if ( ($alt_dial =~ /ALT|ADDR3|X/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT|ADDR|X/) ) { if ( ($alt_dial =~ /ALT/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT/) ) { @@ -806,6 +807,31 @@ while($one_day_interval > 0) $address3 =~ s/\D//gi; $phone_number = $address3; } + if ( ($alt_dial =~ /X/) && ($DBIPautoaltdial[$user_CIPct] =~ /X/) ) + { + if ($alt_dial =~ /LAST/) + { + $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = $alt_dial; + $Talt_dial =~ s/\D//gi; + $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $phone_code = "$aryA[0]"; + $phone_number = "$aryA[1]"; + $phone_number =~ s/\D//gi; + } + $sthA->finish(); + } + $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; } else @@ -842,6 +868,8 @@ while($one_day_interval > 0) $lead_id_call_list .= "$lead_id|"; + if (length($alt_dial)<1) {$alt_dial='MAIN';} + ### whether to omit phone_code or not if ($DBIPomitcode[$user_CIPct] > 0) {$Ndialstring = "$Local_out_prefix$phone_number";} @@ -1007,7 +1035,7 @@ while($one_day_interval > 0) else { $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','$CLnew_status','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$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,alt_dial) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','$CLnew_status','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$end_epoch','$CLalt_dial')"; if($M){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); @@ -1048,7 +1076,7 @@ while($one_day_interval > 0) ### check to see if campaign has alt_dial enabled $VD_auto_alt_dial = 'NONE'; $VD_auto_alt_dial_statuses=''; - $stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses FROM vicidial_campaigns where campaign_id='$CLcampaign_id';"; + $stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses,use_internal_dnc FROM vicidial_campaigns where campaign_id='$CLcampaign_id';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1059,13 +1087,15 @@ while($one_day_interval > 0) @aryA = $sthA->fetchrow_array; $VD_auto_alt_dial = "$aryA[0]"; $VD_auto_alt_dial_statuses = "$aryA[1]"; + $VD_use_internal_dnc = "$aryA[2]"; $epc_countCAMPDATA++; } $sthA->finish(); if ( ($VD_auto_alt_dial_statuses =~ / $CLnew_status /) && ($CLlead_id > 0) ) { - if ( ($VD_auto_alt_dial =~ /(ALT_ONLY|ALT_AND_ADDR3)/) && ($CLalt_dial =~ /NONE|MAIN/) ) + if ( ($VD_auto_alt_dial =~ /ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED/) && ($CLalt_dial =~ /NONE|MAIN/) ) { + $alt_dial_skip=0; $VD_alt_phone=''; $stmtA="SELECT alt_phone,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$CLlead_id';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -1086,13 +1116,38 @@ while($one_day_interval > 0) $sthA->finish(); if (length($VD_alt_phone)>5) { - $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ALT',user='',priority='25';"; - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + if ($VD_use_internal_dnc =~ /Y/) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_alt_phone';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_dnc_count = "$aryA[0]"; + } + $sthA->finish(); + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ALT',user='',priority='25';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$CLalt_dial='ALT';} } - if ( ( ($VD_auto_alt_dial =~ /(ADDR3_ONLY)/) && ($CLalt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /(ALT_AND_ADDR3)/) && ($CLalt_dial =~ /ALT/) ) ) + if ( ( ($VD_auto_alt_dial =~ /ADDR3_ONLY/) && ($CLalt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /ALT_AND_ADDR3/) && ($CLalt_dial =~ /ALT/) ) ) { + $addr3_dial_skip=0; $VD_address3=''; $stmtA="SELECT address3,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$CLlead_id';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -1113,9 +1168,120 @@ while($one_day_interval > 0) $sthA->finish(); if (length($VD_address3)>5) { - $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ADDR3',user='',priority='20';"; - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + if ($VD_use_internal_dnc =~ /Y/) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_address3';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_dnc_count = "$aryA[0]"; + } + $sthA->finish(); + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ADDR3',user='',priority='20';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$CLalt_dial='ADDR3';} + } + if ( ( ($VD_auto_alt_dial =~ /EXTENDED_ONLY/) && ($CLalt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /ALT_AND_EXTENDED/) && ($CLalt_dial =~ /ALT/) ) || ( ($VD_auto_alt_dial =~ /ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED/) && ($CLalt_dial =~ /ADDR3/) ) || ( ($VD_auto_alt_dial =~ /EXTENDED/) && ($CLalt_dial =~ /^X/) && ($CLalt_dial !~ /XLAST/) ) ) + { + if ($CLalt_dial =~ /ADDR3/) {$Xlast=0;} + else + {$Xlast = $CLalt_dial;} + $Xlast =~ s/\D//gi; + if (length($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + $stmtA="SELECT gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$CLlead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_gmt_offset_now = "$aryA[1]"; + $VD_state = "$aryA[2]"; + $VD_list_id = "$aryA[3]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + $alt_dial_phones_count=0; + $stmtA="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$CLlead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $alt_dial_phones_count = "$aryA[0]"; + } + $sthA->finish(); + + while ( ($alt_dial_phones_count > 0) && ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmtA="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$CLlead_id' and alt_phone_count='$Xlast';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_altdial_id = "$aryA[0]"; + $VD_altdial_phone = "$aryA[1]"; + $VD_altdial_active = "$aryA[2]"; + } + else + {$Xlast=9999999999;} + $sthA->finish(); + + if ($VD_altdial_active =~ /Y/) + { + if ($VD_use_internal_dnc =~ /Y/) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_dnc_count = "$aryA[0]"; + } + $sthA->finish(); + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='X$Xlast',user='',priority='15';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|X$Xlast|$VD_altdial_id|"; &agi_output;} + $Xlast=9999999999; + } + else + {if ($AGILOG) {$agi_string = "-- VDH alt dial is DNC|X$Xlast|$VD_altdial_phone|"; &agi_output;}} + } } } } @@ -1261,7 +1427,7 @@ while($one_day_interval > 0) if ($CLstage < 0.25) {$CLstage=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','DROP','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$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,alt_dial) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','DROP','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$end_epoch','$CLalt_dial')"; if($M){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); diff --git a/bin/AST_VDauto_dial_FILL.pl b/bin/AST_VDauto_dial_FILL.pl index 8113c66f..570d0f76 100644 --- a/bin/AST_VDauto_dial_FILL.pl +++ b/bin/AST_VDauto_dial_FILL.pl @@ -22,6 +22,7 @@ # 71111-2349 - fixed overdialing bug # 80227-0406 - fixed auto-alt-dial and added queue_priority # 80713-0624 - Added vicidial_list_last_local_call_time field +# 80831-0400 - Added new alt-dial options # @@ -644,18 +645,43 @@ while($one_day_interval > 0) if ($Lsec < 10) {$Lsec = "0$Lsec";} $LLCT_DATE = "$Lyear-$Lmon-$Lmday $Lhour:$Lmin:$Lsec"; - if ( ($alt_dial =~ /ALT|ADDR3/) && ($DBIPautoaltdial[$camp_CIPct] =~ /ALT|ADDR/) ) + if ( ($alt_dial =~ /ALT|ADDR3|X/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT|ADDR|X/) ) { - if ( ($alt_dial =~ /ALT/) && ($DBIPautoaltdial[$camp_CIPct] =~ /ALT/) ) + if ( ($alt_dial =~ /ALT/) && ($DBIPautoaltdial[$user_CIPct] =~ /ALT/) ) { $alt_phone =~ s/\D//gi; $phone_number = $alt_phone; } - if ( ($alt_dial =~ /ADDR3/) && ($DBIPautoaltdial[$camp_CIPct] =~ /ADDR3/) ) + if ( ($alt_dial =~ /ADDR3/) && ($DBIPautoaltdial[$user_CIPct] =~ /ADDR3/) ) { $address3 =~ s/\D//gi; $phone_number = $address3; } + if ( ($alt_dial =~ /^X/) && ($DBIPautoaltdial[$user_CIPct] =~ /^X/) ) + { + if ($alt_dial =~ /LAST/) + { + $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = $alt_dial; + $Talt_dial =~ s/\D//gi; + $stmtA = "SELECT phone_code,phone_number FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $phone_code = "$aryA[0]"; + $phone_number = "$aryA[1]"; + $phone_number =~ s/\D//gi; + } + $sthA->finish(); + } + $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; } else @@ -690,7 +716,9 @@ while($one_day_interval > 0) if ($lists_update !~ /'$list_id'/) {$lists_update .= "'$list_id',"; $LUcount++;} - $lead_id_call_list .= "$lead_id|"; + $lead_id_call_list .= "$lead_id|"; + + if (length($alt_dial)<1) {$alt_dial='MAIN';} ### whether to omit phone_code or not if ($DBIPomitcode[$camp_CIPct] > 0) diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index 056568e5..cca5fbc0 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -39,6 +39,7 @@ # 80510-0414 - Fixed crossover logging bugs # 80510-2058 - Fixed status override bug # 80525-1040 - Added IVR vac status compatibility for inbound calls +# 80830-0035 - Added auto alt dialing for EXTERNAL leads for each lead # @@ -854,7 +855,7 @@ sub process_request { ### check to see if campaign has alt_dial enabled $VD_auto_alt_dial = 'NONE'; $VD_auto_alt_dial_statuses=''; - $stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses FROM vicidial_campaigns where campaign_id='$VD_campaign_id';"; + $stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses,use_internal_dnc FROM vicidial_campaigns where campaign_id='$VD_campaign_id';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -865,13 +866,15 @@ sub process_request { @aryA = $sthA->fetchrow_array; $VD_auto_alt_dial = "$aryA[0]"; $VD_auto_alt_dial_statuses = "$aryA[1]"; + $VD_use_internal_dnc = "$aryA[2]"; $epc_countCAMPDATA++; } $sthA->finish(); if ($VD_auto_alt_dial_statuses =~ / $VD_status | $VDL_status /) { - if ( ($VD_auto_alt_dial =~ /(ALT_ONLY|ALT_AND_ADDR3)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) + if ( ($VD_auto_alt_dial =~ /(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) { + $alt_dial_skip=0; $VD_alt_phone=''; $stmtA="SELECT alt_phone,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$VD_lead_id';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -892,13 +895,38 @@ sub process_request { $sthA->finish(); if (length($VD_alt_phone)>5) { - $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ALT',user='',priority='25';"; - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + if ($VD_use_internal_dnc =~ /Y/) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_alt_phone';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_dnc_count = "$aryA[0]"; + } + $sthA->finish(); + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ALT',user='',priority='25';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$VD_alt_dial='ALT';} } if ( ( ($VD_auto_alt_dial =~ /(ADDR3_ONLY)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /(ALT_AND_ADDR3)/) && ($VD_alt_dial =~ /ALT/) ) ) { + $addr3_dial_skip=0; $VD_address3=''; $stmtA="SELECT address3,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$VD_lead_id';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -919,9 +947,120 @@ sub process_request { $sthA->finish(); if (length($VD_address3)>5) { - $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ADDR3',user='',priority='20';"; - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + if ($VD_use_internal_dnc =~ /Y/) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_address3';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_dnc_count = "$aryA[0]"; + } + $sthA->finish(); + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ADDR3',user='',priority='20';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$VD_alt_dial='ADDR3';} + } + if ( ( ($VD_auto_alt_dial =~ /(EXTENDED_ONLY)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /(ALT_AND_EXTENDED)/) && ($VD_alt_dial =~ /ALT/) ) || ( ($VD_auto_alt_dial =~ /ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED/) && ($VD_alt_dial =~ /ADDR3/) ) || ( ($VD_auto_alt_dial =~ /(EXTENDED)/) && ($VD_alt_dial =~ /X/) && ($VD_alt_dial !~ /XLAST/) ) ) + { + if ($VD_alt_dial =~ /ADDR3/) {$Xlast=0;} + else + {$Xlast = $VD_alt_dial;} + $Xlast =~ s/\D//gi; + if (length($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + $stmtA="SELECT gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$VD_lead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_gmt_offset_now = "$aryA[1]"; + $VD_state = "$aryA[2]"; + $VD_list_id = "$aryA[3]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + $alt_dial_phones_count=0; + $stmtA="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$VD_lead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $alt_dial_phones_count = "$aryA[0]"; + } + $sthA->finish(); + + while ( ($alt_dial_phones_count > 0) && ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmtA="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$VD_lead_id' and alt_phone_count='$Xlast';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_altdial_id = "$aryA[0]"; + $VD_altdial_phone = "$aryA[1]"; + $VD_altdial_active = "$aryA[2]"; + } + else + {$Xlast=9999999999;} + $sthA->finish(); + + if ($VD_altdial_active =~ /Y/) + { + if ($VD_use_internal_dnc =~ /Y/) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_dnc_count = "$aryA[0]"; + } + $sthA->finish(); + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count eq '$Xlast') + {$Xlast = 'LAST';} + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='X$Xlast',user='',priority='15';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|X$Xlast|$VD_altdial_id|"; &agi_output;} + $Xlast=9999999999; + } + else + {if ($AGILOG) {$agi_string = "-- VDH alt dial is DNC|X$Xlast|$VD_altdial_phone|"; &agi_output;}} + } } } } diff --git a/bin/VICIDIAL_IN_new_leads_file.pl b/bin/VICIDIAL_IN_new_leads_file.pl index 733f7d2e..bcff839b 100644 --- a/bin/VICIDIAL_IN_new_leads_file.pl +++ b/bin/VICIDIAL_IN_new_leads_file.pl @@ -16,10 +16,10 @@ # - Added option to force a gmt value(field after COMMENTS field) # 60616-0958 - Added listID override feature to force all leads into same list # 60807-1003 - Changed to DBI -# - changed to use /etc/astguiclient.conf for configs -# 60906-1055 - added filter of non-digits in alt_phone field -# 60913-1236 - fixed MySQL bugs and non-debug bug -# - added duplicate check flag option within same list +# - Changed to use /etc/astguiclient.conf for configs +# 60906-1055 - Added filter of non-digits in alt_phone field +# 60913-1236 - Fixed MySQL bugs and non-debug bug +# - Added duplicate check flag option within same list # 61127-1132 - Added new DST methods # 61128-1037 - Added postal codes GMT lookup option # 70510-1518 - Added campaign and system duplicate check and phonecode override @@ -27,9 +27,10 @@ # 70815-2128 - Added entry_date to import leads format (field 26) # 80128-0105 - Fixed bugs in file loading # 80428-0320 - UTF8 update -# 80713-0023 - added last_local_call_time field default of 2008-01-01 -# 80730-1607 - added minicsv format -# 80812-1204 - added FTP grab options and summary email options +# 80713-0023 - Added last_local_call_time field default of 2008-01-01 +# 80730-1607 - Added minicsv format +# 80812-1204 - Added FTP grab options and summary email options +# 80829-2301 - Added multi-alt-phone entry insertion capability # $secX = time(); @@ -137,8 +138,8 @@ if (length($ARGV[0])>1) print "\n"; print "This script takes in lead files in the following order when they are placed in the $PATHhome/LEADS_IN directory to be imported into the vicidial_list table (examples):\n\n"; print "standard:\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|called_count|status|entry_date\n"; - print "3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS|2|B|2007-08-09 00:00:00\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|called_count|status|entry_date|multi-alt-entries\n"; + print "3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS|2|B|2007-08-09 00:00:00|7275551212_1_work!7275551213_61_sister house!7275551214_44_neighbor\n\n"; print "minicsv:\n"; print "address1,city,name,phone_number,state,postal_code\n"; print "\"105 Fifth St\",\"Steinhatchee\",\"Frank Smith\",\"3525556601\",\"FL\",\"32359\"\n\n"; @@ -310,6 +311,7 @@ $dir2 = "$PATHhome/LEADS_IN/DONE"; if ($ftp_pull > 0) { + $i=0; use Net::FTP; $files_copied_count=0; @@ -350,6 +352,7 @@ if ($ftp_pull > 0) } +$i=0; @FILES=@MT; opendir(FILE, "$dir1/"); @FILES = readdir(FILE); @@ -381,453 +384,548 @@ foreach(@FILES) `cp -f $dir1/$FILES[$i] $dir2/$source$FILES[$i]`; - ### open the in file for reading ### - open(infile, "$dir2/$source$FILES[$i]") - || die "Can't open $source$FILES[$i]: $!\n"; + ### open the in file for reading ### + open(infile, "$dir2/$source$FILES[$i]") + || die "Can't open $source$FILES[$i]: $!\n"; -### Grab Server values from the database -$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -@aryA = $sthA->fetchrow_array; -$DBSERVER_GMT = $aryA[0]; -if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} -$sthA->finish(); - - $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";} - - - $a=0; ### each line of input file counter ### - $b=0; ### status of 'APPROVED' counter ### - $c=0; ### status of 'DECLINED' counter ### - $d=0; ### status of 'REFERRED' counter ### - $e=0; ### status of 'ERROR' counter ### - $f=0; ### number of 'DUPLICATE' counter ### - - $multi_insert_counter=0; - $multistmt=''; - -#if ($DB) - while () - { - @m=@MT; -# print "$a| $number\n"; - $number = $_; - chomp($number); -# $number =~ s/,/\|/gi; - $number =~ s/\t/\|/gi; - $number =~ s/\'|\t|\r|\n|\l//gi; - $number =~ s/\'|\t|\r|\n|\l//gi; - $number =~ s/\",,,,,,,\"/\|\|\|\|\|\|\|/gi; - $number =~ s/\",,,,,,\"/\|\|\|\|\|\|/gi; - $number =~ s/\",,,,,\"/\|\|\|\|\|/gi; - $number =~ s/\",,,,\"/\|\|\|\|/gi; - $number =~ s/\",,,\"/\|\|\|/gi; - $number =~ s/\",,\"/\|\|/gi; - $number =~ s/\",\"/\|/gi; - $number =~ s/\"//gi; - @m = split(/\|/, $number); - - -# This is the format for the minicsv lead files -#"105 Fifth St","Steinhatchee","Frank Smith","3525556601","FL","32359" - if ($format =~ /minicsv/) - { - @name=@MT; - $vendor_lead_code = ''; - $source_code = ''; - $list_id = '995'; - $phone_code = '1'; - $phone_number = $m[3]; chomp($phone_number); $phone_number =~ s/\D//gi; - $USarea = substr($phone_number, 0, 3); - $title = ''; - $full_name = $m[2]; @name = split(/ /, $full_name); - $first_name = $name[1]; chomp($first_name); - $last_name = "$name[0] $name[2]"; chomp($first_name); - $middle_initial = ''; - $address1 = $m[0]; chomp($address1); - $address2 = ''; - $address3 = ''; - $city = $m[1]; chomp($city); - $state = $m[4]; chomp($state); - $province = ''; - $postal_code = $m[5]; chomp($postal_code); - $country = 'USA'; - $gender = 'U'; - $date_of_birth = '0000-00-00'; - $alt_phone = ''; - $email = ''; - $security_phrase = ''; - $comments = ''; - $called_count = 0; - $status = 'NEW'; - } -# This is the format for the standard lead files -#3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS - else - { - $vendor_lead_code = $m[0]; chomp($vendor_lead_code); - $source_code = $m[1]; chomp($source_code); $source_id = $source_code; - $list_id = $m[2]; chomp($list_id); - $phone_code = $m[3]; chomp($phone_code); $phone_code =~ 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); - $first_name = $m[6]; chomp($first_name); - $middle_initial = $m[7]; chomp($middle_initial); - $last_name = $m[8]; chomp($last_name); - $address1 = $m[9]; chomp($address1); - $address2 = $m[10]; chomp($address2); - $address3 = $m[11]; chomp($address3); - $city = $m[12]; chomp($city); - $state = $m[13]; chomp($state); - $province = $m[14]; chomp($province); - $postal_code = $m[15]; chomp($postal_code); - $country = $m[16]; chomp($country); - $gender = $m[17]; - $date_of_birth = $m[18]; - $alt_phone = $m[19]; chomp($alt_phone); $alt_phone =~ s/\D//gi; - $email = $m[20]; - $security_phrase = $m[21]; - $comments = $m[22]; - $called_count = $m[23]; $called_count =~ s/\D|\r|\n|\t//gi; if (length($called_count)<1) {$called_count=0;} - $status = $m[24]; $status =~ s/ |\r|\n|\t//gi; if (length($status)<1) {$status='NEW';} - $insert_date = $m[25]; $insert_date =~ s/\r|\n|\t|[a-zA-Z]//gi; if (length($insert_date)<6) {$insert_date=$pulldate0;} - if ($insert_date =~ /\//) - { - @iD = split(/\//, $insert_date); - $iD[0] = sprintf("%02d", $iD[0]); - $iD[1] = sprintf("%02d", $iD[1]); - $insert_date = "$iD[2]-$iD[0]-$iD[1]"; - } - } - - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - if (length($forcephonecode) > 0) - { - $phone_code = $forcephonecode; # set phone_code to override value - } - - if ($DBX) {print "$a|$phone_number\n";} - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if ($dupchecksys > 0) - { - $dup_lead=0; - $stmtA = "select count(*) from vicidial_list where phone_number='$phone_number';"; - if($DBX){print STDERR "\n|$stmtA|\n";} + ### Grab Server values from the database + $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $dup_lead = $aryA[0]; - $dup_lead_list=$list_id; - } + @aryA = $sthA->fetchrow_array; + $DBSERVER_GMT = $aryA[0]; + if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} $sthA->finish(); - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if ($dupcheck > 0) - { - $dup_lead=0; - $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $dup_lead_list = $aryA[0]; - $dup_lead++; - } - $sthA->finish(); - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if ($dupcheckcamp > 0) - { - $dup_lead=0; - $dup_lists=''; - $stmtA = "select count(*) from vicidial_lists where list_id='$list_id';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - @aryA = $sthA->fetchrow_array; - $ci_recs = $aryA[0]; - $sthA->finish(); - if ($ci_recs > 0) - { - $stmtA = "select campaign_id from vicidial_lists where list_id='$list_id';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - @aryA = $sthA->fetchrow_array; - $dup_camp = $aryA[0]; - $sthA->finish(); + $LOCAL_GMT_OFF = $SERVER_GMT; + $LOCAL_GMT_OFF_STD = $SERVER_GMT; - $stmtA = "select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $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) + 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";} + + + $a=0; ### each line of input file counter ### + $b=0; ### status of 'APPROVED' counter ### + $c=0; ### status of 'DECLINED' counter ### + $d=0; ### status of 'REFERRED' counter ### + $e=0; ### status of 'ERROR' counter ### + $f=0; ### number of 'DUPLICATE' counter ### + $g=0; ### number of leads with multi-alt-entries + + $multi_insert_counter=0; + $multistmt=''; + + #if ($DB) + while () + { + @m=@MT; + # print "$a| $number\n"; + $number = $_; + chomp($number); + # $number =~ s/,/\|/gi; + $number =~ s/\t/\|/gi; + $number =~ s/\'|\t|\r|\n|\l//gi; + $number =~ s/\'|\t|\r|\n|\l//gi; + $number =~ s/\",,,,,,,\"/\|\|\|\|\|\|\|/gi; + $number =~ s/\",,,,,,\"/\|\|\|\|\|\|/gi; + $number =~ s/\",,,,,\"/\|\|\|\|\|/gi; + $number =~ s/\",,,,\"/\|\|\|\|/gi; + $number =~ s/\",,,\"/\|\|\|/gi; + $number =~ s/\",,\"/\|\|/gi; + $number =~ s/\",\"/\|/gi; + $number =~ s/\"//gi; + @m = split(/\|/, $number); + + + # This is the format for the minicsv lead files + #"105 Fifth St","Steinhatchee","Frank Smith","3525556601","FL","32359" + if ($format =~ /minicsv/) { - @aryA = $sthA->fetchrow_array; - $dup_lists .= "'$aryA[0]',"; - $rec_count++; + @name=@MT; + $vendor_lead_code = ''; + $source_code = ''; + $list_id = '995'; + $phone_code = '1'; + $phone_number = $m[3]; chomp($phone_number); $phone_number =~ s/\D//gi; + $USarea = substr($phone_number, 0, 3); + $title = ''; + $full_name = $m[2]; @name = split(/ /, $full_name); + $first_name = $name[1]; chomp($first_name); + $last_name = "$name[0] $name[2]"; chomp($first_name); + $middle_initial = ''; + $address1 = $m[0]; chomp($address1); + $address2 = ''; + $address3 = ''; + $city = $m[1]; chomp($city); + $state = $m[4]; chomp($state); + $province = ''; + $postal_code = $m[5]; chomp($postal_code); + $country = 'USA'; + $gender = 'U'; + $date_of_birth = '0000-00-00'; + $alt_phone = ''; + $email = ''; + $security_phrase = ''; + $comments = ''; + $called_count = 0; + $status = 'NEW'; } - $sthA->finish(); - - chop($dup_lists); - $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $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) + # This is the format for the standard lead files + #3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS + else { - @aryA = $sthA->fetchrow_array; - $dup_lead_list = "'$aryA[0]',"; - $rec_count++; - $dup_lead=1; - } - $sthA->finish(); - } - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } + $vendor_lead_code = $m[0]; chomp($vendor_lead_code); + $source_code = $m[1]; chomp($source_code); $source_id = $source_code; + $list_id = $m[2]; chomp($list_id); + $phone_code = $m[3]; chomp($phone_code); $phone_code =~ 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); + $first_name = $m[6]; chomp($first_name); + $middle_initial = $m[7]; chomp($middle_initial); + $last_name = $m[8]; chomp($last_name); + $address1 = $m[9]; chomp($address1); + $address2 = $m[10]; chomp($address2); + $address3 = $m[11]; chomp($address3); + $city = $m[12]; chomp($city); + $state = $m[13]; chomp($state); + $province = $m[14]; chomp($province); + $postal_code = $m[15]; chomp($postal_code); + $country = $m[16]; chomp($country); + $gender = $m[17]; + $date_of_birth = $m[18]; + $alt_phone = $m[19]; chomp($alt_phone); $alt_phone =~ s/\D//gi; + $email = $m[20]; + $security_phrase = $m[21]; + $comments = $m[22]; + $called_count = $m[23]; $called_count =~ s/\D|\r|\n|\t//gi; if (length($called_count)<1) {$called_count=0;} + $status = $m[24]; $status =~ s/ |\r|\n|\t//gi; if (length($status)<1) {$status='NEW';} + $insert_date = $m[25]; $insert_date =~ s/\r|\n|\t|[a-zA-Z]//gi; if (length($insert_date)<6) {$insert_date=$pulldate0;} + if ($insert_date =~ /\//) + { + @iD = split(/\//, $insert_date); + $iD[0] = sprintf("%02d", $iD[0]); + $iD[1] = sprintf("%02d", $iD[1]); + $insert_date = "$iD[2]-$iD[0]-$iD[1]"; + } + $multi_alt_phones = $m[26]; - if ( (length($phone_number)>6) && ($dup_lead < 1) ) - { - $phone_list .= "$phone_number$US$list_id|"; - # set default values - $modify_date = ""; - $user = ""; - $called_since_last_reset='N'; - $gmt_offset = '0'; + $map_count=0; + if (length($multi_alt_phones)>4) + { + @map=@MT; @ALTm_phone_code=@MT; @ALTm_phone_number=@MT; @ALTm_phone_note=@MT; + @map = split(/\!/, $multi_alt_phones); + $map_count = ($#map +1); + if ($DBX) {print "multi-al-entry: $a|$map_count|$multi_alt_phones\n";} + $g++; + $r=0; + while ($r < $map_count) + { + @ncn=@MT; + @ncn = split(/\_/, $map[$r]); + print "$ncn[0]|$ncn[1]|$ncn[2]"; - if ($forcegmt > 0) - { - $gmt_offset = $m[23]; # set GMT offset value to 24th field value - } - else - { - $postalgmt_found=0; - if ( ($postalgmt > 0) && (length($postal_code)>4) ) - { - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[2]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[3]; - $dst_range = $aryA[4]; - $PC_processed++; - $rec_count++; - $postalgmt_found++; - if ($DBX) {print " Postal GMT record found for $postal_code: |$gmt_offset|$dst|$dst_range|\n";} + if (length($forcephonecode) > 0) + {$ALTm_phone_code[$r] = $forcephonecode;} + else + {$ALTm_phone_code[$r] = $ncn[1];} + if (length($ALTm_phone_code[$r]) < 1) + {$ALTm_phone_code[$r]='1';} + $ALTm_phone_number[$r] = $ncn[0]; + $ALTm_phone_note[$r] = $ncn[2]; + $r++; } - $sthA->finish(); - } - } - if ($postalgmt_found < 1) - { - $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";} - $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; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### 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";} - $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; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### 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";} - $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; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### 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";} - $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; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); } } - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($area_GMT - $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 ); + if (length($forcelistid) > 0) + { + $list_id = $forcelistid; # set list_id to override value + } + if (length($forcephonecode) > 0) + { + $phone_code = $forcephonecode; # set phone_code to override value + } + + if ($DBX) {print "$a|$phone_number\n";} + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if ($dupchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where phone_number='$phone_number';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if ($dupcheck > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if ($dupcheckcamp > 0) + { + $dup_lead=0; + $dup_lists=''; + + $stmtA = "select count(*) from vicidial_lists where list_id='$list_id';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $ci_recs = $aryA[0]; + $sthA->finish(); + if ($ci_recs > 0) + { + $stmtA = "select campaign_id from vicidial_lists where list_id='$list_id';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $dup_camp = $aryA[0]; + $sthA->finish(); + + $stmtA = "select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $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; + $dup_lists .= "'$aryA[0]',"; + $rec_count++; + } + $sthA->finish(); + + chop($dup_lists); + $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $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; + $dup_lead_list = "'$aryA[0]',"; + $rec_count++; + $dup_lead=1; + } + $sthA->finish(); + } + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$phone_number$US$list_id\|/) + {$dup_lead++;} + } + } + + if ( (length($phone_number)>6) && ($dup_lead < 1) ) + { + $phone_list .= "$phone_number$US$list_id|"; + # set default values + $modify_date = ""; + $user = ""; + $called_since_last_reset='N'; + $gmt_offset = '0'; + + if ($forcegmt > 0) + { + $gmt_offset = $m[23]; # set GMT offset value to 24th field value + } + else + { + $postalgmt_found=0; + if ( ($postalgmt > 0) && (length($postal_code)>4) ) + { + if ($phone_code =~ /^1$/) + { + $stmtA = "select * from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $gmt_offset = $aryA[2]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[3]; + $dst_range = $aryA[4]; + $PC_processed++; + $rec_count++; + $postalgmt_found++; + if ($DBX) {print " Postal GMT record found for $postal_code: |$gmt_offset|$dst|$dst_range|\n";} + } + $sthA->finish(); + } + } + if ($postalgmt_found < 1) + { + $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";} + $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; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### 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";} + $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; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### 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";} + $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; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + ### 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";} + $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; + $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; + $dst = $aryA[5]; + $dst_range = $aryA[6]; + $PC_processed++; + $rec_count++; + } + $sthA->finish(); + } + } + + ### Find out if DST to raise the gmt offset ### + $AC_GMT_diff = ($area_GMT - $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 =~ /SSM-FSN/) ) + { + if ($DBX) {print " Second Sunday March to First Sunday November\n";} + &USACAN_dstcalc; + if ($DBX) {print " DST: $USACAN_DST\n";} + if ($USACAN_DST) {$gmt_offset++;} + $AC_processed++; + } + if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) + { + if ($DBX) {print " First Sunday April to Last Sunday October\n";} + &NA_dstcalc; + if ($DBX) {print " DST: $NA_DST\n";} + if ($NA_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) && ($dst_range =~ /TSO-LSF/) ) + { + if ($DBX) {print " Third Sunday October to Last Sunday February\n";} + &BZL_dstcalc; + if ($DBX) {print " DST: $BZL_DST\n";} + if ($BZL_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 ($map_count > 0) + { + $stmtZ = "INSERT INTO vicidial_list values('','$insert_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','$called_count','2008-01-01 00:00:00');"; + if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n"; + $lead_id = $dbhA->{'mysql_insertid'}; + if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";} + $c++; + + $r=0; $s=0; + while ($r < $map_count) + { + $s++; + $stmtZ = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');"; + if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n"; + # $alt_phone_id = $dbhA->{'mysql_insertid'}; + if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";} + $r++; + } + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good lead into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$insert_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','$called_count','2008-01-01 00:00:00');"; + if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n"; + if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";} + + $multistmt=''; + $multi_insert_counter=0; + $c++; + } + else + { + $multistmt .= "('','$insert_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','$called_count','2008-01-01 00:00:00'),"; + $multi_insert_counter++; + } + } + $b++; + } + else + { + if ($dup_lead > 0) + {print "DUPLICATE: $phone_number|$list_id|$dup_lead_list|$a\n"; $f++;} + else + {print "BAD Home_Phone: $phone_number|$vendor_id|$a\n"; $e++;} + } - $AC_processed=0; + $a++; - if ( (!$AC_processed) && ($dst_range =~ /SSM-FSN/) ) - { - if ($DBX) {print " Second Sunday March to First Sunday November\n";} - &USACAN_dstcalc; - if ($DBX) {print " DST: $USACAN_DST\n";} - if ($USACAN_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &NA_dstcalc; - if ($DBX) {print " DST: $NA_DST\n";} - if ($NA_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) && ($dst_range =~ /TSO-LSF/) ) - { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} - &BZL_dstcalc; - if ($DBX) {print " DST: $BZL_DST\n";} - if ($BZL_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 ($a =~ /100$/i) {print STDERR "0 $a\r";} + if ($a =~ /200$/i) {print STDERR "+ $a\r";} + if ($a =~ /300$/i) {print STDERR "| $a\r";} + if ($a =~ /400$/i) {print STDERR "\\ $a\r";} + if ($a =~ /500$/i) {print STDERR "- $a\r";} + if ($a =~ /600$/i) {print STDERR "/ $a\r";} + if ($a =~ /700$/i) {print STDERR "| $a\r";} + if ($a =~ /800$/i) {print STDERR "+ $a\r";} + if ($a =~ /900$/i) {print STDERR "0 $a\r";} + if ($a =~ /000$/i) {print "$a|$b|$c|$d|$e|$f|$g|$phone_number|\n";} } - if ($multi_insert_counter > 8) + + if (length($multistmt) > 10) { + chop($multistmt); ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$insert_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','$called_count','2008-01-01 00:00:00');"; + $stmtZ = "INSERT INTO vicidial_list values$multistmt;"; if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n"; if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";} @@ -835,80 +933,38 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC $multi_insert_counter=0; $c++; } - else - { - $multistmt .= "('','$insert_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','$called_count','2008-01-01 00:00:00'),"; - $multi_insert_counter++; - } - - $b++; - } - else - { - if ($dup_lead > 0) - {print "DUPLICATE: $phone_number|$list_id|$dup_lead_list|$a\n"; $f++;} - else - {print "BAD Home_Phone: $phone_number|$vendor_id|$a\n"; $e++;} - } - - $a++; - - if ($a =~ /100$/i) {print STDERR "0 $a\r";} - if ($a =~ /200$/i) {print STDERR "+ $a\r";} - if ($a =~ /300$/i) {print STDERR "| $a\r";} - if ($a =~ /400$/i) {print STDERR "\\ $a\r";} - if ($a =~ /500$/i) {print STDERR "- $a\r";} - if ($a =~ /600$/i) {print STDERR "/ $a\r";} - if ($a =~ /700$/i) {print STDERR "| $a\r";} - if ($a =~ /800$/i) {print STDERR "+ $a\r";} - if ($a =~ /900$/i) {print STDERR "0 $a\r";} - if ($a =~ /000$/i) {print "$a|$b|$c|$d|$e|$phone_number|\n";} - - } - -if (length($multistmt) > 10) - { - chop($multistmt); - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt;"; - if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n"; - if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";} - - $multistmt=''; - $multi_insert_counter=0; - $c++; - } - ### open the stats out file for writing ### - open(Sout, ">>$VDHLOGfile") - || die "Can't open $VDHLOGfile: $!\n"; + ### open the stats out file for writing ### + open(Sout, ">>$VDHLOGfile") + || die "Can't open $VDHLOGfile: $!\n"; - ### close file handler and DB connections ### - $Falert = "\n\nTOTALS FOR $FILEname:\n"; - $Falert .= "Lines in lead file: $a\n"; - $Falert .= "INSERTED: $b\n"; - $Falert .= "INSERT STATEMENTS: $c\n"; - $Falert .= "ERROR: $e\n"; - if ($f > 0) - {$Falert .= "DUPLICATES: $f\n";} + ### close file handler and DB connections ### + $Falert = "\n\nTOTALS FOR $FILEname:\n"; + $Falert .= "Lines in lead file: $a\n"; + $Falert .= "INSERTED: $b\n"; + $Falert .= "INSERT STATEMENTS: $c\n"; + $Falert .= "ERROR: $e\n"; + $Falert .= "MULTI-ALT-PHONE: $g\n"; + if ($f > 0) + {$Falert .= "DUPLICATES: $f\n";} - print "$Falert"; - print Sout "$Falert"; - $Ealert .= "$Falert"; + print "$Falert"; + print Sout "$Falert"; + $Ealert .= "$Falert"; - close(infile); - close(Sout); - chmod 0777, "$VDHLOGfile"; + close(infile); + close(Sout); + chmod 0777, "$VDHLOGfile"; - ### Move file to the DONE directory locally - if (!$T) {`mv -f $dir1/$FILEname $dir2/$FILEname`;} + ### Move file to the DONE directory locally + if (!$T) {`mv -f $dir1/$FILEname $dir2/$FILEname`;} } } - $i++; -} + $i++; + } $dbhA->disconnect(); diff --git a/docs/ALTERNATE_NUMBER_DIALING.txt b/docs/ALTERNATE_NUMBER_DIALING.txt index 3640bf8f..48ae7ae7 100644 --- a/docs/ALTERNATE_NUMBER_DIALING.txt +++ b/docs/ALTERNATE_NUMBER_DIALING.txt @@ -1,3 +1,68 @@ +ALTERNATE NUMBER DIALING Redesign 2008-08-20 + +*** THIS SECTION OUTLINES PROPOSED CHANGES TO ALT-NUMBER-DIALING in the 2.0.5 version *** +*** FOR INFORMATION ON THE 2.0.3 AND 2.0.4 VERSION OF ALT NUMBER DIALING LOOK BELOW THIS SECTION *** + + +In order to allow for more alt-numbers per lead to dial we built a new method of storing and dialing alt-numbers for leads. + +CLI lead loader will be changed to allow for the importation of upto 65,000 phone numbers per lead. The new file format is shown below. + +vicidial.php agent screen and vdc_db_query.php scripts have been changed to allow for alt-number display and setting alt numbers to inactive if needed. + +AST_VDauto_dial.pl, AST_VDauto_dial_FILL.pl and the VDhangup process in FastAGI_log.pl have all been modified to work with the new alt number data structure. + +non_agent_api.php needs to be changed to accept new multiple-al-numbers per inserted lead. + + +File structure for CLI lead loader goes here: + +standard + +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|called_count|status|entry_date|multi-alt-entries + +3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS|2|B|2007-08-09 00:00:00|7275551212_1_work!7275551213_61_sister house!7275551214_44_neighbor + +The multi-alt-entries field is formatted as a field of phone-number/phone-code/phone-note set of data(phone code and alt_note are both optional and the phone code can be overridden by the force phone code flag). The record delimiter is an exclamation point with the optional phone code and note delimited within the record by an underscore character _. + + + +Changes to database: +*** DO NOT MAKE THESE CHANGES, for documentation only *** + +CREATE TABLE vicidial_list_alt_phones ( +alt_phone_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +lead_id INT(9) UNSIGNED NOT NULL, +phone_code VARCHAR(10), +phone_number VARCHAR(18), +alt_phone_note VARCHAR(30), +alt_phone_count SMALLINT(5) UNSIGNED, +active ENUM('Y','N') default 'Y', +index (lead_id), +index (phone_number) +); + +ALTER TABLE vicidial_hopper MODIFY alt_dial VARCHAR(6) default 'NONE'; + +ALTER TABLE vicidial_auto_calls MODIFY alt_dial VARCHAR(6) default 'NONE'; + +ALTER TABLE vicidial_campaigns MODIFY auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3','ALT_AND_EXTENDED','ALT_AND_ADDR3_AND_EXTENDED','EXTENDED_ONLY') default 'NONE'; + +ALTER TABLE vicidial_log ADD alt_dial VARCHAR(6) default 'NONE'; + +ALTER TABLE vicidial_campaigns ADD agent_extended_alt_dial ENUM('Y','N') default 'N'; + +UPDATE system_settings SET db_schema_version='1104'; + + + + + + + + + + ALTERNATE NUMBER DIALING Summary and Overview 2007-01-15 *** ALTERNATE NUMBER DIALING IN AUTODIAL MODE HAS BEEN ADDED IN THE 2.0.3 RELEASE *** diff --git a/docs/QC_PROCESS.txt b/docs/QC_PROCESS.txt index 807bccb2..f53f14ef 100644 --- a/docs/QC_PROCESS.txt +++ b/docs/QC_PROCESS.txt @@ -19,6 +19,11 @@ The back-end process will work like this: +Agent-side scripts: + - qc.php - the screen that agents log in to + - qc_query.php - the data processing script that handles most of the AJAX queries and IFRAME displays from qc.php + + The QC agent will login to the new qc.php screen within the agc web directory. They will then have a screen very similar to the vicidial.php login screen(but in a different color) that will have a user/pass to fill in. Then when they login the QC agents with level of 1-3 will see a green screen similar to the vicidial.php inbound(CLOSER-type) screen that will show them their allowable qc inbound-groups and campaigns. The agent will then choose which in-groups and campaigns that they want to QC the records for and then they will submit and they will be logged-in to the QC system. QC agents with a qc_level of 4-5 can select to review first level reccords, review all 2nd level records, review only 2nd level changed-status or review 2nd level same-status records. QC agents with 6-7 qc_level can also have the option of entering a management screen showing more information on the QC system including committing QC records and links to QC reports. Upon login, they will be able to see the count of QC-able records and they can click on a link to bring up the next record to be QCd. diff --git a/docs/REQUIRED_APPS_INSTALL.txt b/docs/REQUIRED_APPS_INSTALL.txt index df2c802a..3eb31d1c 100644 --- a/docs/REQUIRED_APPS_INSTALL.txt +++ b/docs/REQUIRED_APPS_INSTALL.txt @@ -52,6 +52,7 @@ install Net::Telnet install Time::HiRes install Net::Server install Switch +install Mail::Sendmail install Unicode::Map install Jcode install Spreadsheet::WriteExcel diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index 8dc60cb2..cf10835c 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -449,6 +449,7 @@ following modules first: (say YES if asked to install prerequisites) - install Time::HiRes - install Net::Server - install Switch + - install Mail::Sendmail - install Unicode::Map (needed for super list loader Excel) - install Jcode (needed for super list loader Excel) - install Spreadsheet::WriteExcel (needed for super list loader Excel) diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 01f260b5..317f6fcd 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -290,7 +290,7 @@ user VARCHAR(20), list_id BIGINT(14) UNSIGNED NOT NULL, gmt_offset_now DECIMAL(4,2) DEFAULT '0.00', state VARCHAR(2) default '', -alt_dial ENUM('NONE','ALT','ADDR3') default 'NONE', +alt_dial VARCHAR(6) default 'NONE', priority TINYINT(2) default '0', index (lead_id) ); @@ -340,7 +340,7 @@ call_time DATETIME, call_type ENUM('IN','OUT','OUTBALANCE') default 'OUT', stage VARCHAR(20) default 'START', last_update_time TIMESTAMP, -alt_dial ENUM('NONE','MAIN','ALT','ADDR3') default 'NONE', +alt_dial VARCHAR(6) default 'NONE', queue_priority TINYINT(2) default '0', index (uniqueid), index (callerid), @@ -365,6 +365,7 @@ comments VARCHAR(255), processed ENUM('Y','N'), user_group VARCHAR(20), term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE', +alt_dial VARCHAR(6) default 'NONE', index (lead_id), index (call_date) ); @@ -543,7 +544,7 @@ adaptive_latest_server_time VARCHAR(4) default '2100', adaptive_intensity VARCHAR(6) default '0', adaptive_dl_diff_target SMALLINT(3) default '0', concurrent_transfers ENUM('AUTO','1','2','3','4','5','6','7','8','9','10') default 'AUTO', -auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3') default 'NONE', +auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3','ALT_AND_EXTENDED','ALT_AND_ADDR3_AND_EXTENDED','EXTENDED_ONLY') default 'NONE', auto_alt_dial_statuses VARCHAR(255) default ' B N NA DC -', agent_pause_codes_active ENUM('Y','N') default 'N', campaign_description VARCHAR(255), @@ -580,7 +581,10 @@ survey_response_digit_map VARCHAR(255) default '1-DEMOCRAT|2-REPUBLICAN|3-INDEPE survey_xfer_exten VARCHAR(20) default '8300', survey_camp_record_dir VARCHAR(255) default '/home/survey', disable_alter_custphone ENUM('Y','N') default 'Y', -display_queue_count ENUM('Y','N') default 'Y' +display_queue_count ENUM('Y','N') default 'Y', +manual_dial_filter VARCHAR(50) default 'NONE', +agent_clipboard_copy VARCHAR(50) default 'NONE', +agent_extended_alt_dial ENUM('Y','N') default 'N' ); CREATE TABLE vicidial_lists ( @@ -1184,6 +1188,18 @@ index (event_section), index (record_id) ); +CREATE TABLE vicidial_list_alt_phones ( +alt_phone_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +lead_id INT(9) UNSIGNED NOT NULL, +phone_code VARCHAR(10), +phone_number VARCHAR(18), +alt_phone_note VARCHAR(30), +alt_phone_count SMALLINT(5) UNSIGNED, +active ENUM('Y','N') default 'Y', +index (lead_id), +index (phone_number) +); + ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP; ALTER TABLE live_channels ENGINE=HEAP; @@ -1238,5 +1254,5 @@ INSERT INTO vicidial_shifts SET shift_id='24HRMIDNIGHT',shift_name='24 hours 7 d UPDATE system_settings SET qc_last_pull_time=NOW(); -UPDATE system_settings SET db_schema_version='1101'; +UPDATE system_settings SET db_schema_version='1104'; diff --git a/extras/performance_test_alt_multi.txt b/extras/performance_test_alt_multi.txt new file mode 100644 index 00000000..54617b69 --- /dev/null +++ b/extras/performance_test_alt_multi.txt @@ -0,0 +1,14 @@ +100001|10001|993|1|9999060010|MR|I|Q|SMITH01|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060449|test@test.com|nothing|COMMENTS||||9999061507_1_work +100002|10002|993|1|9999060011|MR|I|Q|SMITH02|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060349|test@test.com|nothing|COMMENTS||||9999061407_1_work!9999060010_1_sister house!7275551214_44_neighbor +100003|10003|993|1|9999060012|MR|I|Q|SMITH03|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060249|test@test.com|nothing|COMMENTS||||9999061307_1_work +100004|10004|993|1|9999060013|MR|I|Q|SMITH04|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999061049|test@test.com|nothing|COMMENTS||||9999061207_1_work!9999060009_1_sister house!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work!9999060107_1_work +100005|10005|993|1|9999060014|MR|I|Q|SMITH05|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060149|test@test.com|nothing|COMMENTS||||9999061107__airport +100006|10006|993|1|9999060015|MR|I|Q|SMITH06|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060039|test@test.com|nothing|COMMENTS||||9999061017__!9999060020__summer home +100007|10007|993|1|9999060016|MR|I|Q|SMITH07|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060939|test@test.com|nothing|COMMENTS||||9999060907_1_work +100008|10008|993|1|9999060017|MR|I|Q|SMITH08|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060839|test@test.com|nothing|COMMENTS||||9999060817_1_!9999060200_1_garage +100009|10009|993|1|9999060018|MR|I|Q|SMITH09|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060739|test@test.com|nothing|COMMENTS||||9999060707_1_work +100010|10010|993|1|9999060019|MR|I|Q|SMITH10|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060639|test@test.com|nothing|COMMENTS||||9999060607_1_work +100011|10011|993|1|9999060020|MR|I|Q|SMITH11|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060539|test@test.com|nothing|COMMENTS||||9999060507_1_work +100012|10012|993|1|9999060021|MR|I|Q|SMITH12|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060439|test@test.com|nothing|COMMENTS||||9999060407_1_work +100013|10013|993|1|9999060022|MR|I|Q|SMITH13|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060339|test@test.com|nothing|COMMENTS||||9999060309_1_work +100014|10014|993|1|9999060023|MR|I|Q|SMITH13|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|9999060239|test@test.com|nothing|COMMENTS||||9999060207_1_work diff --git a/extras/test_VICIDIAL_lead_file.txt b/extras/test_VICIDIAL_lead_file.txt index 80da05c8..04ecc30f 100644 --- a/extras/test_VICIDIAL_lead_file.txt +++ b/extras/test_VICIDIAL_lead_file.txt @@ -1,13 +1,14 @@ -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 -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 -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 -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 -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 -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 -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 +100001|10001|107|1|7275551213|MR|I|Q|SMITH01|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100002|10002|107|1|7275551213|MR|I|Q|SMITH02|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS||||7275551212_1_work!7275551213_61_sister house!7275551214_44_neighbor +100003|10003|107|1|7275551213|MR|I|Q|SMITH03|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS||||7275551212_1_work +100004|10004|107|1|7275551213|MR|I|Q|SMITH04|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS||||7275551212_1_work!7275551213_61_sister house +100005|10005|107|1|7275551213|MR|I|Q|SMITH05|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS||||7275551212__airport +100006|10006|107|1|7275551213|MR|I|Q|SMITH06|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS||||7275551212__!7275551213__summer home +100007|10007|107|1|7275551213|MR|I|Q|SMITH07|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100008|10008|107|1|7275551213|MR|I|Q|SMITH08|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS||||7275551212_1_!7275551213_1_garage +100009|10009|107|1|7275551213|MR|I|Q|SMITH09|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100010|10010|107|1|7275551213|MR|I|Q|SMITH10|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100011|10011|107|1|7275551213|MR|I|Q|SMITH11|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100012|10012|107|1|7275551213|MR|I|Q|SMITH12|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100013|10013|107|1|7275551213|MR|I|Q|SMITH13|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| +100014|10014|107|1|7275551213|MR|I|Q|SMITH14|249 MUNDON ROAD|||MALDON|FL||33709|USA|M|1970-01-01|7275551212|test@test.com|nothing|COMMENTS|||| diff --git a/extras/upgrade_2.0.5.sql b/extras/upgrade_2.0.5.sql index 6bcd4302..1f6cd2ff 100644 --- a/extras/upgrade_2.0.5.sql +++ b/extras/upgrade_2.0.5.sql @@ -340,3 +340,32 @@ ALTER TABLE vicidial_status_categories ADD sale_category ENUM('Y','N') default ' ALTER TABLE vicidial_status_categories ADD dead_lead_category ENUM('Y','N') default 'N'; UPDATE system_settings SET db_schema_version='1102'; + +ALTER TABLE vicidial_campaigns ADD manual_dial_filter VARCHAR(50) default 'NONE'; +ALTER TABLE vicidial_campaigns ADD agent_clipboard_copy VARCHAR(50) default 'NONE'; + +UPDATE system_settings SET db_schema_version='1103'; + +CREATE TABLE vicidial_list_alt_phones ( +alt_phone_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +lead_id INT(9) UNSIGNED NOT NULL, +phone_code VARCHAR(10), +phone_number VARCHAR(18), +alt_phone_note VARCHAR(30), +alt_phone_count SMALLINT(5) UNSIGNED, +active ENUM('Y','N') default 'Y', +index (lead_id), +index (phone_number) +); + +ALTER TABLE vicidial_hopper MODIFY alt_dial VARCHAR(6) default 'NONE'; + +ALTER TABLE vicidial_auto_calls MODIFY alt_dial VARCHAR(6) default 'NONE'; + +ALTER TABLE vicidial_campaigns MODIFY auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3','ALT_AND_EXTENDED','ALT_AND_ADDR3_AND_EXTENDED','EXTENDED_ONLY') default 'NONE'; + +ALTER TABLE vicidial_log ADD alt_dial VARCHAR(6) default 'NONE'; + +ALTER TABLE vicidial_campaigns ADD agent_extended_alt_dial ENUM('Y','N') default 'N'; + +UPDATE system_settings SET db_schema_version='1104'; diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt index da362283..ddeeaa3f 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt @@ -235,6 +235,13 @@ QC Shift -<\/B> This is the shift timeframe used to pull QC records for an inbou The Sale Category and Dead Lead Category are both used by the List Suggestion system when analyzing list statistics.|| Sale Category: || Dead Lead Category: || +Manual Dial Filter -<\/B> This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists|| +Manual Dial Filter: || +Agent Screen Clipboard Copy -<\/B> THIS FEATURE IS CURRENTLY ONLY ENABLED FOR INTERNET EXPLORER. This feature allows you to select a field that will be copied to the computer clipboard of the agent computer upon a call being sent to an agent. Common uses for this are to allow for easy pasting of account numbers or phone numbers into legacy client applications on the agent computer|| +Agent Screen Clipboard Copy|| +EXTENDED alternate numbers are numbers loaded into the system outside of the standard lead information screen. Using EXTENDED you can have hundreds of phone numbers for a single customer record.|| +Agent Screen Extended Alt Dial -<\/B> This feature allows for agents to access extended alternate phone numbers for leads beyond the standard Alt Phone and Address3 fields that can be used in VICIDIAL for phone numbers beyond the main phone number. The Extended phone numbers can be dialed automatically using the Auto-Alt-Dial feature in VICIDIAL Campaign settings, but enabling this Agent Screen feature will also allow for the agent to call these numbers from their agent screen as well as edit their information|| +Agent Screen Extended Alt Dial:|| ############################################################ CLIENT @@ -261,6 +268,16 @@ Amount of time you have been logged-in: || You logged-in at:|| Click LOGOUT below to log-out|| Undefined|| +This phone number is not in the campaign lists|| +Unspecified error|| +Extended Alt Phone Information: || +ALT DIAL NUMBER:|| +Phone Code and Number:|| +Notes: || +Active: || +Alt Count: || +Change this phone number to INACTIVE|| +Change this phone number to ACTIVE|| ############################################################ MANAGER Manual diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 8d1be9e2..71029cc7 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -72,6 +72,7 @@ # - $LogouTKicKAlL - ('0','1'); # - $closer_blended = ('0','1'); # - $inOUT = ('IN','OUT'); +# - $manual_dial_filter = ('NONE','CAMPLISTS','DNC','CAMPLISTS_DNC'); # CHANGELOG: # 50629-1044 - First build of script @@ -156,10 +157,12 @@ # 80713-0624 - Added vicidial_list.last_local_call_time field # 80717-1604 - Modified logging function to use inOUT to determine call direction and place to log # 80719-1147 - Changed recording conf prefix +# 80815-1019 - Added manual dial list restriction option +# 80831-0545 - Added extended alt dial number info display support # -$version = '2.0.5-79'; -$build = '80719-1147'; +$version = '2.0.5-81'; +$build = '80831-0545'; require("dbconnect.php"); @@ -298,6 +301,10 @@ if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"]; elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} +if (isset($_GET["manual_dial_filter"])) {$manual_dial_filter=$_GET["manual_dial_filter"];} + elseif (isset($_POST["manual_dial_filter"])) {$manual_dial_filter=$_POST["manual_dial_filter"];} +if (isset($_GET["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} + elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -585,7 +592,7 @@ if ($ACTION == 'manDiaLnextCaLL') { if (strlen($phone_number)>3) { - if ($use_internal_dnc=='Y') + if (ereg("DNC",$manual_dial_filter)) { $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; $rslt=mysql_query($stmt, $link); @@ -598,6 +605,33 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (ereg("CAMPLISTS",$manual_dial_filter)) + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; + $rslt=mysql_query($stmt, $link); + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_lists++;} + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + + $stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + + if ($row[0] < 1) + { + echo "NUMBER NOT IN CAMPLISTS\n"; + exit; + } + } if ($stage=='lookup') { $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; @@ -932,6 +966,33 @@ if ($ACTION == 'manDiaLnextCaLL') } +################################################################################ +### alt_phone_change - change alt phone numbers to active and inactive +### +################################################################################ +if ($ACTION == 'alt_phone_change') +{ + $MT[0]=''; + $row=''; $rowx=''; + $channel_live=1; + if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) || (strlen($phone_number)<1) ) + { + $channel_live=0; + echo "ALT PHONE NUMBER STATUS NOT CHANGED\n"; + echo "$phone_number $stage $lead_id or $called_count is not valid\n"; + exit; + } + else + { + $stmt = "UPDATE vicidial_list_alt_phones set active='$stage' where lead_id='$lead_id' and phone_number='$phone_number' and alt_phone_count='$called_count';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + echo "ALT PHONE NUMBER STATUS CHANGED\n"; + } +} + + ################################################################################ ### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was ### previewed in the step above and puts it back in orig status @@ -1174,7 +1235,7 @@ if ($stage == "start") $user_group = trim("$row[0]"); } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1357,22 +1418,14 @@ if ($stage == "end") $auto_alt_dial =$row[0]; } else {$auto_alt_dial = 'NONE';} - if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) + if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial)) { ### check to see if lead should be alt_dialed - $stmt="SELECT alt_dial FROM vicidial_auto_calls where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VAC_mancall_ct = mysql_num_rows($rslt); - if ($VAC_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $alt_dial =$row[0]; - } - else {$alt_dial = 'NONE';} + if (strlen($alt_dial)<2) {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { + $alt_dial_skip=0; $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -1388,14 +1441,38 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (ereg("Y",$VD_use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + else + {$alt_dial_skip=1;} } + else + {$alt_dial_skip=1;} + if ($alt_dial_skip > 0) + {$alt_dial='ALT';} } + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { + $addr3_dial_skip=0; $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -1411,10 +1488,111 @@ if ($stage == "end") else {$address3 = '';} if (strlen($address3)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; - if ($DB) {echo "$stmt\n";} + if (ereg("Y",$VD_use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + ### insert record into vicidial_hopper for address3 call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + else + {$addr3_dial_skip=1;} + } + else + {$addr3_dial_skip=1;} + if ($addr3_dial_skip > 0) + {$alt_dial='ADDR3';} + } + + # $fp = fopen ("./alt_multi_log.txt", "a"); + # fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n"); + # fclose($fp); + + if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) ) + { + if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;} + else + {$Xlast = ereg_replace("[^0-9]","",$alt_dial);} + if (strlen($Xlast)<1) + {$Xlast=0;} + $VD_altdialx=''; + + $stmt="SELECT gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VL_deailts_ct = mysql_num_rows($rslt); + if ($VL_deailts_ct > 0) + { + $row=mysql_fetch_row($rslt); + $EA_gmt_offset_now = $row[0]; + $EA_state = $row[1]; + $EA_list_id = $row[2]; + } + $alt_dial_phones_count=0; + $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_dial_phones_count = $row[0]; + } + while ( ($alt_dial_phones_count > 0) and ($alt_dial_phones_count > $Xlast) ) + { + $Xlast++; + $stmt="SELECT alt_phone_id,phone_number,active FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Xlast';"; $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLAP_detail_ct = mysql_num_rows($rslt); + if ($VLAP_detail_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_altdial_id = $row[0]; + $VD_altdial_phone = $row[1]; + $VD_altdial_active = $row[2]; + } + else + {$Xlast=9999999999;} + + if (ereg("Y",$VD_altdial_active)) + { + if (ereg("Y",$VD_use_internal_dnc)) + { + $stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VLAP_dnc_ct = mysql_num_rows($rslt); + if ($VLAP_dnc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VD_alt_dnc_count = $row[0]; + } + } + else {$VD_alt_dnc_count=0;} + if ($VD_alt_dnc_count < 1) + { + if ($alt_dial_phones_count == $Xlast) + {$Xlast = 'LAST';} + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $Xlast=9999999999; + } + } } } } @@ -1800,6 +1978,12 @@ if ($ACTION == 'VDADcheckINCOMING') $MT[0]=''; $row=''; $rowx=''; $channel_live=1; + $alt_phone_code=''; + $alt_phone_number=''; + $alt_phone_note=''; + $alt_phone_active=''; + $alt_phone_count=''; + if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { $channel_live=0; @@ -1982,6 +2166,31 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[0]; $dialed_label =$row[1]; } + if (ereg('X',$dialed_label)) + { + if (ereg('LAST',$dialed_label)) + { + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;"; + } + else + { + $Talt_dial = ereg_replace("[^0-9]","",$dialed_label); + $stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';"; + } + + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $VLAP_ct = mysql_num_rows($rslt); + if ($VLAP_ct > 0) + { + $row=mysql_fetch_row($rslt); + $alt_phone_code = $row[0]; + $alt_phone_number = $row[1]; + $alt_phone_note = $row[2]; + $alt_phone_active = $row[3]; + $alt_phone_count = $row[4]; + } + } } else { @@ -2101,6 +2310,11 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; $LeaD_InfO .= $source_id . "\n"; + $LeaD_InfO .= $alt_phone_code . "\n"; + $LeaD_InfO .= $alt_phone_number . "\n"; + $LeaD_InfO .= $alt_phone_note . "\n"; + $LeaD_InfO .= $alt_phone_active . "\n"; + $LeaD_InfO .= $alt_phone_count . "\n"; echo $LeaD_InfO; diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index b2dc8e78..f9dcf747 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -185,10 +185,13 @@ # 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording # 80709-0358 - Added Default alt phone dial hard-code option # 80719-1147 - Changed recording and senddtmf conf prefix +# 80815-1014 - Added manual dial list restriction option +# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) +# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls # -$version = '2.0.5-163'; -$build = '80719-1147'; +$version = '2.0.5-166'; +$build = '80831-0548'; require("dbconnect.php"); @@ -788,7 +791,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the campaign settings - $stmt="SELECT 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,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT 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,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -827,6 +830,9 @@ $VDloginDISPLAY=0; $xfer_groups = $row[32]; $disable_alter_custphone = $row[33]; $display_queue_count = $row[34]; + $manual_dial_filter = $row[35]; + $CopY_tO_ClipboarD = $row[36]; + if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -1983,7 +1989,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var vdc_customer_date_format = ''; var vdc_header_phone_format = ''; var disable_alter_custphone = ''; + var manual_dial_filter = ''; + var CopY_tO_ClipboarD = ''; var inOUT = 'OUT'; + var useIE = ''; + var random = ''; var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Resume\""; @@ -3016,7 +3026,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Insert or update the vicidial_log entry for a customer call function DialLog(taskMDstage) { - if (taskMDstage == "start") {var MDlogEPOCH = 0;} + if (taskMDstage == "start") + { + var MDlogEPOCH = 0; + var UID_test = document.vicidial_form.uniqueid.value; + if (UID_test.length < 4) + { + UID_test = epoch_sec + '.' + random; + document.vicidial_form.uniqueid.value = UID_test; + } + } else { if (alt_phone_dialing == 1) @@ -3058,7 +3077,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&DB=0"; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -3560,7 +3579,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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 + "&use_internal_dnc=" + use_internal_dnc + "&omit_phone_code=" + omit_phone_code; + 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 + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter; + // alert(manual_dial_filter + "\n" +manDiaLnext_query); xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -3569,20 +3589,42 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(xmlhttp.responseText); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - if ( (MDnextCID == "HOPPER EMPTY") || (MDnextCID == "DNC NUMBER") ) - { - 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);} - - document.getElementById("DiaLControl").innerHTML = "\"Dial"; + var regMNCvar = new RegExp("HOPPER","ig"); + var regMDFvarDNC = new RegExp("DNC","ig"); + var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) + { + var alert_displayed=0; + alt_phone_dialing=starting_alt_phone_dialing; + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + + if (MDnextCID.match(regMNCvar)) + {alert("No more leads in the hopper for campaign:\n" + campaign); alert_displayed=1;} + if (MDnextCID.match(regMDFvarDNC)) + {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCAMP)) + {alert("This phone number is not in the campaign lists:\n" + mdnPhonENumbeR); alert_displayed=1;} + if (alert_displayed==0) + {alert("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) + { + document.getElementById("DiaLControl").innerHTML = "\"Dial"; + } + else + { + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + reselect_alt_dial = 0; + } } else { @@ -3636,7 +3678,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} var gIndex = 0; if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} @@ -3911,6 +3953,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WebFormRefresH(''); } } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NUMBER: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NUMBER: ADDRESS3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NUMBER: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Phone Code and Number: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Change this phone number to INACTIVE";} + else + {EAactive_link = "Change this phone number to ACTIVE";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count: " + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notes:
" + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } + var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -4126,6 +4190,55 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Check to see if there is a call being sent from the auto-dialer to agent conf + function alt_phone_change(APCphone,APCcount,APCleadID,APCactive) + { + + var EAactive_link = ''; + if (APCactive == 'Y') + {EAactive_link = "Change this phone number to INACTIVE";} + else + {EAactive_link = "Change this phone number to ACTIVE";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(APC_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + // ################################################################################ // Check to see if there is a call being sent from the auto-dialer to agent conf @@ -4272,6 +4385,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_number = check_VDIC_array[36]; dialed_label = check_VDIC_array[37]; source_id = check_VDIC_array[38]; + EAphone_code = check_VDIC_array[39]; + EAphone_number = check_VDIC_array[40]; + EAalt_phone_notes = check_VDIC_array[41]; + EAalt_phone_active = check_VDIC_array[42]; + EAalt_phone_count = check_VDIC_array[43]; var gIndex = 0; if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} @@ -4281,8 +4399,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; var status_display_number = phone_number_format(dispnum); + var callnum = dialed_number; + var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -4294,6 +4414,27 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("CBcommentsBoxD").innerHTML = "Comments:
" + CBcomments; showDiv('CBcommentsBox'); } + if (dialed_label == 'ALT') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NUMBER: ALT ";} + if (dialed_label == 'ADDR3') + {document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NUMBER: ADDRESS3 ";} + var REGalt_dial = new RegExp("X","g"); + if (dialed_label.match(REGalt_dial)) + { + document.getElementById("CusTInfOSpaN").innerHTML = " ALT DIAL NUMBER: " + dialed_label + ""; + document.getElementById("EAcommentsBoxA").innerHTML = "Phone Code and Number: " + EAphone_code + " " + EAphone_number; + + var EAactive_link = ''; + if (EAalt_phone_active == 'Y') + {EAactive_link = "Change this phone number to INACTIVE";} + else + {EAactive_link = "Change this phone number to ACTIVE";} + + document.getElementById("EAcommentsBoxB").innerHTML = "Active: " + EAalt_phone_active + "
" + EAactive_link; + document.getElementById("EAcommentsBoxC").innerHTML = "Alt Count: " + EAalt_phone_count; + document.getElementById("EAcommentsBoxD").innerHTML = "Notes: " + EAalt_phone_notes; + showDiv('EAcommentsBox'); + } if (VDIC_data_VDIG[1].length > 0) { @@ -4332,7 +4473,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} var genderIndex = document.getElementById("gender_list").selectedIndex; var genderValue = document.getElementById('gender_list').options[genderIndex].value; @@ -4430,6 +4571,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); } + if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) ) + { + var tmp_clip = document.getElementById(CopY_tO_ClipboarD); + window.clipboardData.setData('Text', tmp_clip.value) + } + } else { @@ -4445,17 +4592,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // refresh the content of the web form URL - function WebFormRefresH(taskrefresh) + function WebFormRefresH(taskrefresh,submittask) { if (VDCL_group_id.length > 1) {var group = VDCL_group_id;} else {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} + if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - var genderIndex = document.getElementById("gender_list").selectedIndex; - var genderValue = document.getElementById('gender_list').options[genderIndex].value; - document.vicidial_form.gender.value = genderValue; + if (submittask != 'YES') + { + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + document.vicidial_form.gender.value = genderValue; + } web_form_vars = "lead_id=" + document.vicidial_form.lead_id.value + @@ -5073,7 +5223,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} LeaDDispO = DispoChoice; - WebFormRefresH(); + WebFormRefresH('NO','YES'); window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); @@ -5177,6 +5327,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { manual_dial_finished(); } + document.getElementById("GENDERhideFORie").innerHTML = ''; hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); @@ -5186,6 +5337,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("DispoSelectHAspan").innerHTML = "Hangup Again"; CBcommentsBoxhide(); + EAcommentsBoxhide(); AgentDispoing = 0; @@ -6074,6 +6226,27 @@ function phone_number_format(formatphone) { } +// ################################################################################ +// Hide the EAcommentsBox span upon click + function EAcommentsBoxhide(minimizetask) + { + hideDiv('EAcommentsBox'); + if (minimizetask=='YES') + {showDiv('EAcommentsMinBox');} + else + {hideDiv('EAcommentsMinBox');} + } + + +// ################################################################################ +// Show the EAcommentsBox span upon click + function EAcommentsBoxshow() + { + showDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); + } + + // ################################################################################ // Populating the date field in the callback frame prior to submission function CB_date_pick(taskdate) @@ -6194,6 +6367,8 @@ else { hideDiv('NothingBox'); hideDiv('CBcommentsBox'); + hideDiv('EAcommentsBox'); + hideDiv('EAcommentsMinBox'); hideDiv('HotKeyActionBox'); hideDiv('HotKeyEntriesBox'); hideDiv('MainPanel'); @@ -6277,6 +6452,7 @@ else wrapup_waiting=1; } CustomerData_update(); + document.getElementById("GENDERhideFORie").innerHTML = ''; showDiv('DispoSelectBox'); DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; @@ -6849,7 +7025,8 @@ else .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;} .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99} .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77} - .cust_form {font-family: sans-serif; font-size: 10px; overflow: auto} + .cust_form {font-family: sans-serif; font-size: 10px; overflow: hidden} + .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto} --> @@ -7055,7 +7232,31 @@ Your Status:
Calls Dialing: + + height=70> + + + + + + +
Extended Alt Phone Information: minimize
+
+
+
+
+ +
+
+ + + + + +
maximize
Alt Phone Info
+
+ + height=500>
Noone is in your session:
Go Back

@@ -7063,7 +7264,7 @@ Your Status:
Calls Dialing: + height=500>
Customer has hung up:
Go Back

@@ -7072,7 +7273,7 @@ Your Status:
Calls Dialing: + height=550>
Call Wrapup: seconds remaining in wrapup



@@ -7081,28 +7282,28 @@ Your Status:
Calls Dialing: + height=500>
Your session has been disabled
LOGOUT

Go Back
- + height=500>

LOGOUT
- +
- +
 
- + height=47>
Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call.
- + height=460>
DISPOSITION CALL :       Hangup Again       minimize
End-of-call Disposition Selection
@@ -7115,7 +7316,7 @@ Your Status:
Calls Dialing: + height=460>
SELECT A PAUSE CODE :
Pause Code Selection @@ -7123,7 +7324,7 @@ Your Status:
Calls Dialing: + height=460>
Select a CallBack Date :
@@ -7176,7 +7377,7 @@ Your Status:
Calls Dialing: + height=460> - +"; echo ""; @@ -707,25 +720,27 @@ $HTbegin = "|"; $HDstation = "------------+"; $HTstation = " STATION |"; $HDphone = "------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "--------------------+"; -$HTuser = " USER |"; +$HTuser = " USER |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; $HTbarge = " BARGE |"; $HDstatus = "----------+"; $HTstatus = " STATUS |"; +$HDcustphone = "------------+"; +$HTcustphone = " CUST PHONE |"; $HDserver_ip = "-----------------+"; $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; @@ -734,6 +749,11 @@ if ($PHONEdisplay < 1) $HDphone = ''; $HTphone = ''; } +if ($CUSTPHONEdisplay < 1) + { + $HDcustphone = ''; + $HTcustphone = ''; + } if ($UGdisplay < 1) { $HDusergroup = ''; @@ -759,8 +779,8 @@ if ($SERVdisplay < 1) -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n"; +$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n"; $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -820,7 +840,7 @@ $talking_to_print = mysql_num_rows($rslt); } $callerids=''; -$stmt="select callerid from vicidial_auto_calls;"; +$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $calls_to_list = mysql_num_rows($rslt); @@ -831,6 +851,8 @@ $calls_to_list = mysql_num_rows($rslt); { $row=mysql_fetch_row($rslt); $callerids .= "$row[0]|"; + $VAClead_ids[$i] = $row[1]; + $VACphones[$i] = $row[2]; $i++; } } @@ -889,6 +911,14 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount=0; while ($j < $talking_to_print) { + $n=0; + $custphone=''; + while ($n < $calls_to_list) + { + if ( (ereg("$VAClead_ids[$n]", $Alead_id[$j])) and (strlen($VAClead_ids[$n]) == strlen($Alead_id[$j])) ) + {$custphone = $VACphones[$n];} + $n++; + } $phone_split = explode("-----",$Alogin[$j]); $i = $phone_split[1]; @@ -918,6 +948,7 @@ $calls_to_list = mysql_num_rows($rslt); } $phone = sprintf("%-10s", $phone_split[0]); + $custphone = sprintf("%-10s", $custphone); $Luser = $Auser[$i]; $user = sprintf("%-18s", $Auser[$i]); $Lsessionid = $Asessionid[$i]; @@ -1056,6 +1087,9 @@ $calls_to_list = mysql_num_rows($rslt); if ($SIPmonitorLINK>1) {$R=" | BARGE";} if ($IAXmonitorLINK>1) {$R=" | BARGE";} + if ($CUSTPHONEdisplay > 0) {$CP = " $G$custphone$EG |";} + else {$CP = "";} + if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} @@ -1087,7 +1121,7 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "| $G$extension$EG |$phoneD $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; $j++; } diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 40d03ef0..11ca9281 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -779,6 +779,12 @@ if (isset($_GET["sale_category"])) {$sale_category=$_GET["sale_category"];} elseif (isset($_POST["sale_category"])) {$sale_category=$_POST["sale_category"];} if (isset($_GET["dead_lead_category"])) {$dead_lead_category=$_GET["dead_lead_category"];} elseif (isset($_POST["dead_lead_category"])) {$dead_lead_category=$_POST["dead_lead_category"];} +if (isset($_GET["manual_dial_filter"])) {$manual_dial_filter=$_GET["manual_dial_filter"];} + elseif (isset($_POST["manual_dial_filter"])) {$manual_dial_filter=$_POST["manual_dial_filter"];} +if (isset($_GET["agent_clipboard_copy"])) {$agent_clipboard_copy=$_GET["agent_clipboard_copy"];} + elseif (isset($_POST["agent_clipboard_copy"])) {$agent_clipboard_copy=$_POST["agent_clipboard_copy"];} +if (isset($_GET["agent_extended_alt_dial"])) {$agent_extended_alt_dial=$_GET["agent_extended_alt_dial"];} + elseif (isset($_POST["agent_extended_alt_dial"])) {$agent_extended_alt_dial=$_POST["agent_extended_alt_dial"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -986,6 +992,7 @@ $display_queue_count = ereg_replace("[^NY]","",$display_queue_count); $qc_show_recording = ereg_replace("[^NY]","",$qc_show_recording); $sale_category = ereg_replace("[^NY]","",$sale_category); $dead_lead_category = ereg_replace("[^NY]","",$dead_lead_category); +$agent_extended_alt_dial = ereg_replace("[^NY]","",$agent_extended_alt_dial); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); @@ -1112,6 +1119,8 @@ $survey_opt_in_audio_file = ereg_replace("[^-\_0-9a-zA-Z]","",$survey_opt_in_aud $survey_ni_audio_file = ereg_replace("[^-\_0-9a-zA-Z]","",$survey_ni_audio_file); $survey_method = ereg_replace("[^-\_0-9a-zA-Z]","",$survey_method); $alter_custphone_override = ereg_replace("[^-\_0-9a-zA-Z]","",$alter_custphone_override); +$manual_dial_filter = ereg_replace("[^-\_0-9a-zA-Z]","",$manual_dial_filter); +$agent_clipboard_copy = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_clipboard_copy); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -1350,11 +1359,15 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir); # 80715-1130 - Added Recycle leads limit count # 80719-1351 - Changed QC settings in campaigns and In-Groups # 80809-2305 - Added Sale and Dead Lead categories to status categories page +# 80815-1036 - Added manual dial filter to capaigns +# 80823-2124 - Added copy to clipboard campaign option +# 80829-2359 - Added EXTENDED auto_alt_dial options +# 80831-0406 - Added agent screen extended alt-dial option to campaigns # # 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 -$admin_version = '2.0.5-137'; -$build = '80809-2305'; +$admin_version = '2.0.5-141'; +$build = '80831-0406'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2596,7 +2609,7 @@ echo "
CLOSER INBOUND GROUP SELECTION
Closer Inbound Group Selection
@@ -7187,7 +7388,7 @@ Your Status:
Calls Dialing: + Channel Channel @@ -7293,7 +7494,7 @@ RECORD ID:
  State:   PostCode:
Province:   Vendor ID:   Gender:   Vendor ID:   Gender:
Phone: @@ -7320,7 +7521,7 @@ else \n";} + {echo "\n";} else {echo "\n";} ?> diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index ffdcaa41..34dd23a8 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -36,6 +36,7 @@ # 80525-1040 - Added IVR status display and summary for inbound calls # 80619-2047 - Added DISPO status for post-call-work while paused # 80704-0543 - Added DEAD status for agents INCALL with no live call +# 80822-1222 - Added option for display of customer phone number # header ("Content-type: text/html; charset=utf-8"); @@ -79,6 +80,8 @@ if (isset($_GET["CALLSdisplay"])) {$CALLSdisplay=$_GET["CALLSdisplay"];} elseif (isset($_POST["CALLSdisplay"])) {$CALLSdisplay=$_POST["CALLSdisplay"];} if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} +if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} + elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### @@ -105,6 +108,7 @@ if (!isset($orderby)) {$orderby='timeup';} if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes +if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes function get_server_load($windows = false) { $os = strtolower(PHP_OS); @@ -258,7 +262,7 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; +echo"\n"; echo "VICIDIAL: Time On VDAD Campaign: $group\n"; echo "
\n"; echo "VICIDIAL Campaign: \n"; @@ -274,6 +278,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; echo "\n"; } echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; if ($group == 'XXXX-ALL-ACTIVE-XXXX') { echo "       MODIFY | \n"; @@ -466,47 +471,55 @@ echo "
"; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + echo "+ VIEW MORE SETTINGS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; + echo "       VIEW USER GROUP"; } if ($UidORname>0) { - echo "       SHOW AGENT ID"; + echo "       SHOW AGENT ID"; } else { - echo "       SHOW AGENT NAME"; + echo "       SHOW AGENT NAME"; } if ($SERVdisplay>0) { - echo "       HIDE SERVER INFO"; + echo "       HIDE SERVER INFO"; } else { - echo "       SHOW SERVER INFO"; + echo "       SHOW SERVER INFO"; } if ($CALLSdisplay>0) { - echo "       HIDE WAITING CALLS"; + echo "       HIDE WAITING CALLS"; } else { - echo "       SHOW WAITING CALLS"; + echo "       SHOW WAITING CALLS"; } if ($PHONEdisplay>0) { - echo "       HIDE PHONES"; + echo "       HIDE PHONES"; } else { - echo "       SHOW PHONES"; + echo "       SHOW PHONES"; + } +if ($CUSTPHONEdisplay>0) + { + echo "       HIDE CUSTPHONES"; + } +else + { + echo "       SHOW CUSTPHONES"; } echo "

-Auto Alt-Number Dialing - This setting is used to automatically dial alternate number fields while dialing in the RATIO and ADAPT dial methods when there is no contact at the main phone number for a lead, the NA, B, DC and N statuses. This setting is not used by the MANUAL dial method. +Auto Alt-Number Dialing - This setting is used to automatically dial alternate number fields while dialing in the RATIO and ADAPT dial methods when there is no contact at the main phone number for a lead, the NA, B, DC and N statuses. This setting is not used by the MANUAL dial method. EXTENDED alternate numbers are numbers loaded into the system outside of the standard lead information screen. Using EXTENDED you can have hundreds of phone numbers for a single customer record.
@@ -2794,6 +2807,21 @@ echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -10858,6 +10889,13 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($campaign_allow_inbound == 'Y') { echo "
Manual Dial List ID - The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only. +
+ +
+Manual Dial Filter - This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists. + +
+
+
+Agent Screen Clipboard Copy - THIS FEATURE IS CURRENTLY ONLY ENABLED FOR INTERNET EXPLORER. This feature allows you to select a field that will be copied to the computer clipboard of the agent computer upon a call being sent to an agent. Common uses for this are to allow for easy pasting of account numbers or phone numbers into legacy client applications on the agent computer. + +
+
+
+Agent Screen Extended Alt Dial - This feature allows for agents to access extended alternate phone numbers for leads beyond the standard Alt Phone and Address3 fields that can be used in VICIDIAL for phone numbers beyond the main phone number. The Extended phone numbers can be dialed automatically using the Auto-Alt-Dial feature in VICIDIAL Campaign settings, but enabling this Agent Screen feature will also allow for the agent to call these numbers from their agent screen as well as edit their information. +

@@ -5837,7 +5865,7 @@ if ($ADD==20) { echo "
CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,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,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,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,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,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,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,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,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -7127,7 +7155,7 @@ if ($ADD==41) if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) {$hopper_level='100';} - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -10437,6 +10465,9 @@ if ($ADD==31) $survey_camp_record_dir = $row[89]; $disable_alter_custphone = $row[90]; $display_queue_count = $row[91]; + $manual_dial_filter = $row[92]; + $agent_clipboard_copy = $row[93]; + $agent_extended_alt_dial = $row[94]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -10777,7 +10808,7 @@ if ($ADD==31) } echo " $NWB#vicidial_campaigns-queue_priority$NWE
Auto Alt-Number Dialing: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Auto Alt-Number Dialing: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Manual Dial List ID: $NWB#vicidial_campaigns-manual_dial_list_id$NWE
Manual Dial Filter: $NWB#vicidial_campaigns-manual_dial_filter$NWE
Agent Screen Clipboard Copy: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agent Screen Extended Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
Allowed Inbound Groups:
";