From 5426fc250fea46b2d6e3b2649960bd701240b790 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 16 Mar 2021 02:57:36 +0000 Subject: [PATCH] Added new manual_dial_filter CALLBACK options, Issue #1139 git-svn-id: svn://192.168.202.10@3384 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/agc/vdc_db_query.php | 53 +++++++++++++++- www/agc/vicidial.php | 10 ++- www/vicidial/admin.php | 96 +++++++++++++++++++++++++++-- www/vicidial/help_documentation.txt | 4 +- 4 files changed, 151 insertions(+), 12 deletions(-) diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 1f9be316..9e6efa95 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -500,13 +500,14 @@ # 201117-0820 - Changes for better compatibility with non-latin data input # 201122-1038 - Added Daily call count limit features # 210309-2343 - Small change to Fake-call-logging in QM for some queuemetrics_pausereason settings +# 210315-2105 - Added CALLBACK manual dial filter option # -$version = '2.14-393'; -$build = '210309-2343'; +$version = '2.14-394'; +$build = '210315-2105'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=844; +$mysql_log_count=850; $one_mysql_log=0; $DB=0; $VD_login=0; @@ -2543,6 +2544,35 @@ if ($ACTION == 'manDiaLnextCaLL') exit; } } + if (preg_match("/CALLBACK/",$manual_dial_filter)) + { + $stmt="SELECT count(*) FROM vicidial_callbacks where lead_id='$lead_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00845',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysqli_fetch_row($rslt); + $MDF_search_flag='MAIN'; + + if ($row[0] < 1) + { + ### purge from the dial queue and api + $stmt = "DELETE from vicidial_manual_dial_queue where phone_number='$phone_number' and user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00846',$user,$server_ip,$session_name,$one_mysql_log);} + $VMDQaffected_rows = mysqli_affected_rows($link); + + $stmt = "UPDATE vicidial_live_agents set external_dial='' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00847',$user,$server_ip,$session_name,$one_mysql_log);} + $VLAEDaffected_rows = mysqli_affected_rows($link); + + echo "NUMBER NOT A CALLBACK\n"; + if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} + exit; + } + } ### END check for manual dial filtering ### if ($lookup_empty_insert_lead > 0) @@ -5738,6 +5768,23 @@ if ($ACTION == 'manDiaLonly') ### BEGIN check phone filtering for DNC or camplists if enabled ### manual_dnc_check($phone_number, 0, 1); + if (preg_match("/CALLBACK/",$manual_dial_filter)) + { + $stmt="SELECT count(*) FROM vicidial_callbacks where lead_id='$lead_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00848',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $row=mysqli_fetch_row($rslt); + $MDF_search_flag='MAIN'; + + if ($row[0] < 1) + { + echo " CALL NOT PLACED\nNUMBER NOT A CALLBACK\n"; + if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} + exit; + } + } + if (preg_match("/CAMPLISTS/",$manual_dial_filter)) { $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'"; diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 054dcb5d..0a77ea32 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -655,10 +655,11 @@ # 201201-2015 - Added transfer_button_launch feature # 210222-0819 - Fixes for manual dial agent-state issues and a translation issue # 210312-1520 - Force clearing of webphone panel upon logout +# 210315-2102 - Added CALLBACK manual dial filter option, Issue #1139 # -$version = '2.14-623c'; -$build = '210312-1520'; +$version = '2.14-624c'; +$build = '210315-2102'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=92; $one_mysql_log=0; @@ -10095,8 +10096,9 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var regMNHDCCLvar = new RegExp("NO-HOPPER DAILY CALL LIMIT","ig"); var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); var regMDFvarSYS = new RegExp("SYSTEM","ig"); + var regMDFvarCB = new RegExp("CALLBACK","ig"); var regMDFvarTIME = new RegExp("OUTSIDE","ig"); - if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarDCCL)) || (MDnextCID.match(regMDFvarCAMP)) || (MDnextCID.match(regMDFvarSYS)) || (MDnextCID.match(regMDFvarTIME)) ) + if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarDCCL)) || (MDnextCID.match(regMDFvarCAMP)) || (MDnextCID.match(regMDFvarSYS)) ||(MDnextCID.match(regMDFvarCB)) || (MDnextCID.match(regMDFvarTIME)) ) { button_click_log = button_click_log + "" + SQLdate + "-----DialNextFailed---" + MDnextCID + " " + "|"; @@ -10123,6 +10125,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} if (MDnextCID.match(regMDFvarSYS)) {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} + if (MDnextCID.match(regMDFvarCB)) + {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} if (MDnextCID.match(regMDFvarTIME)) {alert_box("\n" + mdnPhonENumbeR); alert_displayed=1;} diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index f35316db..f6cfcb08 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -5534,12 +5534,13 @@ if ($SSscript_remove_js > 0) # 210312-1456 - Small change to Copy User page # 210314-0919 - Added more enhanced_disconnect_logging options in System Settings # 210315-1730 - Added clear_form campaign option, Issue #1179 +# 210315-2118 - Added new manual_dial_filter CALLBACK options, Issue #1139 # # 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-798a'; -$build = '210315-1730'; +$admin_version = '2.14-799a'; +$build = '210315-2118'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -26400,13 +26401,100 @@ if ($ADD==31) echo ""._QXZ("Manual Dial List ID").": $NWB#campaigns-manual_dial_list_id$NWE\n"; - echo ""._QXZ("Manual Dial Filter").": $NWB#campaigns-manual_dial_filter$NWE\n"; + echo ""._QXZ("Manual Dial Filter").": $NWB#campaigns-manual_dial_filter$NWE\n"; echo ""._QXZ("Manual Preview Dial").": $NWB#campaigns-manual_preview_dial$NWE\n"; echo ""._QXZ("Manual Dial Search Checkbox").": $NWB#campaigns-manual_dial_search_checkbox$NWE\n"; - echo ""._QXZ("Manual Dial Search Filter").": $NWB#campaigns-manual_dial_search_filter$NWE\n"; + echo ""._QXZ("Manual Dial Search Filter").": $NWB#campaigns-manual_dial_search_filter$NWE\n"; echo ""._QXZ("Manual Dial by Lead ID").": $NWB#campaigns-manual_dial_lead_id$NWE\n"; diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index cdfba4e9..09b4816e 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20210315172801 +# version: 20210315212201 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. 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. @@ -340,7 +340,7 @@ campaigns-display_queue_count Agent Display Queue Count If set to Y, when a campaigns-manual_dial_override Manual Dial Override The setting can override the Users setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Users setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE. campaigns-manual_dial_override_field Manual Dial Override Field The setting if set to ENABLED will show the Manual Dial Override field in the agent screen. Default is ENABLED. campaigns-manual_dial_list_id Manual Dial List ID The default list_id to be used when an agent places a manual call and a new lead record is created in the list table. Default is 999. This field can contain digits only. -campaigns-manual_dial_filter Manual Dial Filter This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists. CAMPLISTS_ALL - will include inactive lists in the search for the number. WITH_ALT will also search the Alt Phone field for the phone number. WITH_ALT_ADDR3 will also search the Alt Phone field and the Address 3 field for the phone number. As for the DNC options, DNC will use the campaign settings for DNC filtering, CAMPDNC will ignore the campaign DNC settings and will use the this campaign DNC list, INTERNALDNC will ignore the campaign DNC settings and will use the internal DNC list, SYSTEM - will include all phone numbers in the system +campaigns-manual_dial_filter Manual Dial Filter This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists. CAMPLISTS_ALL - will include inactive lists in the search for the number. WITH_ALT will also search the Alt Phone field for the phone number. WITH_ALT_ADDR3 will also search the Alt Phone field and the Address 3 field for the phone number. As for the DNC options, DNC will use the campaign settings for DNC filtering, CAMPDNC will ignore the campaign DNC settings and will use the this campaign DNC list, INTERNALDNC will ignore the campaign DNC settings and will use the internal DNC list, SYSTEM - will include all phone numbers in the system, CALLBACK - must be set as an ACTIVE or LIVE Scheduled Callbacks campaigns-manual_dial_search_checkbox Manual Dial Search Checkbox This allows you to define if you want the manual dial search checkbox to be selected by default or not. If an option with RESET is chosen, then the checkbox will be reset after every call. If an option with LOCK is chosen, then the agent will not be able to click on the checkbox. Default is SELECTED. campaigns-manual_dial_search_filter Manual Dial Search Filter This allows the agent to search only within lists belonging to this campaign when the agent has the Manual Dial Search Checkbox selected in the manual dial screen. The options are, CAMPLISTS_ONLY - will check for the number within the active lists for the campaign, CAMPLISTS_ALL - will also include inactive lists in the search for the number, NONE - no filter on manual dial searching. Default is NONE. If a lead is not found, then a new lead will be added. WITH_ALT will also search the Alt Phone field for the phone number. WITH_ALT_ADDR3 will also search the Alt Phone field and the Address 3 field for the phone number. campaigns-manual_preview_dial Manual Preview Dial This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP.