diff --git a/agc_2-X/trunk/docs/AGENT_API.txt b/agc_2-X/trunk/docs/AGENT_API.txt index c9506652..c425e41a 100644 --- a/agc_2-X/trunk/docs/AGENT_API.txt +++ b/agc_2-X/trunk/docs/AGENT_API.txt @@ -1,4 +1,4 @@ -AGENT API DOCUMENT Started: 2008-07-03 Updated: 2019-02-22 +AGENT API DOCUMENT Started: 2008-07-03 Updated: 2019-09-01 This document describes the functions of an API(Application Programming Interface) for the VICIDIAL Agent screen. This functionality will be rather limited at first @@ -663,6 +663,8 @@ VALUES: OPTIONAL, dials exactly the phone number specified with no campaign-defined phone code or prefix, 'YES' and 'NO' are valid options group_alias - OPTIONAL, defines what caller ID number to use when doing DIAL_WITH_CUSTOMER or PARK_CUSTOMER_DIAL + cid_choice - + OPTIONAL, alternate method for caller ID number to use when doing DIAL_WITH_CUSTOMER or PARK_CUSTOMER_DIAL: 'CAMPAIGN','AGENT_PHONE','CUSTOMER','CUSTOM_CID' EXAMPLE URLS: http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=HANGUP_XFER @@ -675,6 +677,7 @@ http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&functi http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=DIAL_WITH_CUSTOMER&ingroup_choices=TEST_IN3&consultative=YES http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=DIAL_WITH_CUSTOMER&phone_number=8500 http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=DIAL_WITH_CUSTOMER&phone_number=919998888112&dial_override=YES +http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=DIAL_WITH_CUSTOMER&phone_number=919998888112&cid_choice=CUSTOMER http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=PARK_CUSTOMER_DIAL&ingroup_choices=TEST_IN3&consultative=YES http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=LEAVE_3WAY_CALL @@ -687,6 +690,7 @@ ERROR: agent_user is not logged in - 6666 ERROR: agent_user does not have a live call - 6666 ERROR: caller_id_number from group_alias is not valid - 6666|TESTING|123 ERROR: group_alias is not valid - 6666|TESTING +ERROR: cid_choice is not valid - 6666|TESTING SUCCESS: transfer_conference function set - LOCAL_CLOSER|SALESLINE||YES|6666|M2141842580000000044| diff --git a/agc_2-X/trunk/www/agc/api.php b/agc_2-X/trunk/www/agc/api.php index 5b19646e..976c428e 100644 --- a/agc_2-X/trunk/www/agc/api.php +++ b/agc_2-X/trunk/www/agc/api.php @@ -98,10 +98,11 @@ # 180903-1606 - Added count for waiting emails to calls_in_queue_count function # 180908-1433 - Added force_fronter_leave_3way function # 190222-1152 - Added force_fronter_audio_stop function +# 190901-0952 - Added cid_choice option to transfer_conference function # -$version = '2.14-64'; -$build = '190222-1152'; +$version = '2.14-65'; +$build = '190901-0952'; $startMS = microtime(); @@ -244,7 +245,8 @@ if (isset($_GET["agent_debug"])) {$agent_debug=$_GET["agent_debug"];} elseif (isset($_POST["agent_debug"])) {$agent_debug=$_POST["agent_debug"];} if (isset($_GET["dial_ingroup"])) {$dial_ingroup=$_GET["dial_ingroup"];} elseif (isset($_POST["dial_ingroup"])) {$dial_ingroup=$_POST["dial_ingroup"];} - +if (isset($_GET["cid_choice"])) {$cid_choice=$_GET["cid_choice"];} + elseif (isset($_POST["cid_choice"])) {$cid_choice=$_POST["cid_choice"];} header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -368,6 +370,7 @@ if ($non_latin < 1) $agent_debug = preg_replace("/[^- \.\:\|\_0-9a-zA-Z]/","",$agent_debug); $status = preg_replace("/[^-\_0-9a-zA-Z]/","",$status); $dial_ingroup = preg_replace("/[^-\_0-9a-zA-Z]/","",$dial_ingroup); + $cid_choice = preg_replace("/[^-\_0-9a-zA-Z]/","",$cid_choice); } else { @@ -3725,8 +3728,20 @@ if ($function == 'transfer_conference') exit; } } + if (strlen($cid_choice)>1) + { + if (!preg_match("/CAMPAIGN|AGENT_PHONE|CUSTOMER|CUSTOM_CID/",$cid_choice)) + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("cid_choice is not valid"); + $data = "$cid_choice"; + echo "$result: $result_reason - $agent_user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } - $external_transferconf = "$value---$ingroup_choices---$phone_number---$consultative------$group_alias---$caller_id_number---$epoch"; + $external_transferconf = "$value---$ingroup_choices---$phone_number---$consultative------$group_alias---$caller_id_number---$epoch---$cid_choice"; } } } @@ -3766,9 +3781,20 @@ if ($function == 'transfer_conference') exit; } } - + if (strlen($cid_choice)>1) + { + if (!preg_match("/CAMPAIGN|AGENT_PHONE|CUSTOMER|CUSTOM_CID/",$cid_choice)) + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("cid_choice is not valid"); + $data = "$cid_choice"; + echo "$result: $result_reason - $agent_user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + } $processed++; - $external_transferconf = "$value------$phone_number---NO---$dial_override---$group_alias---$caller_id_number---$epoch"; + $external_transferconf = "$value------$phone_number---NO---$dial_override---$group_alias---$caller_id_number---$epoch---$cid_choice"; $SUCCESS++; } @@ -3801,6 +3827,7 @@ if ($function == 'transfer_conference') { $stmt="UPDATE vicidial_live_agents set external_transferconf='$external_transferconf' where user='$agent_user';"; if ($format=='debug') {echo "\n";} + if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $result = _QXZ("SUCCESS"); $result_reason = _QXZ("transfer_conference function set"); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 58503547..f2a00de0 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -616,10 +616,11 @@ # 190627-2134 - Added new options for campaign agent_screen_time_display feature # 190723-1655 - Fix for script tab custom fields # 190730-0925 - Added campaign SIP Actions processing +# 190901-0956 - Added cid_choice option to API transfer_conference function # -$version = '2.14-585c'; -$build = '190730-0925'; +$version = '2.14-586c'; +$build = '190901-0956'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -4469,6 +4470,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var use_internal_dnc = ''; var use_campaign_dnc = ''; var three_way_call_cid = ''; + var orig_three_way_call_cid = ''; var outbound_cid = ''; var threeway_cid = ''; var cid_choice = ''; @@ -4642,6 +4644,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var api_transferconf_override=''; var api_transferconf_group_alias=''; var api_transferconf_cid_number=''; + var api_transferconf_cid_choice=''; var api_parkcustomer=''; var API_selected_xfergroup=''; var API_selected_callmenu=''; @@ -5614,6 +5617,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // CalL_ScripT_color=''; call_variables=''; xfer_agent_selected=0; + three_way_call_cid = orig_three_way_call_cid; } } @@ -5907,6 +5911,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) api_transferconf_override = api_transferconf_values_array[4]; api_transferconf_group_alias = api_transferconf_values_array[5]; api_transferconf_cid_number = api_transferconf_values_array[6]; + api_transferconf_cid_choice = api_transferconf_values_array[8]; var APIpark_array = check_time_array[22].split("APIpark: "); api_parkcustomer = APIpark_array[1]; @@ -6046,7 +6051,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.vicidial_form.xfernumber.value = api_transferconf_number; active_group_alias = api_transferconf_group_alias; cid_choice = api_transferconf_cid_number; - SendManualDial('YES'); + if (api_transferconf_cid_choice.length > 3) {three_way_call_cid = api_transferconf_cid_choice;} + SendManualDial('YES','YES'); } if (api_transferconf_function == 'PARK_CUSTOMER_DIAL') { @@ -10200,6 +10206,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) manual_entry_dial=0; SCRIPTweb_form_vars=''; MDcheck_for_answer=0; + three_way_call_cid = orig_three_way_call_cid; if (manual_dial_preview < 1) { document.vicidial_form.LeadPreview.checked=false; @@ -10511,6 +10518,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // CalL_ScripT_id=''; // CalL_ScripT_color=''; xfer_agent_selected=0; + three_way_call_cid = orig_three_way_call_cid; } } } @@ -14135,6 +14143,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) manual_entry_dial=0; SCRIPTweb_form_vars=''; MDcheck_for_answer=0; + three_way_call_cid = orig_three_way_call_cid; if (manual_auto_next > 0) {manual_auto_next_trigger=1; manual_auto_next_count=manual_auto_next;} if (agent_display_fields.match(adfREGentry_date))