From 40b532975a8e714305710dc8ae62daf3f66f1c6c Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 10 Dec 2013 21:24:16 +0000 Subject: [PATCH] Fixed manual dial CID choice issue with AC-CID settings git-svn-id: svn://192.168.202.10@2049 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/agc/vdc_db_query.php | 12 ++++++++---- www/agc/vicidial.php | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index e2e4370f..3fd879a1 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -95,6 +95,7 @@ # - $qm_dispo_code # - $dial_ingroup # - $nocall_dial_flag +# - $cid_lock = ('0','1') # # # CHANGELOG: @@ -338,10 +339,11 @@ # 130925-2108 - Fixed issue with List webform overrides # 131208-2157 - Added user log TIMEOUTLOGOUT event status # 131209-1522 - Added called_count to log and closer log tables, fixed unanswered call logging issue +# 131210-1400 - Fixed manual dial CID choice issue with AC-CID settings # -$version = '2.8-236'; -$build = '131209-1522'; +$version = '2.8-237'; +$build = '131210-1400'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=533; $one_mysql_log=0; @@ -576,6 +578,8 @@ if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} if (isset($_GET["orig_pass"])) {$orig_pass=$_GET["orig_pass"];} elseif (isset($_POST["orig_pass"])) {$orig_pass=$_POST["orig_pass"];} +if (isset($_GET["cid_lock"])) {$cid_lock=$_GET["cid_lock"];} + elseif (isset($_POST["cid_lock"])) {$cid_lock=$_POST["cid_lock"];} header ("Content-type: text/html; charset=utf-8"); @@ -2553,7 +2557,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $row=mysqli_fetch_row($rslt); $use_custom_cid = $row[0]; - if ($use_custom_cid == 'AREACODE') + if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) { $temp_ac = substr("$agent_dialed_number", 0, 3); $stmt = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;"; @@ -3329,7 +3333,7 @@ if ($ACTION == 'manDiaLonly') { $row=mysqli_fetch_row($rslt); $use_custom_cid = $row[0]; - if ($use_custom_cid == 'AREACODE') + if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) { $temp_ac = substr("$phone_number", 0, 3); $stmt = "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode='$temp_ac' and active='Y' order by call_count_today limit 1;"; diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 6fd8e1b0..872a8ef5 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -415,10 +415,11 @@ # 131010-2149 - Added option to allow manual dial by lead_id # 131208-2331 - Added campaign options for max dead, dispo and pause time. Changed CB blink to CSS # 131209-1604 - Addded called_count logging +# 131210-1354 - Fixed manual dial CID choice issue with AC-CID settings # -$version = '2.8-384c'; -$build = '131209-1604'; +$version = '2.8-385c'; +$build = '131210-1354'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=79; $one_mysql_log=0; @@ -3754,6 +3755,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var dispo_max_dispo=''; var dead_auto_dispo_count=0; var dead_auto_dispo_finish=0; + var cid_lock=0; var DiaLControl_auto_HTML = "\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; @@ -4124,13 +4126,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (three_way_call_cid == 'CAMPAIGN') {threeway_cid = campaign_cid;} if (three_way_call_cid == 'AGENT_PHONE') - {threeway_cid = outbound_cid;} + { + cid_lock=1; + threeway_cid = outbound_cid; + } if (three_way_call_cid == 'CUSTOMER') - {threeway_cid = document.vicidial_form.phone_number.value;} + { + cid_lock=1; + threeway_cid = document.vicidial_form.phone_number.value; + } if (three_way_call_cid == 'CUSTOM_CID') {threeway_cid = document.vicidial_form.security_phrase.value;} if (three_way_call_cid == 'AGENT_CHOOSE') { + cid_lock=1; threeway_cid = cid_choice; if (active_group_alias.length > 1) {var sending_group_alias = 1;} @@ -4142,7 +4151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_string = manual_number.toString(); var threeway_cid='1'; if (manual_dial_cid == 'AGENT_PHONE') - {threeway_cid = outbound_cid;} + { + cid_lock=1; + threeway_cid = outbound_cid; + } } var regXFvars = new RegExp("XFER","g"); if (manual_string.match(regXFvars)) @@ -4346,7 +4358,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var call_cid = campaign_cid;} } - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias="+ usegroupalias + "&preset_name=" + taskpresetname + "&campaign=" + campaign + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + CheckDEADcallON + "&" + alertquery + "&call_variables=" + taskvariables; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias="+ usegroupalias + "&preset_name=" + taskpresetname + "&campaign=" + campaign + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + CheckDEADcallON + "&" + alertquery + "&cid_lock=" + cid_lock + "&call_variables=" + taskvariables; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -7326,14 +7338,17 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { var call_cid = campaign_cid; if (manual_dial_cid == 'AGENT_PHONE') - {call_cid = outbound_cid;} + { + cid_lock=1; + call_cid = outbound_cid; + } } if (prefix_choice.length > 0) {var call_prefix = prefix_choice;} else {var call_prefix = manual_dial_prefix;} - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&vtiger_callback_id=" + vtiger_callback_id + "&dial_method=" + dial_method + "&manual_dial_call_time_check=" + manual_dial_call_time_check + "&qm_extension=" + qm_extension + "&dial_ingroup=" + active_ingroup_dial + "&nocall_dial_flag=" + nocall_dial_flag; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&vtiger_callback_id=" + vtiger_callback_id + "&dial_method=" + dial_method + "&manual_dial_call_time_check=" + manual_dial_call_time_check + "&qm_extension=" + qm_extension + "&dial_ingroup=" + active_ingroup_dial + "&nocall_dial_flag=" + nocall_dial_flag + "&cid_lock=" + cid_lock; // alert(manual_dial_filter + "\n" +manDiaLnext_query); xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); @@ -7891,14 +7906,17 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { var call_cid = campaign_cid; if (manual_dial_cid == 'AGENT_PHONE') - {call_cid = outbound_cid;} + { + cid_lock=1; + call_cid = outbound_cid; + } } if (prefix_choice.length > 0) {var call_prefix = prefix_choice;} else {var call_prefix = manual_dial_prefix;} - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value + "&qm_extension=" + qm_extension + "&old_CID=" + LastCallCID; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value + "&qm_extension=" + qm_extension + "&old_CID=" + LastCallCID + "&cid_lock=" + cid_lock; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); @@ -9580,6 +9598,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) MD_ring_secondS = 0; CalLCID = ''; MDnextCID = ''; + cid_lock=0; // UPDATE VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS DialLog("end",nodeletevdac); @@ -10573,6 +10592,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.vicidial_form.MDType.value = ''; document.vicidial_form.MDPhonENumbeRHiddeN.value = ''; inbound_lead_search=0; + cid_lock=0; if (post_phone_time_diff_alert_message.length > 10) {