diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index 32d2cac7..7090768f 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -153,9 +153,10 @@ # 210712-2312 - Added purging of vicidial_lead_24hour_calls table # 210827-0939 - Added PJSIP compatibility # 210924-2333 - Fix for calls_today issue at timeclock-end-of-day +# 220310-0959 - Added purging of vicidial_sync_log table # -$build = '210924-2333'; +$build = '220310-0959'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -1859,6 +1860,24 @@ if ($timeclock_end_of_day_NOW > 0) ##### END vicidial_ajax_log end of day process removing records older than 7 days ##### + ##### BEGIN vicidial_sync_log end of day process removing records older than 7 days ##### + $stmtA = "DELETE from vicidial_sync_log where db_time < \"$SDSQLdate\";"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows vicidial_sync_log records older than 7 days purged|\n";} + if ($teodDB) {$event_string = "vicidial_sync_log records older than 7 days purged: |$stmtA|$affected_rows|"; &teod_logger;} + + $stmtA = "optimize table vicidial_sync_log;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + ##### END vicidial_sync_log end of day process removing records older than 7 days ##### + + ##### BEGIN vicidial_vdad_log end of day process removing records older than 7 days ##### $stmtA = "DELETE from vicidial_vdad_log where db_time < \"$SDSQLdate\";"; if($DBX){print STDERR "\n|$stmtA|\n";} diff --git a/agc_2-X/trunk/docs/NON-AGENT_API.txt b/agc_2-X/trunk/docs/NON-AGENT_API.txt index 83d87d70..bd28dce2 100644 --- a/agc_2-X/trunk/docs/NON-AGENT_API.txt +++ b/agc_2-X/trunk/docs/NON-AGENT_API.txt @@ -1,4 +1,4 @@ -NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2022-03-07 +NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2022-03-10 This document describes the functions of an API(Application Programming Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. @@ -63,7 +63,7 @@ add_fpg_phone - adds a phone number to a Filter Phone Group campaigns_list - displays information about all campaigns in the system hopper_list - displays information about leads in the hopper for a campaign update_alt_url - updates/adds/displays alternate dispo call url entries for a campaign -update_presets - updates/adds/displays campaign preset entries +update_presets - updates/adds/displays/deletes campaign preset entries New scripts: @@ -201,6 +201,7 @@ Changes: 211118-1946 - Added 'delete_cf_data' setting to the update_lead function 220126-2116 - Added dispo_call_url and alt URL options for update_campaign. Added 'update_alt_url' function 220307-0937 - Added 'update_presets' function +220310-0825 - Added DELETE action to the 'update_presets' function API Functions use the 'function' variable @@ -2357,7 +2358,7 @@ url_id|campaign_id|entry_type|active|url_type|url_rank|url_statuses|url_descript -------------------------------------------------------------------------------- -update_presets - updates/adds/displays campaign preset entries +update_presets - updates/adds/displays/deletes campaign preset entries NOTE: api user for this function must have user_level set to 8 or higher and "modify campaigns" enabled @@ -2366,7 +2367,7 @@ campaign_id - 2-8 characters source - description of what originated the API call (maximum 20 characters) preset_name - name of the preset in the system NOTE: If only one preset exists for this campaign, then this field can be left blank -action - 'UPDATE', 'NEW' or 'LIST' (default is 'UPDATE') +action - 'UPDATE', 'NEW', 'DELETE' or 'LIST' (default is 'UPDATE') NOTE: 'stage'(csv, tab, pipe[default]) and 'header'(YES, NO) options are available for an action of 'LIST' EDITABLE FIELDS- @@ -2383,6 +2384,7 @@ http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&functio http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_presets&campaign_id=ALTTEST&preset_number=3125551213&preset_hide_number=N&preset_dtmf=1234 http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_presets&campaign_id=ALTTEST&action=LIST http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_presets&campaign_id=ALTTEST&preset_name=SUPPORT+LINE&preset_number=3125551214&preset_hide_number=Y&preset_dtmf=1&action=NEW +http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_presets&campaign_id=ALTTEST&preset_name=SUPPORT+LINE&action=DELETE Example responses: @@ -2395,7 +2397,8 @@ ERROR: update_presets PRESET HIDE NUMBER MUST BE Y OR N, THIS IS AN OPTIONAL FIE ERROR: update_presets PRESET DTMF IS NOT VALID, THIS IS AN OPTIONAL FIELD - 6666| NOTICE: update_campaign NO UPDATES DEFINED - 6666| SUCCESS: update_presets PRESET HAS BEEN UPDATED - 6666|1|campaign|TESTCAMP -SUCCESS: update_presets PRESET HAS BEEN ADDED - 6666|NEW PRESET: SUPPORT LINE|campaign|TESTCAMP +SUCCESS: update_presets PRESET HAS BEEN ADDED - 6666|NEW PRESET: SUPPORT LINE|TESTCAMP +SUCCESS: update_presets PRESET HAS BEEN DELETED - 6666|SUPPORT LINE|TESTCAMP NOTICE: update_presets LIST, No Records Found - 6666|TESTCAMP|0 A LIST response will not show "SUCCESS", but instead will just print the results in the following format: 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 c3d09930..451385ec 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -915,7 +915,7 @@ blind_monitor_message VARCHAR(255) default 'Someone is blind monitoring your ses blind_monitor_filename VARCHAR(100) default '', 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', +enable_xfer_presets ENUM('DISABLED','ENABLED','STAGING','CONTACTS') default 'DISABLED', hide_xfer_number_to_dial ENUM('DISABLED','ENABLED') default 'DISABLED', manual_dial_prefix VARCHAR(20) default '', customer_3way_hangup_logging ENUM('DISABLED','ENABLED') default 'ENABLED', @@ -3714,6 +3714,20 @@ last_sql TEXT, KEY ajax_dbtime_key (db_time) ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE vicidial_sync_log ( +user VARCHAR(20) default '', +start_time DATETIME NOT NULL, +db_time DATETIME NOT NULL, +run_time VARCHAR(20) default '0', +php_script VARCHAR(40) NOT NULL, +action VARCHAR(100) default '', +lead_id INT(10) UNSIGNED default '0', +stage VARCHAR(200) default '', +session_name VARCHAR(40) default '', +last_sql TEXT, +KEY ajax_dbtime_key (db_time) +) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; + CREATE TABLE vicidial_settings_containers ( container_id VARCHAR(40) PRIMARY KEY NOT NULL, container_notes VARCHAR(255) default '', @@ -5050,4 +5064,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='1655',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1656',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 a80ac7d4..26897853 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -1881,3 +1881,21 @@ UPDATE system_settings SET db_schema_version='1654',db_schema_update_date=NOW() ALTER TABLE system_settings ADD allow_web_debug ENUM('0','1','2','3','4','5','6') default '0'; UPDATE system_settings SET db_schema_version='1655',db_schema_update_date=NOW() where db_schema_version < 1655; + +ALTER TABLE vicidial_campaigns MODIFY enable_xfer_presets ENUM('DISABLED','ENABLED','STAGING','CONTACTS') default 'DISABLED'; + +CREATE TABLE vicidial_sync_log ( +user VARCHAR(20) default '', +start_time DATETIME NOT NULL, +db_time DATETIME NOT NULL, +run_time VARCHAR(20) default '0', +php_script VARCHAR(40) NOT NULL, +action VARCHAR(100) default '', +lead_id INT(10) UNSIGNED default '0', +stage VARCHAR(200) default '', +session_name VARCHAR(40) default '', +last_sql TEXT, +KEY ajax_dbtime_key (db_time) +) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; + +UPDATE system_settings SET db_schema_version='1656',db_schema_update_date=NOW() where db_schema_version < 1656; diff --git a/agc_2-X/trunk/www/agc/conf_exten_check.php b/agc_2-X/trunk/www/agc/conf_exten_check.php index e92f8e9c..c08daeea 100644 --- a/agc_2-X/trunk/www/agc/conf_exten_check.php +++ b/agc_2-X/trunk/www/agc/conf_exten_check.php @@ -91,10 +91,11 @@ # 210616-1905 - Added optional CORS support, see options.php for details # 210825-0907 - Fix for XSS security issue # 220219-2328 - Added allow_web_debug system setting +# 220310-0934 - Added more time-sync detailed logging # -$version = '2.14-65'; -$build = '220219-2328'; +$version = '2.14-66'; +$build = '220310-0934'; $php_script = 'conf_exten_check.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=51; @@ -249,6 +250,7 @@ if (strlen($SSagent_debug_logging) > 1) } $Alogin='N'; +$Alogin_notes=''; $RingCalls='N'; $DiaLCalls='N'; @@ -731,6 +733,7 @@ if ($ACTION == 'refresh') else { $Alogin='N'; + $Alogin_notes=''; $RingCalls='N'; $DiaLCalls='N'; } @@ -1189,16 +1192,16 @@ if ($ACTION == 'refresh') if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (preg_match("/0\$/i",$StarTtime)) ) - {$Alogin='TIME_SYNC';} + {$Alogin='TIME_SYNC'; $Alogin_notes="SERVER-DB-DIFF-- $time_diff = ($server_epoch - $db_epoch) DB-WEB-DIFF-- $web_diff = ($db_epoch - $web_epoch)";} if ( ($Acount < 1) or ($Scount < 1) ) - {$Alogin='DEAD_VLA';} + {$Alogin='DEAD_VLA'; $Alogin_notes="$Scount";} if ($AexternalDEAD > 0) - {$Alogin='DEAD_EXTERNAL';} + {$Alogin='DEAD_EXTERNAL'; $Alogin_notes="$AexternalDEAD";} if ($Ashift_logout > 0) - {$Alogin='SHIFT_LOGOUT';} + {$Alogin='SHIFT_LOGOUT'; $Alogin_notes="$Ashift_logout";} if ($external_pause == 'LOGOUT') { - $Alogin='API_LOGOUT'; + $Alogin='API_LOGOUT'; $Alogin_notes="$external_pause"; $external_pause=''; } @@ -1367,7 +1370,7 @@ if ($ACTION == 'refresh') } - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . '|APIdtmf: ' . $external_dtmf . '|APItransferconf: ' . $external_transferconf . '|APIpark: ' . $external_park . '|APITimerDestination: ' . $timer_action_destination . '|APIManualDialQueue: ' . $MDQ_count . '|APIRecording: ' . $external_recording . '|APIPaUseCodE: ' . $external_pause_code . '|WaitinGChats: ' . $WaitinGChats . '|WaitinGEmails: ' . $WaitinGEmails . '|LivEAgentCommentS: ' . $live_agents_comments . '|LeadIDSwitch: ' . $external_lead_id .'|DEADxfer: '.$DEADxfer .'|CHANanswer: '.$CHANanswer. "\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . '|APIdtmf: ' . $external_dtmf . '|APItransferconf: ' . $external_transferconf . '|APIpark: ' . $external_park . '|APITimerDestination: ' . $timer_action_destination . '|APIManualDialQueue: ' . $MDQ_count . '|APIRecording: ' . $external_recording . '|APIPaUseCodE: ' . $external_pause_code . '|WaitinGChats: ' . $WaitinGChats . '|WaitinGEmails: ' . $WaitinGEmails . '|LivEAgentCommentS: ' . $live_agents_comments . '|LeadIDSwitch: ' . $external_lead_id .'|DEADxfer: '.$DEADxfer .'|CHANanswer: '.$CHANanswer .'|Alogin_notes: '.$Alogin_notes. "\n"; if (strlen($timer_action) > 3) { @@ -1515,6 +1518,35 @@ if ($SSagent_debug_logging > 0) } } } + +# log the display of agent-disabled and time-sync messages +if (strlen($clicks) > 1) + { + if (preg_match("/-----agent_disabled---|-----system_disabled---/",$clicks)) + { + $cd=0; + $clicks = preg_replace("/\|$/",'',$clicks); + $clicks_details = explode('|',$clicks); + $clicks_details_ct = count($clicks_details); + while($cd < $clicks_details_ct) + { + $click_data = explode('-----',$clicks_details[$cd]); + $click_time = $click_data[0]; + $click_function_data = explode('---',$click_data[1]); + $click_function = $click_function_data[0]; + $click_options = $click_function_data[1]; + + if ( ($click_function == 'agent_disabled') or ($click_function == 'system_disabled') ) + { + $stmtA="INSERT INTO vicidial_sync_log set user='$user',start_time='$click_time',db_time=NOW(),run_time='0',php_script='vicidial.php',action='$click_function',lead_id='$lead_id',stage='$cd|$click_options',session_name='$session_name',last_sql='';"; + $rslt=mysql_to_mysqli($stmtA, $link); + } + + $cd++; + } + } + } + exit; ?> diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index bcc460e0..e2140883 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -689,10 +689,11 @@ # 220219-0133 - Added allow_web_debug system setting # 220303-2018 - Changes to some input variable filters # 220309-2215 - Fix for issue with pausing when calling agent phone again while already paused +# 220310-0935 - Added more time-sync detailed logging # -$version = '2.14-657c'; -$build = '220309-2215'; +$version = '2.14-658c'; +$build = '220310-0935'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=98; @@ -5618,6 +5619,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var recording_active=0; var pause_max_url_trigger = ''; var agent_hide_hangup_ACTIVE = ''; + var agent_datetime=''; var DiaLControl_auto_HTML = "\" border=\"0\" alt=\"You are paused\" />"; var DiaLControl_auto_HTML_ready = "\" border=\"0\" alt=\"You are active\" />"; var DiaLControl_auto_HTML_OFF = "\" border=\"0\" alt=\"pause button disabled\" />"; @@ -6801,6 +6803,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; + var AGLogiN_notes_array = check_time_array[33].split("Alogin_notes: "); + var AGLogiN_notes = AGLogiN_notes_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); @@ -6844,33 +6848,33 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { - button_click_log = button_click_log + "" + SQLdate + "-----agent_disabled---" + AGLogiN + " " + vicidial_agent_disable + "|"; + button_click_log = button_click_log + "" + SQLdate + "-----agent_disabled---" + AGLogiN + " " + vicidial_agent_disable + " " + AGLogiN_notes + " AGENT-TIME--" + agent_datetime + "|"; showDiv('AgenTDisablEBoX'); refresh_interval = 7300000; agent_events('session_disabled', 'LIVE_AGENT', aec); aec++; } if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) { - button_click_log = button_click_log + "" + SQLdate + "-----agent_disabled---" + AGLogiN + " " + vicidial_agent_disable + "|"; + button_click_log = button_click_log + "" + SQLdate + "-----agent_disabled---" + AGLogiN + " " + vicidial_agent_disable + " " + AGLogiN_notes + " AGENT-TIME--" + agent_datetime + "|"; showDiv('AgenTDisablEBoX'); refresh_interval = 7300000; agent_events('session_disabled', 'DEAD_EXTERNAL', aec); aec++; } if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') ) { - button_click_log = button_click_log + "" + SQLdate + "-----system_disabled---" + AGLogiN + " " + vicidial_agent_disable + "|"; + button_click_log = button_click_log + "" + SQLdate + "-----system_disabled---" + AGLogiN + " " + vicidial_agent_disable + " " + AGLogiN_notes + " AGENT-TIME--" + agent_datetime + "|"; showDiv('SysteMDisablEBoX'); agent_events('time_sync', '', aec); aec++; } if (AGLogiN == 'SHIFT_LOGOUT') { - button_click_log = button_click_log + "" + SQLdate + "-----shift_logout---" + AGLogiN + "|"; + button_click_log = button_click_log + "" + SQLdate + "-----shift_logout---" + AGLogiN + " " + AGLogiN_notes + "|"; shift_logout_flag=1; } if (AGLogiN == 'API_LOGOUT') { api_logout_flag=1; - button_click_log = button_click_log + "" + SQLdate + "-----api_logout---" + AGLogiN + " " + api_logout_flag + "|"; + button_click_log = button_click_log + "" + SQLdate + "-----api_logout---" + AGLogiN + " " + api_logout_flag + " " + AGLogiN_notes + "|"; if ( (MD_channel_look < 1) && (VD_live_customer_call < 1) && (alt_dial_status_display < 1) ) {LogouT('API','','');} } @@ -20590,6 +20594,8 @@ function phone_number_format(formatphone) { } document.getElementById("status").innerHTML = status_date + " " + status_time + display_message; + agent_datetime = status_date + " " + status_time; + if (VD_live_customer_call==1) { var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value); diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 7e294433..39af8125 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -3411,6 +3411,7 @@ $last_run = preg_replace('/[^-_0-9a-zA-Z]/','',$last_run); $closing_time_option_xfer_group = preg_replace('/[^-_0-9a-zA-Z]/','',$closing_time_option_xfer_group); $user_account_emails = preg_replace('/[^-_0-9a-zA-Z]/','',$user_account_emails); $outbound_cid_any = preg_replace('/[^-_0-9a-zA-Z]/','',$outbound_cid_any); +$enable_xfer_presets = preg_replace('/[^0-9a-zA-Z]/','',$enable_xfer_presets); if ($non_latin < 1) { @@ -3459,7 +3460,6 @@ if ($non_latin < 1) $agent_call_log_view_override = preg_replace('/[^0-9a-zA-Z]/','',$agent_call_log_view_override); $queuemetrics_loginout = preg_replace('/[^0-9a-zA-Z]/','',$queuemetrics_loginout); $queuemetrics_callstatus = preg_replace('/[^0-9a-zA-Z]/','',$queuemetrics_callstatus); - $enable_xfer_presets = preg_replace('/[^0-9a-zA-Z]/','',$enable_xfer_presets); $hide_xfer_number_to_dial = preg_replace('/[^0-9a-zA-Z]/','',$hide_xfer_number_to_dial); $manual_dial_prefix = preg_replace('/[^0-9a-zA-Z]/','',$manual_dial_prefix); $customer_3way_hangup_logging = preg_replace('/[^0-9a-zA-Z]/','',$customer_3way_hangup_logging); @@ -4176,7 +4176,6 @@ else $agent_call_log_view_override = preg_replace('/[^0-9\p{L}]/u','',$agent_call_log_view_override); $queuemetrics_loginout = preg_replace('/[^0-9\p{L}]/u','',$queuemetrics_loginout); $queuemetrics_callstatus = preg_replace('/[^0-9\p{L}]/u','',$queuemetrics_callstatus); - $enable_xfer_presets = preg_replace('/[^0-9\p{L}]/u','',$enable_xfer_presets); $hide_xfer_number_to_dial = preg_replace('/[^0-9\p{L}]/u','',$hide_xfer_number_to_dial); $manual_dial_prefix = preg_replace('/[^0-9\p{L}]/u','',$manual_dial_prefix); $customer_3way_hangup_logging = preg_replace('/[^0-9\p{L}]/u','',$customer_3way_hangup_logging); @@ -5883,12 +5882,13 @@ if ($SSscript_remove_js > 0) # 220217-2022 - Added input variable filtering # 220218-1656 - Added allow_web_debug system setting to disable $DB output by default # 220307-1151 - Added 'update_presets' Non-Agent API function +# 220310-1007 - Added STAGING option for campaign presets # # 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-849a'; -$build = '220307-1151'; +$admin_version = '2.14-850a'; +$build = '220310-1007'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -25949,7 +25949,7 @@ if ($ADD==31) echo ""._QXZ("Survey").""; } echo ""._QXZ("Pause Codes").""; - if ($enable_xfer_presets == 'ENABLED') + if ( ($enable_xfer_presets == 'ENABLED') or ($enable_xfer_presets == 'STAGING') ) { echo ""._QXZ("Presets").""; } @@ -26974,7 +26974,7 @@ if ($ADD==31) echo ""._QXZ("Transfer-Conf Number")." 5: $NWB#campaigns-xferconf_a_dtmf$NWE\n"; - echo ""._QXZ("Enable Transfer Presets").": $NWB#campaigns-enable_xfer_presets$NWE\n"; + echo ""._QXZ("Enable Transfer Presets").": $NWB#campaigns-enable_xfer_presets$NWE\n"; echo ""._QXZ("Hide Transfer Number to Dial").": $NWB#campaigns-hide_xfer_number_to_dial$NWE\n"; @@ -28773,11 +28773,31 @@ if ($ADD==31) ##### CAMPAIGN PRESETS ##### if ($SUB==201) { + $preset_status=_QXZ("set to ").'INACTIVE'; + $stmt="SELECT enable_xfer_presets,campaign_name from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL limit 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + $campaigns_to_print = mysqli_num_rows($rslt); + if ($DB > 0) {echo "DEBUG: |$campaigns_to_print|$stmt|\n";} + if ($campaigns_to_print > 0) + { + $row=mysqli_fetch_row($rslt); + $enable_xfer_presets = $row[0]; + $campaign_name = $row[1]; + if ($enable_xfer_presets == 'ENABLED') {$preset_status=_QXZ("set to ").'ENABLED';} + if ($enable_xfer_presets == 'STAGING') {$preset_status=_QXZ("set to ").'STAGING';} + if ($enable_xfer_presets == 'CONTACTS') {$preset_status=_QXZ("set to ").'CONTACTS';} + } + else + { + echo "
"._QXZ("CAMPAIGN DOES NOT EXIST")." - $campaign_id
\n"; + exit; + } + $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' $LOGallowed_campaignsSQL order by preset_name;"; $rslt=mysql_to_mysqli($stmt, $link); $presets_to_print = mysqli_num_rows($rslt); - echo "

$presets_to_print "._QXZ("PRESETS FOR THIS CAMPAIGN").":   $NWB#xfer_presets$NWE
\n"; + echo "

$presets_to_print "._QXZ("PRESETS FOR THIS CAMPAIGN")." ($campaign_id - $campaign_name): $preset_status   $NWB#xfer_presets$NWE
\n"; echo "
"._QXZ("ADD NEW PRESET")." -
\n"; echo "\n"; @@ -30397,7 +30417,7 @@ if ($ADD==301) echo ""; echo "
"._QXZ("CAMPAIGN PRESET LISTINGS").":\n"; - echo "
\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; @@ -30408,7 +30428,7 @@ if ($ADD==301) $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); $campaigns_to_print = mysqli_num_rows($rslt); - + if ($DB > 0) {echo "DEBUG: |$campaigns_to_print|$stmt|\n";} $o=0; while ($campaigns_to_print > $o) { @@ -30423,7 +30443,7 @@ if ($ADD==301) $k=0; while ($campaigns_to_print > $o) { - if ($enable_xfer_presets_list[$o] == 'ENABLED') + if ( ($enable_xfer_presets_list[$o] == 'ENABLED') or ($enable_xfer_presets_list[$o] == 'STAGING') ) { if (preg_match('/1$|3$|5$|7$|9$/i', $k)) {$bgcolor='class="records_list_x"';} diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index b4139c05..28f03104 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20220218195501 +# version: 20220310084801 users-user User ID 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. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. 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. users-force_change_password Force Change Password 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 or the agent screen. Default is N. @@ -270,7 +270,7 @@ campaigns-get_call_launch Get Call Launch This menu allows you to choose wh campaigns-browser_alert_sound Agent Browser Call Alert Sound This is the sound that will be played in the web browser that the agent is logged into the agent screen with when a call arrives into the agent session. Default is ---NONE--- for no sound. campaigns-xferconf_a_dtmf Xfer-Conf DTMF These fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the agent screen will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. If you want to allow Consultative Transfers, a fronter to a closer, have the agent use the CONSULTATIVE checkbox, which does not work for third party non-agent consultative calls. For those just have the agent click the Dial With Customer button. Then the agent can just LEAVE-3WAY-CALL and move on to their next call. If you want to allow Blind transfers of customers to an AGI script for logging or an IVR, then place AXFER in the number-to-dial field. You can also specify a custom extension after the AXFER, for instance if you want to do a call to a special IVR you have set to extension 83900 you would put AXFER83900 in the number-to-dial field. campaigns-prepopulate_transfer_preset PrePopulate Transfer Preset This option will fill in the Number to Dial field in the Transfer Conference frame of the agent screen if defined. Default is N for disabled. -campaigns-enable_xfer_presets Enable Transfer Presets This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED. CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature. +campaigns-enable_xfer_presets Enable Transfer Presets This option will enable the Presets sub menu to appear at the top of the Campaign Modification page, and also you will have the ability to specify Preset dialing numbers for Agents to use in the Transfer-Conference frame of the agent interface. Default is DISABLED. CONTACTS is an option only if contact_information is enabled on your system, that is a custom feature. STAGING will allow you to configure Presets without having them available in the agent screen. campaigns-hide_xfer_number_to_dial Hide Transfer Number to Dial This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED. campaigns-quick_transfer_button Quick Transfer Button This option will add a Quick Transfer button to the agent screen below the Transfer-Conf button that will allow one click blind transferring of calls to the selected In-Group or number. IN_GROUP will send calls to the Default Xfer Group for this Campaign, or In-Group if there was an inbound call. The PRESET options will send the calls to the preset selected. Default is N for disabled. The LOCKED options are used to lock the value to the Quick Transfer Button even if the agent uses the transfer conference features during a call before using the Quick Transfer Button. campaigns-transfer_button_launch Transfer-Conf Button Launch This feature allows you to have a Webform or agent screen tab trigger when the Transfer Conf button on the agent screen is clicked. Default is NONE. diff --git a/agc_2-X/trunk/www/vicidial/non_agent_api.php b/agc_2-X/trunk/www/vicidial/non_agent_api.php index 900f45a9..5edce5ca 100644 --- a/agc_2-X/trunk/www/vicidial/non_agent_api.php +++ b/agc_2-X/trunk/www/vicidial/non_agent_api.php @@ -192,10 +192,11 @@ # 220126-2116 - Added dispo_call_url and alt URL options for update_campaign. Added 'update_alt_url' function # 220223-0838 - Added allow_web_debug system setting # 220307-0937 - Added 'update_presets' function +# 220310-0825 - Added DELETE action to the 'update_presets' function # -$version = '2.14-169'; -$build = '220307-0937'; +$version = '2.14-170'; +$build = '220310-0825'; $php_script='non_agent_api.php'; $api_url_log = 0; @@ -8570,13 +8571,37 @@ if ($function == 'update_presets') $updateSQL = "$preset_numberSQL$preset_dtmfSQL$preset_hide_numberSQL"; - if (strlen($updateSQL)< 3) + if ( (strlen($updateSQL)< 3) or ($action == 'DELETE') ) { - $result = 'NOTICE'; - $result_reason = "update_presets NO UPDATES DEFINED"; - $data = "$updateSQL"; - echo "$result: $result_reason: |$user|$data\n"; - api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + if ($action == 'DELETE') + { + $stmt="DELETE FROM vicidial_xfer_presets WHERE campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_to_mysqli($stmt, $link); + $del_count = mysqli_affected_rows($link); + if ($DB) {echo "$del_count|$preset_name|$stmt|\n";} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='$event_section', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN API DELETE PRESET', event_sql=\"$SQL_log\", event_notes='campaign: $campaign_id|preset_name: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + + $result = 'SUCCESS'; + $result_reason = "update_presets PRESET HAS BEEN DELETED"; + $data = "$preset_name|$campaign_id"; + echo "$result: $result_reason - $user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "update_presets NO UPDATES DEFINED"; + $data = "$updateSQL"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } } else {
"._QXZ("CAMPAIGN").""._QXZ("NAME")."