diff --git a/agc_2-X/trunk/bin/AST_VDhopper.pl b/agc_2-X/trunk/bin/AST_VDhopper.pl index 1b5bbb16..e26e23db 100644 --- a/agc_2-X/trunk/bin/AST_VDhopper.pl +++ b/agc_2-X/trunk/bin/AST_VDhopper.pl @@ -101,10 +101,11 @@ # 201122-1039 - Added support for daily call count limits # 201220-1032 - Changes for shared agent campaigns # 210405-1008 - Added hopper_drop_run_trigger=A option +# 210407-1704 - Modified the Hopper Drop-Run process to modify the priority and source of DROPs already in the hopper # # constants -$build = '210405-1008'; +$build = '210407-1704'; $DB=0; # Debug flag, set to 0 for no debug messages. Can be overriden with CLI --debug flag $US='__'; $MT[0]=''; @@ -2699,12 +2700,51 @@ foreach(@campaign_id) $hopperSOURCE='D'; $hopperPRIORITY='99'; + ### search for existing DROPs in the hopper, and update them if found + $HOPPER_leads=''; + $stmtA = "SELECT lead_id FROM $vicidial_hopper where campaign_id='$campaign_id[$i]' and source!='D' and priority!='99';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsL=$sthA->rows; + if ($DBX) {print "CAMPAIGN Hopper Drop-Run Existing Drops Check 1: $sthArowsL|$stmtA|\n";} + $rec_count=0; + while ($sthArowsL > $rec_count) + { + @aryA = $sthA->fetchrow_array; + if ($rec_count > 0) {$HOPPER_leads .= ',';} + $HOPPER_leads .= "'$aryA[0]'"; + $rec_count++; + } + if ($rec_count > 0) + { + $HOPPER_DROP_leads=''; + $stmtA = "SELECT lead_id FROM vicidial_list where lead_id IN($HOPPER_leads) and status IN($STATUSsql[$i]);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsLD=$sthA->rows; + if ($DBX) {print "CAMPAIGN Hopper Drop-Run Existing Drops Check 2: $sthArowsLD|$stmtA|\n";} + $rec_count=0; + while ($sthArowsLD > $rec_count) + { + @aryA = $sthA->fetchrow_array; + if ($rec_count > 0) {$HOPPER_DROP_leads .= ',';} + $HOPPER_DROP_leads .= "'$aryA[0]'"; + $rec_count++; + } + if ($rec_count > 0) + { + $stmtA = "UPDATE $vicidial_hopper SET priority='99',source='D' where lead_id IN($HOPPER_DROP_leads);"; + $affected_rowsU = $dbhA->do($stmtA); + if ($DBX) {print "CAMPAIGN Hopper Drop-Run UPDATE: $affected_rowsU|$stmtA|\n";} + } + } + $stmtA = "UPDATE vicidial_campaigns SET hopper_drop_run_trigger='N' where campaign_id='$campaign_id[$i]';"; $affected_rows = $dbhA->do($stmtA); if ($DBX) {print "CAMPAIGN Hopper Drop-Run RESET: $affected_rows|$stmtA|\n";} - if ($DB) {print "Campaign Drop-Run triggered for $campaign_id[$i]($hopper_drop_run_trigger[$i]) |$STATUSsql[$i]|$list_order_mix[$i]|$affected_rows|\n";} - $hopper_begin_output .= "Campaign Drop-Run triggered for $campaign_id[$i]($hopper_drop_run_trigger[$i]) |$STATUSsql[$i]|$list_order_mix[$i]|$affected_rows| \n"; + if ($DB) {print "Campaign Drop-Run triggered for $campaign_id[$i]($hopper_drop_run_trigger[$i]) |$STATUSsql[$i]|$list_order_mix[$i]|$affected_rows|$affected_rowsU|\n";} + $hopper_begin_output .= "Campaign Drop-Run triggered for $campaign_id[$i]($hopper_drop_run_trigger[$i]) |$STATUSsql[$i]|$list_order_mix[$i]|$affected_rows|$affected_rowsU| \n"; } ##### Get count of leads that are dialable ##### @@ -3402,7 +3442,7 @@ foreach(@campaign_id) $insert_end_output .= " DNC lead skipped: $DNCskip \n"; $insert_end_output .= " Daily call count limit lead skipped: $DCCLskip \n"; if ($DB) {print "$insert_end_output";} - $insert_end_outputSQL = ",adapt_output=\"$insert_end_output\""; + $insert_end_outputSQL = ",adapt_output=\"$hopper_begin_output\n$insert_end_output\""; } } } @@ -3410,6 +3450,7 @@ foreach(@campaign_id) # update debug output $stmtA = "UPDATE vicidial_campaign_stats_debug SET entry_time='$now_date',debug_output=\"$hopper_begin_output\"$insert_end_outputSQL where campaign_id='$campaign_id[$i]' and server_ip='HOPPER';"; $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "vicidial_campaign_stats_debug UPDATE: $affected_rows|$stmtA|\n";} $i++; } diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index 8d18dcf8..8c8a0a2d 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20210405104301 +# version: 20210407162801 users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N. @@ -146,7 +146,7 @@ campaigns-call_count_limit Call Count Limit This enforces a limit on the nu campaigns-call_count_target Call Count Target This option is only used for reporting purposes and has no effect on leads dialed. Default is 3. campaigns-daily_call_count_limit Daily Call Count Limit This feature, if enabled, will limit the number of times a lead can be called in a single day. Once a lead has reached this set limit, if the lead is selected to be dialed again, the called-since-last-reset flag on the lead will be changed to -Y- and the call will not be dialed. If you want to raise this daily limit during the day, you might need to reset your lists to be able to dial the leads that hit the previous limit earlier in the day. This feature may conflict with Auto-Alt-Dial features if they are enabled on a campaign. Default is 0 for disabled. settings-daily_limit_manual Daily Call Limit Manual If the Daily Call Count Limit is enabled, this setting will determine if manual dial calls will be counted and or restricted in the daily call count limit. The DISABLED option will not count manual dial calls or restrict them as part of the daily call count limits, only auto-dial calls would be counted restricted. If one of the COUNT options is used, then manual dial calls would be included in the daily call counts. If one of the RESTRICT options is used, then manual dial calls would be restricted as part of the daily call count limit. Default is DISABLED. -campaigns-hopper_drop_run_trigger Hopper Drop-Run Trigger This setting, if activated, will ignore all hopper loading criteria for a single hopper run for this campaign and it will only load the DROP status leads from the active lists for the campaign into the hopper at the highest hopper priority, and once this single hopper run has happened, this setting will reset to N for this campaign and the hopper loading will go back to normal for the next minute when it runs. If the -All Drops- checkbox is checked, then any status with -DROP- in the status or status name will be selected, including all system statuses and campaign statuses whether they are for outbound or inbound calls. WARNING, when this runs it will not check to see if the lists have been reset, so you may be calling back DROP leads that were recently called. However, if the Drop Lockout Time has been enabled, that setting will be honored. Default is N, unselected, for inactive. +campaigns-hopper_drop_run_trigger Hopper Drop-Run Trigger This setting, if activated, will ignore all hopper loading criteria for a single hopper run for this campaign and it will only load the DROP status leads from the active lists for the campaign into the hopper at the highest hopper priority, and once this single hopper run has happened, this setting will reset to N for this campaign and the hopper loading will go back to normal for the next minute when it runs. This process will also update any DROPs already in the hopper to the highest hopper priority if they are not already there. If the -All Drops- checkbox is checked, then any status with -DROP- in the status or status name will be selected, including all system statuses and campaign statuses whether they are for outbound or inbound calls. WARNING, when this runs it will not check to see if the lists have been reset, so you may be calling back DROP leads that were recently called. However, if the Drop Lockout Time has been enabled, that setting will be honored. Default is N, unselected, for inactive. campaigns-drop_lockout_time Drop Lockout Time This is a number of hours that DROP abandon calls will be prevented from being dialed, to disable set to 0. This setting is very useful in countries like the UK where there are regulations preventing the attempted calling of customers within 72 hours of an Abandon, or DROP. Default is 0. campaigns-force_reset_hopper Force Reset of Hopper This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. campaigns-dial_method Dial Method This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift -as defined by call_time selected for campaign- and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods. You cannot change the Auto Dial Level if you are in any of the ADAPT dial methods. Only the Dialer can change the dial level when in predictive dialing mode. INBOUND_MAN allows the agent to place manual dial calls from a campaign list while being able to take inbound calls between manual dial calls.