diff --git a/docs/AGENT_API.txt b/docs/AGENT_API.txt index bb539967..351373b8 100644 --- a/docs/AGENT_API.txt +++ b/docs/AGENT_API.txt @@ -1,4 +1,4 @@ -AGENT API DOCUMENT Started: 2008-07-03 Updated: 2012-08-19 +AGENT API DOCUMENT Started: 2008-07-03 Updated: 2012-09-13 This document describes the functions of an API(Application Programming Interface) for the VICIDIAL Agent screen. This functionality will be rather limited at first @@ -614,6 +614,8 @@ VALUES: OPTIONAL, when you want to do a consultative transfer with your customer and another ViciDial agent, 'YES' and 'NO' are valid options, you can only use this with DIAL_WITH_CUSTOMER or PARK_CUSTOMER_DIAL dial_override - OPTIONAL, dials exactly the phone number specified with no campaign-defined phone code or prefix + group_alias - + OPTIONAL, defines what caller ID number to use when doing DIAL_WITH_CUSTOMER or PARK_CUSTOMER_DIAL EXAMPLE URLS: http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=transfer_conference&value=HANGUP_XFER @@ -636,6 +638,8 @@ ERROR: no user found - 6666 ERROR: ingroup is not valid - XYZINGROUP 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 SUCCESS: transfer_conference function set - LOCAL_CLOSER|SALESLINE||YES|6666 diff --git a/www/agc/api.php b/www/agc/api.php index 19255ec5..47562c7f 100644 --- a/www/agc/api.php +++ b/www/agc/api.php @@ -61,10 +61,11 @@ # 120731-1206 - Allow dot in vendor_id # 120809-2338 - Added recording and webserver functions # 120819-1758 - Added webphone_url and call_agent functions +# 120913-2039 - Added group_alias to transfer_conference function # -$version = '2.6-27'; -$build = '120819-1758'; +$version = '2.6-28'; +$build = '120913-2039'; $startMS = microtime(); @@ -2882,8 +2883,40 @@ if ($function == 'transfer_conference') else { $SUCCESS++; - - $external_transferconf = "$value---$ingroup_choices---$phone_number---$consultative---"; + + $caller_id_number=''; + if (strlen($group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_id_number = $row[0]; + if ($caller_id_number < 4) + { + $result = 'ERROR'; + $result_reason = "caller_id_number from group_alias is not valid"; + $data = "$group_alias|$caller_id_number"; + 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; + } + } + else + { + $result = 'ERROR'; + $result_reason = "group_alias is not valid"; + $data = "$group_alias"; + 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"; } } } @@ -2892,8 +2925,40 @@ if ($function == 'transfer_conference') ### START other transfers ### if ( ($processed < 1) and (($value=='BLIND_TRANSFER') or ($value=='LEAVE_VM') or ($value=='DIAL_WITH_CUSTOMER') or ($value=='PARK_CUSTOMER_DIAL')) ) { + $caller_id_number=''; + if (strlen($group_alias)>1) + { + $stmt = "select caller_id_number from groups_alias where group_alias_id='$group_alias';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $VDIG_cidnum_ct = mysql_num_rows($rslt); + if ($VDIG_cidnum_ct > 0) + { + $row=mysql_fetch_row($rslt); + $caller_id_number = $row[0]; + if ($caller_id_number < 4) + { + $result = 'ERROR'; + $result_reason = "caller_id_number from group_alias is not valid"; + $data = "$group_alias|$caller_id_number"; + 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; + } + } + else + { + $result = 'ERROR'; + $result_reason = "group_alias is not valid"; + $data = "$group_alias"; + 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"; + $external_transferconf = "$value------$phone_number---NO---$dial_override---$group_alias---$caller_id_number"; $SUCCESS++; } diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index dd49b4fb..cc2707f2 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -383,10 +383,11 @@ # 120518-1225 - Added transfer call to answering machine message with hotkey (LTMG or XFTAMM) # 120810-0056 - Added recording api function # 120819-1747 - Added vicidial_session_data logging for webphone api function +# 120914-1357 - Added group_alias to transfer_conference function # -$version = '2.6-351c'; -$build = '120819-1747'; +$version = '2.6-352c'; +$build = '120914-1357'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=79; $one_mysql_log=0; @@ -3551,6 +3552,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var api_transferconf_number=''; var api_transferconf_consultative=''; var api_transferconf_override=''; + var api_transferconf_group_alias=''; + var api_transferconf_cid_number=''; var api_parkcustomer=''; var API_selected_xfergroup=''; var API_selected_callmenu=''; @@ -4478,6 +4481,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) api_transferconf_number = api_transferconf_values_array[2]; api_transferconf_consultative = api_transferconf_values_array[3]; 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]; var APIpark_array = check_time_array[22].split("APIpark: "); api_parkcustomer = APIpark_array[1]; @@ -4522,6 +4527,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) {document.vicidial_form.xferoverride.checked=true;} API_selected_xfergroup = api_transferconf_group; 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_function == 'PARK_CUSTOMER_DIAL') @@ -4534,6 +4541,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) {document.vicidial_form.xferoverride.checked=true;} API_selected_xfergroup = api_transferconf_group; document.vicidial_form.xfernumber.value = api_transferconf_number; + active_group_alias = api_transferconf_group_alias; + cid_choice = api_transferconf_cid_number; xfer_park_dial(); } external_transferconf_count=3;