From bcaf002d67e946743e2c285fb4c4a928b577a5d8 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 14 Mar 2017 18:32:14 +0000 Subject: [PATCH] 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 --- agc_2-X/trunk/UPGRADE | 3 +++ agc_2-X/trunk/bin/AST_VDauto_dial.pl | 23 +++++++++++++++---- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 4 ++-- agc_2-X/trunk/extras/upgrade_2.14.sql | 4 ++++ agc_2-X/trunk/www/vicidial/admin.php | 7 +++--- agc_2-X/trunk/www/vicidial/help.php | 3 ++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index d5e3bcda..20405860 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -121,6 +121,9 @@ OTHER CHANGES: 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. +22. Added CHAT option to Inbound Queue No Dial campaign setting to prevent + outbound auto-dialing if a chat is waiting for an agent + diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index 8a9c5416..3b73f7c6 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_VDauto_dial.pl version 2.12 +# AST_VDauto_dial.pl version 2.14 # # DESCRIPTION: # 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 # KEEPALIVE script running every minute to ensure this program is always running # -# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 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 # 151006-0936 - Changed campaign_cid_areacodes to operate with 2-5 digit areacodes # 161102-1031 - Fixed QM partition problem +# 170313-1041 - Added CHAT option to inbound_queue_no_dial # ### begin parsing run-time options ### @@ -356,6 +357,7 @@ while($one_day_interval > 0) @DBIPexistcalls=@MT; @DBIPexistcalls_IN=@MT; @DBIPexistcalls_IN_ALL=@MT; + @DBIPexistchats_IN_LIVE=@MT; @DBIPexistcalls_IN_LIVE=@MT; @DBIPexistcalls_OUT=@MT; @DBIPgoalcalls=@MT; @@ -788,6 +790,17 @@ while($one_day_interval > 0) $DBIPexistcalls_IN_LIVE[$user_CIPct] = $aryA[0]; } $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 {$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]); if ($DBIPinbound_queue_no_dial[$user_CIPct] =~ /ALL_SERVERS/) {$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) ) { @@ -1013,9 +1028,9 @@ while($one_day_interval > 0) } 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; } else diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 8270a4e2..9a6779d4 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -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_message VARCHAR(255) default 'Someone is blind monitoring your session', 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 '', enable_xfer_presets ENUM('DISABLED','ENABLED','CONTACTS') 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 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(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index 0676ee6a..9825fbc2 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -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'; 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; diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index efb16a23..c8a70753 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -4016,12 +4016,13 @@ else # 170304-1355 - Added Automated Reports section to Admin # 170309-1209 - Added campaign agent_xfer_validation option and ingroup populate_state_areacode option # 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 -$admin_version = '2.14-599a'; -$build = '170311-0928'; +$admin_version = '2.14-600a'; +$build = '170313-1041'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -21407,7 +21408,7 @@ if ($ADD==31) } echo "$DRgroups_list$NWB#campaigns-drop_rate_group$NWE\n"; - echo ""._QXZ("Inbound Queue No Dial").": $NWB#campaigns-inbound_queue_no_dial$NWE\n"; + echo ""._QXZ("Inbound Queue No Dial").": $NWB#campaigns-inbound_queue_no_dial$NWE\n"; echo ""._QXZ("Auto Alt-Number Dialing").": $NWB#campaigns-auto_alt_dial$NWE $ALTmultiLINK\n"; } diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php index ee7e0c2f..e866c19e 100644 --- a/agc_2-X/trunk/www/vicidial/help.php +++ b/agc_2-X/trunk/www/vicidial/help.php @@ -113,6 +113,7 @@ # 170301-1337 - Updated entry for custom fields required setting # 170304-1346 - Added auto_reports section # 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)

- - + -