Added ability to use Wrap-Up messages with calls terminated through Hotkeys

git-svn-id: svn://192.168.202.10@2141 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2014-06-26 13:37:02 +00:00
parent a5a3677ef1
commit 593184d35c
9 changed files with 159 additions and 15 deletions
+2
View File
@@ -73,6 +73,8 @@ OTHER CHANGES:
6. Added $RS_droppedOFtotal options.php option for the realtime report to allow
the drops to be calculated out of Total calls instead of just Answers
7. Added ability to use Wrap-Up messages with calls terminated through Hotkeys
+54 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# nanpa_type_preload.pl version 2.8
# nanpa_type_preload.pl version 2.10
#
# DESCRIPTION:
# This script is designed to filter the leads in a list by phone number and
@@ -13,6 +13,7 @@
# CHANGES
# 130914-1710 - first build
# 131003-1743 - Added exclude filter settings
# 140624-1551 - Added more options to segment leads
#
$PATHconf = '/etc/astguiclient.conf';
@@ -121,6 +122,9 @@ if (length($ARGV[0])>1)
print " [--vl-field-update=XXX] = OPTIONAL, field that you want to update with the phone type information\n";
print " [--exclude-field=XXX] = OPTIONAL, field that you want to check in vicidial_list to exclude from processing\n";
print " [--exclude-value=XXX] = OPTIONAL, value of the above field that you want to check in vicidial_list to exclude from processing\n";
print " [--batch-flag-vl-field] = OPTIONAL, before processing, append F to all vl-field values of S, C, I\n";
print " [--batch-quantity=XXX] = OPTIONAL, process only XXX number of vicidial_list records, must run with --batch-flag-vl-field first time\n";
print " This option will only process records that have blank, NULL, SF, CF or IF as vl-field values\n";
print "\n";
exit;
}
@@ -233,6 +237,18 @@ if (length($ARGV[0])>1)
$exclude_value =~ s/ .*//gi;
if ($DB > 0) {print "\n----- EXCLUDE VALUE: $exclude_value -----\n\n";}
}
if ( ($args =~ /--batch-quantity=/i) && (length($vl_field_update)>2) )
{
@data_in = split(/--batch-quantity=/,$args);
$batch_quantity = $data_in[1];
$batch_quantity =~ s/ .*//gi;
if ($DB > 0) {print "\n----- BATCH QUANTITY VALUE: $batch_quantity -----\n\n";}
}
if ( ($args =~ /--batch-flag-vl-field/i) && (length($vl_field_update)>2) )
{
$batch_flag_vl_field=1;
if ($DB > 0) {print "\n----- BATCH VL FIELD FLAG VALUE: $batch_flag_vl_field -----\n\n";}
}
}
}
else
@@ -283,7 +299,43 @@ if ( (length($exclude_field) > 1) && (length($exclude_value) > 0) )
}
}
$stmtA = "SELECT lead_id,phone_number from vicidial_list $list_idSQL $excludeSQL;";
$limitSQL='';
if ( (length($batch_quantity) > 1) && (length($vl_field_update) > 2) )
{
if ( (length($list_idSQL) > 5) || (length($excludeSQL) > 5) )
{
$limitSQL = "and ( ($vl_field_update is NULL) or ($vl_field_update IN('','SF','CF','IF')) ) limit $batch_quantity";
}
else
{
$limitSQL = "where ( ($vl_field_update is NULL) or ($vl_field_update IN('','SF','CF','IF')) ) limit $batch_quantity";
}
}
if ($batch_flag_vl_field > 0)
{
if ($DB) {print "FLAGGING PREVIOUSLY TAGGED LEADS...\n";}
$clausesSQL = "$list_idSQL $excludeSQL";
$clausesSQL =~ s/^where/and/gi;
$stmtA = "UPDATE vicidial_list SET $vl_field_update='SF' where $vl_field_update='S' $clausesSQL;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print "|$affected_rows records changed from S to SF|\n";}
$stmtA = "UPDATE vicidial_list SET $vl_field_update='CF' where $vl_field_update='C' $clausesSQL;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print "|$affected_rows records changed from C to CF|\n";}
$stmtA = "UPDATE vicidial_list SET $vl_field_update='IF' where $vl_field_update='I' $clausesSQL;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print "|$affected_rows records changed from I to IF|\n";}
}
$stmtA = "SELECT lead_id,phone_number from vicidial_list $list_idSQL $excludeSQL $limitSQL;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -905,7 +905,8 @@ max_inbound_calls SMALLINT(5) UNSIGNED default '0',
manual_dial_search_checkbox ENUM('SELECTED','SELECTED_RESET','UNSELECTED','UNSELECTED_RESET') default 'SELECTED',
hide_call_log_info ENUM('Y','N') default 'N',
timer_alt_seconds SMALLINT(5) default '0',
wrapup_bypass ENUM('DISABLED','ENABLED') default 'ENABLED'
wrapup_bypass ENUM('DISABLED','ENABLED') default 'ENABLED',
wrapup_after_hotkey ENUM('DISABLED','ENABLED') default 'DISABLED'
) ENGINE=MyISAM;
CREATE TABLE vicidial_lists (
@@ -3275,4 +3276,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='1383',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1384',db_schema_update_date=NOW(),reload_timestamp=NOW();
+4
View File
@@ -17,3 +17,7 @@ UPDATE system_settings SET db_schema_version='1382',db_schema_update_date=NOW()
ALTER TABLE vicidial_campaigns ADD wrapup_bypass ENUM('DISABLED','ENABLED') default 'ENABLED';
UPDATE system_settings SET db_schema_version='1383',db_schema_update_date=NOW() where db_schema_version < 1383;
ALTER TABLE vicidial_campaigns ADD wrapup_after_hotkey ENUM('DISABLED','ENABLED') default 'DISABLED';
UPDATE system_settings SET db_schema_version='1384',db_schema_update_date=NOW() where db_schema_version < 1384;
@@ -19,6 +19,8 @@ Pre-Filter Phone Group DID||
For the Pre-Filter Phone Group ID feature above to work properly, a DID Pattern must be set in this field. Default is blank for disabled. It is recommended that you confirm the DID you enter here is properly set in the system before assigning it||
If set to ENABLED then the agent will be able to click a link to stop the Wrap Up timer before the time is completed. Default is ENABLED||
You can use a Script in the system if you use the script id with WUSCRIPT in front of it, so if you wanted to use a script called agent_script, then you would put WUSCRIPTagent_script in this field||
Wrap Up After Hotkey||
If set to ENABLED and the campaign has hotkeys configured and the agent terminates a call with a hotkey, then the wrap up settings will be used after that call. Default is DISABLED||
########################## CHANGES TO EXISTING PHRASES IN ADMIN TRANSLATION
+3 -1
View File
@@ -1515,7 +1515,7 @@ if ($ACTION == 'update_settings')
##### grab the data from vicidial_users for the user
$stmt="SELECT wrapup_seconds,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,dial_timeout,wrapup_bypass,wrapup_message FROM vicidial_campaigns where campaign_id='$campaign' LIMIT 1;";
$stmt="SELECT wrapup_seconds,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,dial_timeout,wrapup_bypass,wrapup_message,wrapup_after_hotkey FROM vicidial_campaigns where campaign_id='$campaign' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00594',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1532,6 +1532,7 @@ if ($ACTION == 'update_settings')
$dial_timeout = trim("$row[6]");
$wrapup_bypass = trim("$row[7]");
$wrapup_message = trim("$row[8]");
$wrapup_after_hotkey = trim("$row[9]");
}
if ($wrapup_seconds_override >= 0)
@@ -1551,6 +1552,7 @@ if ($ACTION == 'update_settings')
$SettingS_InfO .= "dial_timeout: " . $dial_timeout . "\n";
$SettingS_InfO .= "wrapup_bypass: " . $wrapup_bypass . "\n";
$SettingS_InfO .= "wrapup_message: " . $wrapup_message . "\n";
$SettingS_InfO .= "wrapup_after_hotkey: " . $wrapup_after_hotkey . "\n";
$SettingS_InfO .= "\n";
}
echo $SettingS_InfO;
+73 -5
View File
@@ -436,10 +436,11 @@
# 140617-2015 - Added vicidial_users wrapup_seconds_override option
# 140621-1557 - Added update_settings call to grab selected user and campaign settings more frequently
# 140623-1710 - Added wrapup_bypass setting
# 140626-0757 - Added wrapup_after_hotkey setting
#
$version = '2.10-406c';
$build = '140623-1710';
$version = '2.10-408c';
$build = '140626-0757';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=80;
$one_mysql_log=0;
@@ -1451,7 +1452,7 @@ else
$HKstatusnames = substr("$HKstatusnames", 0, -1);
##### grab the campaign settings
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_pause_precall_code,auto_resume_precall,manual_dial_cid,custom_3way_button_transfer,callback_days_limit,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,pllb_grouping,pllb_grouping_limit,in_group_dial,in_group_dial_select,pause_after_next_call,owner_populate,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_pause_precall_code,auto_resume_precall,manual_dial_cid,custom_3way_button_transfer,callback_days_limit,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,pllb_grouping,pllb_grouping_limit,in_group_dial,in_group_dial_select,pause_after_next_call,owner_populate,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1572,6 +1573,7 @@ else
$hide_call_log_info = $row[113];
$timer_alt_seconds = $row[114];
$wrapup_bypass = $row[115];
$wrapup_after_hotkey = $row[116];
if ($VU_wrapup_seconds_override >= 0)
{$wrapup_seconds = $VU_wrapup_seconds_override;}
@@ -3435,6 +3437,7 @@ $CCAL_OUT .= "</table>";
}
?>
var HKdispo_display = 0;
var HKdispo_submit = 0;
var HKbutton_allowed = 1;
var HKfinish = 0;
var scriptnames = new Array();
@@ -3558,6 +3561,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var conf_silent_prefix = '<?php echo $conf_silent_prefix ?>';
var menuheight = 30;
var menuwidth = 30;
var HTheight = '<?php echo $HTheight ?>px';
var WRheight = '<?php echo $WRheight ?>px';
var CAwidth = '<?php echo $CAwidth ?>px';
var menufontsize = 8;
var textareafontsize = 10;
var check_s;
@@ -3630,6 +3636,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var wrapup_counter = 0;
var wrapup_waiting = 0;
var wrapup_bypass = '<?php echo $wrapup_bypass ?>';
var wrapup_after_hotkey = '<?php echo $wrapup_after_hotkey ?>';
var use_internal_dnc = '<?php echo $use_internal_dnc ?>';
var use_campaign_dnc = '<?php echo $use_campaign_dnc ?>';
var three_way_call_cid = '<?php echo $three_way_call_cid ?>';
@@ -11074,6 +11081,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
wrapup_bypass=wrapup_bypass_array[1];
var wrapup_message_array=settings_array[10].split("wrapup_message: ");
wrapup_message=wrapup_message_array[1];
var wrapup_after_hotkey_array=settings_array[11].split("wrapup_after_hotkey: ");
wrapup_after_hotkey=wrapup_after_hotkey_array[1];
if (wrapup_seconds > 0)
{
@@ -11838,6 +11847,28 @@ if ($useIE > 0)
else
{
HKdispo_display = 4;
// Check for hotkeys enabled wrapup message
if ( (wrapup_after_hotkey == 'ENABLED') && (wrapup_seconds > 0) )
{
HKdispo_display = wrapup_seconds;
if (HKdispo_display < 4)
{HKdispo_display = 4;}
document.getElementById("HotKeyActionBox").style.top = '1px';
document.getElementById("HotKeyActionBox").style.left = '1px';
document.getElementById("HKWrapupTimer").innerHTML = "<br />Call Wrapup: " + HKdispo_display + " seconds remaining in wrapup";
document.getElementById("HKWrapupMessage").innerHTML = "<br /><br /><center><table width=" + CAwidth + "><tr><td height=" + WRheight + " align=center>" + document.getElementById("WrapupMessage").innerHTML + "<br /> &nbsp; </td></tr></table></center>";
document.getElementById("HKWrapupBypass").innerHTML = " &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"HKWrapupFinish();return false;\">Finish Wrapup and Move On</a>";
}
else
{
document.getElementById("HotKeyActionBox").style.top = HTheight;
document.getElementById("HotKeyActionBox").style.left = '5px';
document.getElementById("HKWrapupTimer").innerHTML = '';
document.getElementById("HKWrapupMessage").innerHTML = '';
document.getElementById("HKWrapupBypass").innerHTML = '';
}
HKdispo_submit = HKdispo_display;
HKfinish=1;
alt_phone_dialing=starting_alt_phone_dialing;
alt_dial_active = 0;
@@ -11902,6 +11933,28 @@ else
else
{
HKdispo_display = 4;
// Check for hotkeys enabled wrapup message
if ( (wrapup_after_hotkey == 'ENABLED') && (wrapup_seconds > 0) )
{
HKdispo_display = wrapup_seconds;
if (HKdispo_display < 4)
{HKdispo_display = 4;}
document.getElementById("HotKeyActionBox").style.top = '1px';
document.getElementById("HotKeyActionBox").style.left = '1px';
document.getElementById("HKWrapupTimer").innerHTML = "<br />Call Wrapup: " + HKdispo_display + " seconds remaining in wrapup";
document.getElementById("HKWrapupMessage").innerHTML = "<br /><br /><center><table width=" + CAwidth + "><tr><td height=" + WRheight + " align=center>" + document.getElementById("WrapupMessage").innerHTML + "<br /> &nbsp; </td></tr></table></center>";
document.getElementById("HKWrapupBypass").innerHTML = " &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"HKWrapupFinish();return false;\">Finish Wrapup and Move On</a>";
}
else
{
document.getElementById("HotKeyActionBox").style.top = HTheight;
document.getElementById("HotKeyActionBox").style.left = '5px';
document.getElementById("HKWrapupTimer").innerHTML = '';
document.getElementById("HKWrapupMessage").innerHTML = '';
document.getElementById("HKWrapupBypass").innerHTML = '';
}
HKdispo_submit = HKdispo_display;
HKfinish=1;
document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1];
showDiv('HotKeyActionBox');
@@ -13672,6 +13725,14 @@ function phone_number_format(formatphone) {
}
// ################################################################################
// Finish the wrapup timer on the hotkeys screen early
function HKWrapupFinish()
{
HKdispo_display=2;
}
// ################################################################################
// GLOBAL FUNCTIONS
function begin_all_refresh()
@@ -14119,7 +14180,7 @@ function phone_number_format(formatphone) {
}
if (HKdispo_display > 0)
{
if ( (HKdispo_display == 3) && (HKfinish==1) )
if ( (HKdispo_display <= 3) && (HKfinish==1) )
{
HKfinish=0;
DispoSelect_submit();
@@ -14133,6 +14194,10 @@ function phone_number_format(formatphone) {
hideDiv('HotKeyActionBox');
}
HKdispo_display--;
if ( (wrapup_after_hotkey == 'ENABLED') && (wrapup_seconds > 0) )
{
document.getElementById("HKWrapupTimer").innerHTML = "<br />Call Wrapup: " + HKdispo_display + " seconds remaining in wrapup";
}
}
if (dead_auto_dispo_count > 0)
{
@@ -15344,7 +15409,10 @@ if ($agent_display_dialable_leads > 0)
<span style="position:absolute;left:5px;top:<?php echo $HTheight ?>px;z-index:<?php $zi++; echo $zi ?>;" id="HotKeyActionBox">
<table border="0" bgcolor="#FFDD99" width="<?php echo $HCwidth ?>px" height="70px">
<tr bgcolor="#FFEEBB"><td height="70px"><font class="sh_text"> Lead Dispositioned As: </font><br /><br /><center>
<font class="sd_text"><span id="HotKeyDispo"> - </span></font></center>
<font class="sd_text"><span id="HotKeyDispo"> - </span></font>
<span id="HKWrapupTimer"></span><span id="HKWrapupBypass"></span>
<span id="HKWrapupMessage"></span>
</center>
</td>
</tr></table>
</span>
File diff suppressed because one or more lines are too long
+6
View File
@@ -20,6 +20,7 @@
# 140617-2021 - Added vicidial_users wrapup_seconds_override option
# 140621-2151 - Added inbound did new filtering options
# 140623-2220 - Added wrapup_bypass and wrapup_message change to allow script use
# 140625-1934 - Added wrapup_after_hotkey
#
@@ -1353,6 +1354,11 @@ if ($SSoutbound_autodial_active > 0)
<BR>
<B>Wrap Up Bypass -</B> If set to ENABLED then the agent will be able to click a link to stop the Wrap Up timer before the time is completed. Default is ENABLED.
<BR>
<A NAME="campaigns-wrapup_after_hotkey">
<BR>
<B>Wrap Up After Hotkey -</B> If set to ENABLED and the campaign has hotkeys configured and the agent terminates a call with a hotkey, then the wrap up settings will be used after that call. Default is DISABLED.
<BR>
<A NAME="campaigns-disable_dispo_screen">
<BR>