Added campaign setting to filter ANYONE Scheduled Callbacks by the DNC settings set in the campaign
git-svn-id: svn://192.168.202.10@3038 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -357,6 +357,9 @@ OTHER CHANGES:
|
||||
and mute buttons in the LIVE CALLS IN YOUR SESSION panel during a 3-way
|
||||
call.
|
||||
|
||||
99. Added campaign setting to filter ANYONE Scheduled Callbacks by the DNC
|
||||
settings set in the campaign
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+119
-11
@@ -91,10 +91,11 @@
|
||||
# 180111-1559 - Added anyone_callback_inactive_lists option
|
||||
# 180301-1453 - Fix to allow for commented(#) lines in filters
|
||||
# 180419-1109 - Fix for list mix to use call count limit on initial count, issue #1094
|
||||
# 180924-1734 - Added callback_dnc campaign option
|
||||
#
|
||||
|
||||
# constants
|
||||
$build = '180419-1109';
|
||||
$build = '180924-1734';
|
||||
$DB=0; # Debug flag, set to 0 for no debug messages. Can be overriden with CLI --debug flag
|
||||
$US='__';
|
||||
$MT[0]='';
|
||||
@@ -540,15 +541,121 @@ if ($CBHOLD_count > 0)
|
||||
$CAu=0;
|
||||
foreach(@CA_lead_id)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_list set status='$CA_status[$CAu]', called_since_last_reset='N' where lead_id='$CA_lead_id[$CAu]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";}
|
||||
$event_string = "|CALLBACKS LISTACT|$affected_rows|";
|
||||
&event_logger;
|
||||
$DNClead=0;
|
||||
$DNCC=0;
|
||||
$DNCL=0;
|
||||
|
||||
$stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]',user='',state='$CA_state[$CAu]',priority='50',source='C',vendor_lead_code=\"$CA_vendor_lead_code[$CAu]\";";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "ANYONE Scheduled Callback Inserted into hopper: $affected_rows|$CA_lead_id[$CAu]\n";}
|
||||
### look up callback DNC settings for campaign
|
||||
$stmtA = "SELECT callback_dnc,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc FROM vicidial_campaigns where campaign_id='$CA_campaign_id[$CAu]';";
|
||||
$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_callback_dnc = $aryA[0];
|
||||
$VD_use_internal_dnc = $aryA[1];
|
||||
$VD_use_campaign_dnc = $aryA[2];
|
||||
$VD_use_other_campaign_dnc = $aryA[3];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($VD_callback_dnc =~ /ENABLED/i)
|
||||
{
|
||||
$VD_phone_number='';
|
||||
### look up lead information
|
||||
$stmtA = "SELECT phone_number FROM vicidial_list where lead_id='$CA_lead_id[$CAu]';";
|
||||
$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_phone_number = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ( ($VD_use_internal_dnc =~ /Y/) || ($VD_use_internal_dnc =~ /AREACODE/) )
|
||||
{
|
||||
if ($VD_use_internal_dnc =~ /AREACODE/)
|
||||
{
|
||||
$pth_areacode = substr($VD_phone_number, 0, 3);
|
||||
$pth_areacode .= "XXXXXXX";
|
||||
$stmtA="SELECT count(*) FROM vicidial_dnc where phone_number IN('$VD_phone_number','$pth_areacode');";
|
||||
}
|
||||
else
|
||||
{$stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_phone_number';";}
|
||||
if ($DB) {print " Doing DNC Check: $VD_phone_number - $VD_use_internal_dnc\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;
|
||||
$DNClead = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($DNClead != '0')
|
||||
{
|
||||
$DNCL++;
|
||||
$stmtA = "UPDATE vicidial_list SET status='DNCL' where lead_id='$CA_lead_id[$CAu]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "Flagging DNC lead: $affected_rows $VD_phone_number\n";}
|
||||
|
||||
$stmtA = "UPDATE vicidial_callbacks SET status='DEAD' where lead_id='$CA_lead_id[$CAu]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "Setting Callback entry to DEAD: $affected_rows $CA_lead_id[$CAu]\n";}
|
||||
}
|
||||
}
|
||||
if ( ( ($VD_use_campaign_dnc =~ /Y/) || ($VD_use_campaign_dnc =~ /AREACODE/) ) && ($DNClead == '0') )
|
||||
{
|
||||
$temp_campaign_id = $CA_campaign_id[$CAu];
|
||||
if (length($VD_use_other_campaign_dnc) > 0) {$temp_campaign_id = $VD_use_other_campaign_dnc}
|
||||
if ($VD_use_campaign_dnc =~ /AREACODE/)
|
||||
{
|
||||
$pth_areacode = substr($VD_phone_number, 0, 3);
|
||||
$pth_areacode .= "XXXXXXX";
|
||||
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number IN('$VD_phone_number','$pth_areacode') and campaign_id='$temp_campaign_id';";
|
||||
}
|
||||
else
|
||||
{$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_phone_number' and campaign_id='$temp_campaign_id';";}
|
||||
if ($DBX) {print "$VD_use_other_campaign_dnc|$stmtA\n";}
|
||||
if ($DB) {print "Doing CAMP DNC Check: $VD_phone_number - $VD_use_campaign_dnc - $temp_campaign_id\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;
|
||||
$DNClead = ($DNClead + $aryA[0]);
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($aryA[0] != '0')
|
||||
{
|
||||
$DNCC++;
|
||||
$stmtA = "UPDATE vicidial_list SET status='DNCC' where lead_id='$CA_lead_id[$CAu]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "Flagging DNC lead: $affected_rows $VD_phone_number $CA_campaign_id[$CAu]\n";}
|
||||
|
||||
$stmtA = "UPDATE vicidial_callbacks SET status='DEAD' where lead_id='$CA_lead_id[$CAu]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "Setting Callback entry to DEAD: $affected_rows $CA_lead_id[$CAu]\n";}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($DNClead < 1)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_list set status='$CA_status[$CAu]', called_since_last_reset='N' where lead_id='$CA_lead_id[$CAu]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";}
|
||||
$event_string = "|CALLBACKS LISTACT|$affected_rows|";
|
||||
&event_logger;
|
||||
|
||||
$stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]',user='',state='$CA_state[$CAu]',priority='50',source='C',vendor_lead_code=\"$CA_vendor_lead_code[$CAu]\";";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "ANYONE Scheduled Callback Inserted into hopper: $affected_rows|$CA_lead_id[$CAu]\n";}
|
||||
}
|
||||
$CAu++;
|
||||
}
|
||||
}
|
||||
@@ -945,11 +1052,11 @@ $ANY_hopper_vlc_dup_check='N';
|
||||
|
||||
if (length($CLIcampaign)>1)
|
||||
{
|
||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check from vicidial_campaigns where campaign_id IN('$CLIcampaign');";
|
||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc,callback_dnc from vicidial_campaigns where campaign_id IN('$CLIcampaign');";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc from vicidial_campaigns where active='Y';";
|
||||
$stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check,use_other_campaign_dnc,callback_dnc from vicidial_campaigns where active='Y';";
|
||||
}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -987,6 +1094,7 @@ while ($sthArows > $rec_count)
|
||||
$call_count_limit[$rec_count] = $aryA[23];
|
||||
$hopper_vlc_dup_check[$rec_count] = $aryA[24];
|
||||
$use_other_campaign_dnc[$rec_count] = $aryA[25];
|
||||
$callback_dnc[$rec_count] = $aryA[26];
|
||||
|
||||
if ($hopper_vlc_dup_check[$rec_count] =~ /Y/)
|
||||
{$ANY_hopper_vlc_dup_check = 'Y';}
|
||||
|
||||
@@ -1011,7 +1011,8 @@ dead_trigger_url TEXT,
|
||||
scheduled_callbacks_force_dial ENUM('N','Y') default 'N',
|
||||
scheduled_callbacks_auto_reschedule VARCHAR(10) default 'DISABLED',
|
||||
scheduled_callbacks_timezones_container VARCHAR(40) default 'DISABLED',
|
||||
three_way_volume_buttons VARCHAR(20) default 'ENABLED'
|
||||
three_way_volume_buttons VARCHAR(20) default 'ENABLED',
|
||||
callback_dnc ENUM('ENABLED','DISABLED') default 'DISABLED'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_lists (
|
||||
@@ -4302,4 +4303,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1558',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1559',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -764,3 +764,7 @@ UPDATE system_settings SET db_schema_version='1557',db_schema_update_date=NOW()
|
||||
ALTER TABLE vicidial_campaigns ADD three_way_volume_buttons VARCHAR(20) default 'ENABLED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1558',db_schema_update_date=NOW() where db_schema_version < 1558;
|
||||
|
||||
ALTER TABLE vicidial_campaigns ADD callback_dnc ENUM('ENABLED','DISABLED') default 'DISABLED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1559',db_schema_update_date=NOW() where db_schema_version < 1559;
|
||||
|
||||
+14
-7
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
# version: 201809232243
|
||||
# version: 201809241726
|
||||
users-user User ID <QXZ>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.</QXZ>
|
||||
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. 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.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>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. Default is N.</QXZ>
|
||||
@@ -256,6 +256,7 @@ campaigns-callback_list_calltime Scheduled Callbacks Calltime Block <QXZ>This op
|
||||
campaigns-callback_active_limit Scheduled Callbacks Active Limit <QXZ>This option if enabled will limit an agent to this number of active or live user-only callbacks. If the limit is reached, the agent will not be able to select the My Callback checkbox when setting a callback for a lead. Default is 0 for disabled.</QXZ>
|
||||
campaigns-callback_active_limit_override Scheduled Callbacks Active Limit Override <QXZ>Enabling this option will allow the Custom User 3 field to override the Scheduled Callbacks Active Limit. Default is N for disabled.</QXZ>
|
||||
campaigns-callback_display_days Scheduled Callbacks Display Days <QXZ>Enabling this option will restrict the scheduled callbacks listings on the agent screen to showing only callbacks set to trigger a number of days from today. The -day- is a standard calendar day, so if this is set to 1, only the current callbacks for today until midnight will be displayed. Default is 0 for disabled.</QXZ>
|
||||
campaigns-callback_dnc Anyone Callbacks DNC Filter <QXZ>This option if enabled will check the ANYONE scheduled callbacks phone numbers against the DNC options that are enabled for this campaign before they are put into the hopper to be dialed. Default is DISABLED. This setting does not affect USERONLY scheduled callbacks. If you want to filter those for DNC phone numbers, you should use the Manual Dial Filter settings.</QXZ>
|
||||
campaigns-my_callback_option My Callbacks Checkbox Default <QXZ>This option allows you to pre-set the My Callback checkbox on the agent scheduled callback screen. CHECKED will check the checkbox automatically for every call. Default is UNCHECKED.</QXZ>
|
||||
campaigns-show_previous_callback Show Previous Callback <QXZ>This option if enabled will show on the agent screen with a separate yellow panel information about the previously set callback that the agent has up on their screen. Disabling this option will not show that panel. Default is ENABLED.</QXZ>
|
||||
campaigns-callback_useronly_move_minutes Scheduled Callbacks Useronly Move Minutes <QXZ>This option if set to a number greater than 0, will change all USERONLY Scheduled Callbacks that are X minutes after their callback time to ANYONE callbacks. This process runs every minute. Default is 0 for disabled.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user