Added anyone_callback_inactive_lists system setting and functionality
git-svn-id: svn://192.168.202.10@2889 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -246,6 +246,9 @@ OTHER CHANGES:
|
||||
USERONLY Scheduled Callbacks for agents in MANUAL or INBOUND_MAN
|
||||
no-hopper campaigns when they click DIAL NEXT NUMBER in the agent screen
|
||||
|
||||
65. Added "Anyone Callback Inactive Lists" System Setting option to determine
|
||||
how ANYONE scheduled callbacks from inactive lists should be handled.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+33
-8
@@ -21,7 +21,7 @@
|
||||
# - R = Recycled leads
|
||||
# - S = Standard hopper load
|
||||
#
|
||||
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGELOG
|
||||
# 50810-1613 - Added database server variable definitions lookup
|
||||
@@ -88,10 +88,11 @@
|
||||
# 150728-1050 - Added option for secondary sorting by vendor_lead_code, Issue #833
|
||||
# 150908-1544 - Added debug output for vendor_lead_code duplicate rejections count
|
||||
# 170531-0837 - Fixed issue #1019
|
||||
# 180111-1559 - Added anyone_callback_inactive_lists option
|
||||
#
|
||||
|
||||
# constants
|
||||
$build = '170531-0837';
|
||||
$build = '180111-1559';
|
||||
$DB=0; # Debug flag, set to 0 for no debug messages. Can be overriden with CLI --debug flag
|
||||
$US='__';
|
||||
$MT[0]='';
|
||||
@@ -317,6 +318,19 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
|
||||
### Grab system_settings values from the database
|
||||
$anyone_callback_inactive_lists='default';
|
||||
$stmtA = "SELECT anyone_callback_inactive_lists FROM system_settings;";
|
||||
$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;
|
||||
$anyone_callback_inactive_lists = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
### Grab Server values from the database
|
||||
$stmtA = "SELECT vd_server_logs,local_gmt FROM servers where server_ip = '$VARserver_ip';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
@@ -433,7 +447,10 @@ if ($inactive_lists_count > 0)
|
||||
chop($inactive_lists);
|
||||
if ($allow_inactive_list_leads < 1)
|
||||
{
|
||||
$stmtA = "DELETE from $vicidial_hopper where list_id IN($inactive_lists);";
|
||||
$KEEPanyone_callback_inactive_listsSQL='';
|
||||
if ($anyone_callback_inactive_lists =~ /KEEP_IN_HOPPER/i)
|
||||
{$KEEPanyone_callback_inactive_listsSQL = "and source!='C'";}
|
||||
$stmtA = "DELETE from $vicidial_hopper where list_id IN($inactive_lists) $KEEPanyone_callback_inactive_listsSQL;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "Inactive and Expired List Leads Deleted: $affected_rows |$stmtA|\n";}
|
||||
$event_string = "|INACTIVE LIST DEL|$affected_rows|";
|
||||
@@ -443,13 +460,21 @@ if ($inactive_lists_count > 0)
|
||||
|
||||
|
||||
##### BEGIN Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed
|
||||
$vcNOanyone_callback_inactive_listsSQL='';
|
||||
$vlNOanyone_callback_inactive_listsSQL='';
|
||||
if ($anyone_callback_inactive_lists =~ /NO_ADD_TO_HOPPER/i)
|
||||
{
|
||||
$vcNOanyone_callback_inactive_listsSQL = "and vicidial_callbacks.list_id NOT IN($inactive_lists)";
|
||||
$vlNOanyone_callback_inactive_listsSQL = "and vicidial_list.list_id NOT IN($inactive_lists)";
|
||||
}
|
||||
|
||||
if (length($CLIcampaign)>0)
|
||||
{
|
||||
$stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE' and campaign_id IN('$CLIcampaign');";
|
||||
$stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE' and campaign_id IN('$CLIcampaign') $vcNOanyone_callback_inactive_listsSQL;";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE';";
|
||||
$stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE' $vcNOanyone_callback_inactive_listsSQL;";
|
||||
}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -465,11 +490,11 @@ if ($CBHOLD_count > 0)
|
||||
$cba=0;
|
||||
if (length($CLIcampaign)>0)
|
||||
{
|
||||
$stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status,vendor_lead_code FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id and vicidial_callbacks.campaign_id IN('$CLIcampaign');";
|
||||
$stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status,vendor_lead_code FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id and vicidial_callbacks.campaign_id IN('$CLIcampaign') $vlNOanyone_callback_inactive_listsSQL;";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status,vendor_lead_code FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id;";
|
||||
$stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status,vendor_lead_code FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id $vlNOanyone_callback_inactive_listsSQL;";
|
||||
}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1124,7 +1149,7 @@ foreach(@campaign_id)
|
||||
{
|
||||
if ($DB) {print "Campaign $campaign_id[$i] set to no-hopper-dialing: $no_hopper_dialing[$i]\n";}
|
||||
|
||||
### BEGIN Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed
|
||||
### get count of no-hopper dialing hopper entries
|
||||
$stmtA = "SELECT count(*) FROM $vicidial_hopper where campaign_id='$campaign_id[$i]' and status NOT IN('QUEUE','HOLD');";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
|
||||
@@ -1738,7 +1738,8 @@ agent_push_url TEXT,
|
||||
hide_inactive_lists ENUM('0','1') default '0',
|
||||
allow_manage_active_lists ENUM('0','1') default '0',
|
||||
expired_lists_inactive ENUM('0','1') default '0',
|
||||
did_system_filter ENUM('0','1') default '0'
|
||||
did_system_filter ENUM('0','1') default '0',
|
||||
anyone_callback_inactive_lists ENUM('default','NO_ADD_TO_HOPPER','KEEP_IN_HOPPER') default 'default'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -4117,4 +4118,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='1530',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1531',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -473,3 +473,6 @@ ALTER TABLE vicidial_campaigns ADD next_dial_my_callbacks ENUM('DISABLED','ENABL
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1530',db_schema_update_date=NOW() where db_schema_version < 1530;
|
||||
|
||||
ALTER TABLE system_settings ADD anyone_callback_inactive_lists ENUM('default','NO_ADD_TO_HOPPER','KEEP_IN_HOPPER') default 'default';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1531',db_schema_update_date=NOW() where db_schema_version < 1531;
|
||||
|
||||
+14
-6
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# help.php - VICIDIAL administration page
|
||||
#
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
|
||||
# CHANGELOG:
|
||||
@@ -147,6 +147,7 @@
|
||||
# 171130-0048 - Added agent_screen_time_display entry
|
||||
# 171224-1027 - Added lists-default_xfer_group entry
|
||||
# 180108-2115 - Added campaigns-next_dial_my_callbacks entry
|
||||
# 180111-1547 - Added settings-anyone_callback_inactive_lists entry
|
||||
#
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
@@ -5273,6 +5274,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Callback Time 24 Hours"); ?> -</B><?php echo _QXZ("This option defines whether the agent sees 12 hour time with AM PM options or 24 hour time on the Callback setting screen in the agent interface. Default is 0 for disabled."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-anyone_callback_inactive_lists">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Anyone Callback Inactive Lists"); ?> -</B><?php echo _QXZ("This option defines whether an ANYONE callback within an inactive list will be placed in the hopper to be dialed or not. The default option will place ANYONE scheduled callbacks from inactive lists into the hopper for up to one minute before removing them from the hopper. Using the NO_ADD_TO_HOPPER option will prevent ANYONE scheduled callbacks from inactive lists from ever being put into the hopper while the list is inactive. The KEEP_IN_HOPPER option will put ANYONE scheduled callbacks from inactive lists into the hopper and will make sure they stay in the hopper until they are dialed, or they are no longer dialable due to a Call Time setting. This feature only affects campaigns that use the dial hopper. Default is default."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-sounds_central_control_active">
|
||||
<BR>
|
||||
|
||||
Reference in New Issue
Block a user