Added CHAT option to Inbound Queue No Dial campaign setting to prevent

outbound auto-dialing if a chat is waiting for an agent

git-svn-id: svn://192.168.202.10@2702 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2017-03-14 18:32:14 +00:00
parent e4cf1099d0
commit bcaf002d67
6 changed files with 34 additions and 10 deletions
+3
View File
@@ -121,6 +121,9 @@ OTHER CHANGES:
21. Added In-Group option to look up the state based upon the areacode of the 21. Added In-Group option to look up the state based upon the areacode of the
caller ID phone number of the person calling in. caller ID phone number of the person calling in.
22. Added CHAT option to Inbound Queue No Dial campaign setting to prevent
outbound auto-dialing if a chat is waiting for an agent
+19 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# AST_VDauto_dial.pl version 2.12 # AST_VDauto_dial.pl version 2.14
# #
# DESCRIPTION: # DESCRIPTION:
# Places auto_dial calls on the VICIDIAL dialer system # Places auto_dial calls on the VICIDIAL dialer system
@@ -25,7 +25,7 @@
# It is good practice to keep this program running by placing the associated # It is good practice to keep this program running by placing the associated
# KEEPALIVE script running every minute to ensure this program is always running # KEEPALIVE script running every minute to ensure this program is always running
# #
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGELOG: # CHANGELOG:
# 50125-1201 - Changed dial timeout to 120 seconds from 180 seconds # 50125-1201 - Changed dial timeout to 120 seconds from 180 seconds
@@ -121,6 +121,7 @@
# 141211-2134 - Added na_call_url list_id override option # 141211-2134 - Added na_call_url list_id override option
# 151006-0936 - Changed campaign_cid_areacodes to operate with 2-5 digit areacodes # 151006-0936 - Changed campaign_cid_areacodes to operate with 2-5 digit areacodes
# 161102-1031 - Fixed QM partition problem # 161102-1031 - Fixed QM partition problem
# 170313-1041 - Added CHAT option to inbound_queue_no_dial
# #
### begin parsing run-time options ### ### begin parsing run-time options ###
@@ -356,6 +357,7 @@ while($one_day_interval > 0)
@DBIPexistcalls=@MT; @DBIPexistcalls=@MT;
@DBIPexistcalls_IN=@MT; @DBIPexistcalls_IN=@MT;
@DBIPexistcalls_IN_ALL=@MT; @DBIPexistcalls_IN_ALL=@MT;
@DBIPexistchats_IN_LIVE=@MT;
@DBIPexistcalls_IN_LIVE=@MT; @DBIPexistcalls_IN_LIVE=@MT;
@DBIPexistcalls_OUT=@MT; @DBIPexistcalls_OUT=@MT;
@DBIPgoalcalls=@MT; @DBIPgoalcalls=@MT;
@@ -788,6 +790,17 @@ while($one_day_interval > 0)
$DBIPexistcalls_IN_LIVE[$user_CIPct] = $aryA[0]; $DBIPexistcalls_IN_LIVE[$user_CIPct] = $aryA[0];
} }
$sthA->finish(); $sthA->finish();
$stmtA = "SELECT count(*) FROM vicidial_live_chats where group_id IN($DBIPclosercamp[$user_CIPct]) and status IN('WAITING');";
$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;
$DBIPexistchats_IN_LIVE[$user_CIPct] = $aryA[0];
}
$sthA->finish();
} }
else else
{$DBIPexistcalls_IN[$user_CIPct]=0;} {$DBIPexistcalls_IN[$user_CIPct]=0;}
@@ -806,6 +819,8 @@ while($one_day_interval > 0)
$DBIPexistcalls[$user_CIPct] = ($DBIPexistcalls_IN[$user_CIPct] + $DBIPexistcalls_OUT[$user_CIPct]); $DBIPexistcalls[$user_CIPct] = ($DBIPexistcalls_IN[$user_CIPct] + $DBIPexistcalls_OUT[$user_CIPct]);
if ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /ALL_SERVERS/) if ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /ALL_SERVERS/)
{$DBIPexistcalls[$user_CIPct] = ($DBIPexistcalls_IN_ALL[$user_CIPct] + $DBIPexistcalls_OUT[$user_CIPct]);} {$DBIPexistcalls[$user_CIPct] = ($DBIPexistcalls_IN_ALL[$user_CIPct] + $DBIPexistcalls_OUT[$user_CIPct]);}
if ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /CHAT/)
{$DBIPexistcalls[$user_CIPct] = ($DBIPexistcalls[$user_CIPct] + $DBIPexistchats_IN_LIVE[$user_CIPct]);}
if ( ($DBIPcampaign_ready_agents[$user_CIPct] > 0) && ($DBIPexistcalls_IN[$user_CIPct] > 0) ) if ( ($DBIPcampaign_ready_agents[$user_CIPct] > 0) && ($DBIPexistcalls_IN[$user_CIPct] > 0) )
{ {
@@ -1013,9 +1028,9 @@ while($one_day_interval > 0)
} }
else else
{ {
if ( ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /ENABLED/) && ($DBIPexistcalls_IN_LIVE[$user_CIPct] > 0) ) if ( ( ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /ENABLED/) && ($DBIPexistcalls_IN_LIVE[$user_CIPct] > 0) ) || ( ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /CHAT/) && ($DBIPexistchats_IN_LIVE[$user_CIPct] > 0) ) )
{ {
$event_string="$DBIPcampaign[$user_CIPct] $DBIPexistcalls_IN_LIVE[$user_CIPct]: INBOUND QUEUE NO DIAL, NO DIALING"; $event_string="$DBIPcampaign[$user_CIPct] $DBIPexistcalls_IN_LIVE[$user_CIPct] $DBIPexistchats_IN_LIVE[$user_CIPct]: INBOUND QUEUE NO DIAL, NO DIALING ($DBIPinbound_queue_no_dial[$user_CIPct])";
&event_logger; &event_logger;
} }
else else
@@ -869,7 +869,7 @@ manual_dial_override ENUM('NONE','ALLOW_ALL','DISABLE_ALL') default 'NONE',
blind_monitor_warning ENUM('DISABLED','ALERT','NOTICE','AUDIO','ALERT_NOTICE','ALERT_AUDIO','NOTICE_AUDIO','ALL') default 'DISABLED', blind_monitor_warning ENUM('DISABLED','ALERT','NOTICE','AUDIO','ALERT_NOTICE','ALERT_AUDIO','NOTICE_AUDIO','ALL') default 'DISABLED',
blind_monitor_message VARCHAR(255) default 'Someone is blind monitoring your session', blind_monitor_message VARCHAR(255) default 'Someone is blind monitoring your session',
blind_monitor_filename VARCHAR(100) default '', blind_monitor_filename VARCHAR(100) default '',
inbound_queue_no_dial ENUM('DISABLED','ENABLED','ALL_SERVERS') default 'DISABLED', inbound_queue_no_dial ENUM('DISABLED','ENABLED','ALL_SERVERS','ENABLED_WITH_CHAT','ALL_SERVERS_WITH_CHAT') default 'DISABLED',
timer_action_destination VARCHAR(30) default '', timer_action_destination VARCHAR(30) default '',
enable_xfer_presets ENUM('DISABLED','ENABLED','CONTACTS') default 'DISABLED', enable_xfer_presets ENUM('DISABLED','ENABLED','CONTACTS') default 'DISABLED',
hide_xfer_number_to_dial ENUM('DISABLED','ENABLED') default 'DISABLED', hide_xfer_number_to_dial ENUM('DISABLED','ENABLED') default 'DISABLED',
@@ -3899,4 +3899,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1'; UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1493',db_schema_update_date=NOW(),reload_timestamp=NOW(); UPDATE system_settings SET db_schema_version='1494',db_schema_update_date=NOW(),reload_timestamp=NOW();
+4
View File
@@ -115,3 +115,7 @@ ALTER TABLE vicidial_campaigns ADD agent_xfer_validation ENUM('N','Y') default '
ALTER TABLE vicidial_inbound_groups ADD populate_state_areacode ENUM('DISABLED','NEW_LEAD_ONLY','OVERWRITE_ALWAYS') default 'DISABLED'; ALTER TABLE vicidial_inbound_groups ADD populate_state_areacode ENUM('DISABLED','NEW_LEAD_ONLY','OVERWRITE_ALWAYS') default 'DISABLED';
UPDATE system_settings SET db_schema_version='1493',db_schema_update_date=NOW() where db_schema_version < 1493; UPDATE system_settings SET db_schema_version='1493',db_schema_update_date=NOW() where db_schema_version < 1493;
ALTER TABLE vicidial_campaigns MODIFY inbound_queue_no_dial ENUM('DISABLED','ENABLED','ALL_SERVERS','ENABLED_WITH_CHAT','ALL_SERVERS_WITH_CHAT') default 'DISABLED';
UPDATE system_settings SET db_schema_version='1494',db_schema_update_date=NOW() where db_schema_version < 1494;
+4 -3
View File
@@ -4016,12 +4016,13 @@ else
# 170304-1355 - Added Automated Reports section to Admin # 170304-1355 - Added Automated Reports section to Admin
# 170309-1209 - Added campaign agent_xfer_validation option and ingroup populate_state_areacode option # 170309-1209 - Added campaign agent_xfer_validation option and ingroup populate_state_areacode option
# 170311-0928 - Fixes for QC allowed campaign permissions, issue #1003 # 170311-0928 - Fixes for QC allowed campaign permissions, issue #1003
# 170313-1041 - Added CHAT options to inbound_queue_no_dial
# #
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
$admin_version = '2.14-599a'; $admin_version = '2.14-600a';
$build = '170311-0928'; $build = '170313-1041';
$STARTtime = date("U"); $STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s"); $SQLdate = date("Y-m-d H:i:s");
@@ -21407,7 +21408,7 @@ if ($ADD==31)
} }
echo "$DRgroups_list<option SELECTED>$drop_rate_group</option></select>$NWB#campaigns-drop_rate_group$NWE</td></tr>\n"; echo "$DRgroups_list<option SELECTED>$drop_rate_group</option></select>$NWB#campaigns-drop_rate_group$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSalt_row1_background><td align=right>"._QXZ("Inbound Queue No Dial").": </td><td align=left><select size=1 name=inbound_queue_no_dial><option value='DISABLED'>"._QXZ("DISABLED")."</option><option value='ENABLED'>"._QXZ("ENABLED")."</option><option value='ALL_SERVERS'>"._QXZ("ALL_SERVERS")."</option><option value='$inbound_queue_no_dial' SELECTED>"._QXZ("$inbound_queue_no_dial")."</option></select>$NWB#campaigns-inbound_queue_no_dial$NWE</td></tr>\n"; echo "<tr bgcolor=#$SSalt_row1_background><td align=right>"._QXZ("Inbound Queue No Dial").": </td><td align=left><select size=1 name=inbound_queue_no_dial><option value='DISABLED'>"._QXZ("DISABLED")."</option><option value='ENABLED'>"._QXZ("ENABLED")."</option><option value='ALL_SERVERS'>"._QXZ("ALL_SERVERS")."</option><option value='ENABLED_WITH_CHAT'>"._QXZ("ENABLED_WITH_CHAT")."</option><option value='ALL_SERVERS_WITH_CHAT'>"._QXZ("ALL_SERVERS_WITH_CHAT")."</option><option value='$inbound_queue_no_dial' SELECTED>"._QXZ("$inbound_queue_no_dial")."</option></select>$NWB#campaigns-inbound_queue_no_dial$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Auto Alt-Number Dialing").": </td><td align=left><select size=1 name=auto_alt_dial><option value='NONE'>"._QXZ("NONE")."</option><option value='ALT_ONLY'>"._QXZ("ALT_ONLY")."</option><option value='ADDR3_ONLY'>"._QXZ("ADDR3_ONLY")."</option><option value='ALT_AND_ADDR3'>"._QXZ("ALT_AND_ADDR3")."</option><option value='ALT_AND_EXTENDED'>"._QXZ("ALT_AND_EXTENDED")."</option><option value='ALT_AND_ADDR3_AND_EXTENDED'>"._QXZ("ALT_AND_ADDR3_AND_EXTENDED")."</option><option value='EXTENDED_ONLY'>"._QXZ("EXTENDED_ONLY")."</option><option value='MULTI_LEAD'>"._QXZ("MULTI_LEAD")."</option><option value='$auto_alt_dial' SELECTED>"._QXZ("$auto_alt_dial")."</option></select>$NWB#campaigns-auto_alt_dial$NWE $ALTmultiLINK</td></tr>\n"; echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Auto Alt-Number Dialing").": </td><td align=left><select size=1 name=auto_alt_dial><option value='NONE'>"._QXZ("NONE")."</option><option value='ALT_ONLY'>"._QXZ("ALT_ONLY")."</option><option value='ADDR3_ONLY'>"._QXZ("ADDR3_ONLY")."</option><option value='ALT_AND_ADDR3'>"._QXZ("ALT_AND_ADDR3")."</option><option value='ALT_AND_EXTENDED'>"._QXZ("ALT_AND_EXTENDED")."</option><option value='ALT_AND_ADDR3_AND_EXTENDED'>"._QXZ("ALT_AND_ADDR3_AND_EXTENDED")."</option><option value='EXTENDED_ONLY'>"._QXZ("EXTENDED_ONLY")."</option><option value='MULTI_LEAD'>"._QXZ("MULTI_LEAD")."</option><option value='$auto_alt_dial' SELECTED>"._QXZ("$auto_alt_dial")."</option></select>$NWB#campaigns-auto_alt_dial$NWE $ALTmultiLINK</td></tr>\n";
} }
+2 -1
View File
@@ -113,6 +113,7 @@
# 170301-1337 - Updated entry for custom fields required setting # 170301-1337 - Updated entry for custom fields required setting
# 170304-1346 - Added auto_reports section # 170304-1346 - Added auto_reports section
# 170309-1212 - Added agent_xfer_validation and populate_state_areacode entries # 170309-1212 - Added agent_xfer_validation and populate_state_areacode entries
# 170313-2012 - Added CHAT option to inbound_queue_no_dial entry
# #
@@ -1066,7 +1067,7 @@ if ($SSoutbound_autodial_active > 0)
<BR> <BR>
<A NAME="campaigns-inbound_queue_no_dial"> <A NAME="campaigns-inbound_queue_no_dial">
<BR> <BR>
<B><?php echo _QXZ("Inbound Queue No Dial"); ?> -</B><?php echo _QXZ("This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED."); ?> <B><?php echo _QXZ("Inbound Queue No Dial"); ?> -</B><?php echo _QXZ("This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED.") . ' ' . _QXZ("If the selected option includes CHAT, then no outbound auto-dialing will take place while an inbound customer chat is waiting."); ?>
<BR> <BR>
<A NAME="campaigns-auto_alt_dial"> <A NAME="campaigns-auto_alt_dial">