Added cid_choice option to transfer_conference Agent API function

git-svn-id: svn://192.168.202.10@3132 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2019-09-01 14:37:35 +00:00
parent 151d938a9e
commit 27f9e89c19
3 changed files with 50 additions and 10 deletions
+5 -1
View File
@@ -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|
+33 -6
View File
@@ -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<!-- $stmt -->";}
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$result = _QXZ("SUCCESS");
$result_reason = _QXZ("transfer_conference function set");
+12 -3
View File
@@ -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 = '<?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 ?>';
var orig_three_way_call_cid = '<?php echo $three_way_call_cid ?>';
var outbound_cid = '<?php echo $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))