Added new System Settings option to allow sending of any CallerID through the Agent API for external_dial outbound calls.
git-svn-id: svn://192.168.202.10@3209 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -492,6 +492,9 @@ OTHER CHANGES:
|
||||
Modify page to send a shortcut URL link for the agent to more easily
|
||||
log into the agent screen. Must be enabled in System Settings.
|
||||
|
||||
138. Added new System Settings option to allow sending of any CallerID through
|
||||
the Agent API for external_dial outbound calls.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2019-09-01
|
||||
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2020-04-03
|
||||
|
||||
This document describes the functions of an API(Application Programming Interface)
|
||||
for the VICIDIAL Agent screen. This functionality will be rather limited at first
|
||||
@@ -257,6 +257,9 @@ alt_dial -
|
||||
an ERROR will be returned
|
||||
dial_ingroup -
|
||||
OPTIONAL, place the call as an in-group outbound calls
|
||||
outbound_cid -
|
||||
OPTIONAL, the CallerID to send for this outbound call. NOTE: This will only work if "Outbound Call Any CID" is enabled in System Settings!
|
||||
|
||||
|
||||
EXAMPLE URLS:
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_dial&value=7275551212&phone_code=1&search=YES&preview=NO&focus=YES
|
||||
@@ -270,6 +273,7 @@ ERROR: agent_user is not logged in - 6666
|
||||
ERROR: agent_user is not allowed to place manual dial calls - 6666
|
||||
ERROR: caller_id_number from group_alias is not valid - 6666|TESTING|123
|
||||
ERROR: group_alias is not valid - 6666|TESTING
|
||||
ERROR: outbound_cid is not allowed on this system - 6666|3125551212|DISABLED
|
||||
ERROR: vtiger callback activity does not exist in vtiger system - 12345
|
||||
ERROR: phone_number is already in this agents manual dial queue - 6666|7275551211
|
||||
ERROR: lead_id is not valid - 6666|1234567
|
||||
|
||||
@@ -1848,7 +1848,8 @@ enable_first_webform ENUM('0','1') default '1',
|
||||
recording_buttons VARCHAR(30) default 'START_STOP',
|
||||
opensips_cid_name ENUM('0','1') default '0',
|
||||
require_password_length TINYINT(3) UNSIGNED default '0',
|
||||
user_account_emails ENUM('DISABLED','SEND_NO_PASS','SEND_WITH_PASS') DEFAULT 'DISABLED'
|
||||
user_account_emails ENUM('DISABLED','SEND_NO_PASS','SEND_WITH_PASS') DEFAULT 'DISABLED',
|
||||
outbound_cid_any ENUM('DISABLED','API_ONLY') DEFAULT 'DISABLED'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -4593,4 +4594,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1589',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1590',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -1181,3 +1181,7 @@ UPDATE system_settings SET db_schema_version='1588',db_schema_update_date=NOW()
|
||||
ALTER TABLE system_settings ADD user_account_emails ENUM('DISABLED','SEND_NO_PASS','SEND_WITH_PASS') DEFAULT 'DISABLED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1589',db_schema_update_date=NOW() where db_schema_version < 1589;
|
||||
|
||||
ALTER TABLE system_settings ADD outbound_cid_any ENUM('DISABLED','API_ONLY') DEFAULT 'DISABLED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1590',db_schema_update_date=NOW() where db_schema_version < 1590;
|
||||
|
||||
+26
-4
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# api.php
|
||||
#
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed as an API(Application Programming Interface) to allow
|
||||
# other programs to interact with the VICIDIAL Agent screen
|
||||
@@ -99,10 +99,11 @@
|
||||
# 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
|
||||
# 200403-1510 - Added outbound_cid option to external_dial function
|
||||
#
|
||||
|
||||
$version = '2.14-65';
|
||||
$build = '190901-0952';
|
||||
$version = '2.14-66';
|
||||
$build = '200403-1510';
|
||||
|
||||
$startMS = microtime();
|
||||
|
||||
@@ -247,6 +248,8 @@ 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"];}
|
||||
if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];}
|
||||
elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];}
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
@@ -272,7 +275,7 @@ if ($sl_ct > 0)
|
||||
$VUuser_group = $row[3];
|
||||
}
|
||||
|
||||
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging,outbound_cid_any FROM system_settings;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -284,6 +287,7 @@ if ($qm_conf_ct > 0)
|
||||
$SSenable_languages = $row[1];
|
||||
$SSlanguage_method = $row[2];
|
||||
$SSagent_debug_logging = $row[3];
|
||||
$SSoutbound_cid_any = $row[4];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -371,6 +375,7 @@ if ($non_latin < 1)
|
||||
$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);
|
||||
$outbound_cid = preg_replace("/[^-\_0-9a-zA-Z]/","",$outbound_cid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1685,6 +1690,23 @@ if ($function == 'external_dial')
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if (strlen($outbound_cid)>1)
|
||||
{
|
||||
if ($SSoutbound_cid_any != 'API_ONLY')
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("outbound_cid is not allowed on this system");
|
||||
$data = "$outbound_cid|$SSoutbound_cid_any";
|
||||
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
|
||||
{
|
||||
$caller_id_number = $outbound_cid;
|
||||
$group_alias='-FORCE-';
|
||||
}
|
||||
}
|
||||
|
||||
####### Begin Vtiger CallBack Launching #######
|
||||
$vtiger_callback_id='';
|
||||
|
||||
@@ -488,10 +488,11 @@
|
||||
# 200108-0947 - Added cid_group_id of NONE
|
||||
# 200122-1847 - Added code for CID Group auto-rotate feature
|
||||
# 200310-1117 - Added manual_dial_cid AGENT_PHONE_OVERRIDE option
|
||||
# 200403-1601 - Added option for forced outbound CID through API
|
||||
#
|
||||
|
||||
$version = '2.14-381';
|
||||
$build = '200310-1117';
|
||||
$version = '2.14-382';
|
||||
$build = '200403-1601';
|
||||
$php_script = 'vdc_db_query.php';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=824;
|
||||
@@ -4627,6 +4628,16 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
}
|
||||
#### END check for manual_dial_cid == 'AGENT_PHONE_OVERRIDE'
|
||||
|
||||
#### BEGIN check for API forced CID override ####
|
||||
if ( ($usegroupalias > 0) and ($account=='-FORCE-') and (strlen($campaign_cid) > 6) )
|
||||
{
|
||||
$FORCEoutbound_cid = preg_replace("/\D/",'',$campaign_cid);
|
||||
if (strlen($FORCEoutbound_cid) > 6)
|
||||
{$CCID = "$FORCEoutbound_cid"; $CCID_on++;}
|
||||
}
|
||||
#### END check for API forced CID override ####
|
||||
|
||||
|
||||
if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";}
|
||||
else {$CIDstring = "$MqueryCID$EAC";}
|
||||
|
||||
@@ -6102,6 +6113,15 @@ if ($ACTION == 'manDiaLonly')
|
||||
}
|
||||
#### END check for manual_dial_cid == 'AGENT_PHONE_OVERRIDE'
|
||||
|
||||
#### BEGIN check for API forced CID override ####
|
||||
if ( ($usegroupalias > 0) and ($account=='-FORCE-') and (strlen($campaign_cid) > 6) )
|
||||
{
|
||||
$FORCEoutbound_cid = preg_replace("/\D/",'',$campaign_cid);
|
||||
if (strlen($FORCEoutbound_cid) > 6)
|
||||
{$CCID = "$FORCEoutbound_cid"; $CCID_on++;}
|
||||
}
|
||||
#### END check for API forced CID override ####
|
||||
|
||||
#### BEGIN run manual_dial_hopper_check process if enabled
|
||||
if ($manual_dial_hopper_check == 'Y')
|
||||
{
|
||||
|
||||
+13
-4
@@ -631,10 +631,11 @@
|
||||
# 191227-1227 - Fix for translation phrases gathering process
|
||||
# 200123-1554 - PHP7 fix for array
|
||||
# 200310-1116 - Added manual_dial_cid AGENT_PHONE_OVERRIDE option
|
||||
# 200403-1539 - Added Manual Dial API outbound_cid function
|
||||
#
|
||||
|
||||
$version = '2.14-600c';
|
||||
$build = '200310-1116';
|
||||
$version = '2.14-601c';
|
||||
$build = '200403-1539';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=91;
|
||||
$one_mysql_log=0;
|
||||
@@ -749,7 +750,7 @@ if ($sl_ct > 0)
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any FROM system_settings;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -798,6 +799,7 @@ if ($qm_conf_ct > 0)
|
||||
$SSenable_second_script = $row[38];
|
||||
$SSenable_first_webform = $row[39];
|
||||
$SSrecording_buttons = $row[40];
|
||||
$SSoutbound_cid_any = $row[41];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4966,6 +4968,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var webphone_call_seconds='<?php echo $webphone_call_seconds ?>';
|
||||
var temp_webphone_call_seconds=0;
|
||||
var SSenable_second_script='<?php echo $SSenable_second_script ?>';
|
||||
var SSoutbound_cid_any='<?php echo $SSoutbound_cid_any ?>';
|
||||
var DiaLControl_auto_HTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_paused.gif") ?>\" border=\"0\" alt=\"You are paused\" /></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_active.gif") ?>\" border=\"0\" alt=\"You are active\" /></a>";
|
||||
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/<?php echo _QXZ("vdc_LB_blank_OFF.gif") ?>\" border=\"0\" alt=\"pause button disabled\" />";
|
||||
@@ -9624,7 +9627,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
if (xmlhttp)
|
||||
{
|
||||
if (cid_choice.length > 3)
|
||||
{var call_cid = cid_choice;}
|
||||
{
|
||||
var call_cid = cid_choice;
|
||||
if (active_group_alias == '-FORCE-')
|
||||
{cid_lock=1;}
|
||||
}
|
||||
else
|
||||
{
|
||||
var call_cid = campaign_cid;
|
||||
@@ -10555,6 +10562,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
{
|
||||
var call_cid = cid_choice;
|
||||
usegroupalias=1;
|
||||
if (active_group_alias == '-FORCE-')
|
||||
{cid_lock=1;}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
# version: 20200401000001
|
||||
# version: 20200403162401
|
||||
users-user User ID <QXZ>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.</QXZ>
|
||||
users-pass Password <QXZ>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.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>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. Default is N.</QXZ>
|
||||
@@ -1052,6 +1052,7 @@ settings-enhanced_disconnect_logging Enhanced Disconnect Logging <QXZ>This setti
|
||||
settings-sip_event_logging SIP Event Logging <QXZ>This setting will enable logging of SIP events on outbound phone calls for servers that are running patched versions of Asterisk 13 or higher. Default is 0 for disabled.</QXZ>
|
||||
settings-cache_carrier_stats_realtime Cached Realtime Carrier Stats <QXZ>This setting if enabled will change the real-time report from gathering the carrier log stats every time it is refreshed on every screen it is running on, to a cached set of carrier log stats that are refreshed once per minute. Default is 0 for disabled.</QXZ>
|
||||
settings-campaign_cid_areacodes_enabled Enable CID Groups and Campaign Areacode CID <QXZ>This setting enables the ability to set specific outbound callerid numbers to be used per areacode for a campaign, as well as CID Groups which allows both per areacode and per state options for groups of CallerID numbers for one or multiple campaigns. Default is 1 for enabled.</QXZ>
|
||||
settings-outbound_cid_any Outbound Call Any CID <QXZ>This option allows you to use any Outbound CallerID that is set in the Agent API external_dial function to override whatever the settings for the campaign say the CID should be for that call. Default is DISABLED.</QXZ>
|
||||
settings-opensips_cid_name OpenSIPs CID Name Support <QXZ>If your system is using an OpenSIPs server to route outbound phone calls, and your system administrator has set up that server to be able to send CallerID Name through it, you can enable this setting to allow you to define an OpenSIPs CallerID Name in the Campaign Detail screen. Default is 0 for disabled.</QXZ>
|
||||
settings-did_ra_extensions_enabled Enable Remote Agent Extension Overrides <QXZ>This setting enables DIDs to have extension overrides for remote agent routed calls through in-groups. Default is 0 for disabled.</QXZ>
|
||||
settings-agent_whisper_enabled Enable Agent Whisper Monitoring <QXZ>This setting allows a manager to be able to speak to a logged in agent without the customer being able to hear them. WARNING, this feature is considered experimental and may not function properly in some cases. Older versions of Asterisk have shown to have serious issues at times with this feature and can cause Asterisk to freeze or crash. Default is 0 for disabled.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user