Added Agent Events Push features

git-svn-id: svn://192.168.202.10@2764 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2017-05-31 13:38:33 +00:00
parent 7d611076ef
commit eabd28b7ef
9 changed files with 363 additions and 23 deletions
+3
View File
@@ -160,6 +160,9 @@ OTHER CHANGES:
34. Added logging of Real-Time report monitoring, and report in Admin Utilities
35. Added Agent Push Events, allowing for HTTP Push events to be sent on agent
screen events. See the AGENT_EVENTS.txt doc for more details.
+108
View File
@@ -0,0 +1,108 @@
Agent Events Push 2017-05-31
This feature allows for selected events in the VICIdial agent screen to push out event triggers through HTTP requests sent to a URL as defined in the System Settings.
There are two System Settings configurations that need to be set for Agent Events Push to work:
Agent Push Events - This setting will enable the sending of events from agent screens to the URL defined below. Default is 0 for disabled.
Agent Push URL - If Agent Push Events are enabled above, this is the URL that the events will be sent to. The variables that you can use within the URL are --A--user--B--, --A--event--B--, --A--message--B--, --A--lead_id--B--. Since this function uses AJAX, it must reference a local script on the web server. If you want to reference an external web address then you should use the get2post.php script that can be found in the extras directory.
The "agent_events" function operates through AJAX in the agent screen, and as such it can only access web scripts that are local on the web server. So, if you want to send these HTTP Push events to an external server, you will have to use a script like the get2post.php script that is included in the "extras" directory in the source code and copy it to the "agc" web directory on your webserver. Below is an example of how to populate the System Settings "Agent Push URL" field to use the get2post.php script:
get2post.php?uniqueid=--A--epoch--B--.--A--agent_log_id--B--&type=event&HTTPURLTOPOST=192.168.1.3/agc/vdc_call_url_test.php?user=--A--user--B--&lead_id=--A--lead_id--B--&event=--A--event--B--&message=--A--message--B--
The above URL is passing the following fields to the external web script: user, lead_id, event, message
Here is a list of the supported events that will be pushed out if you have configured Agent Events Push on your system:
logged_in - After the agent screen has finished loading, this event will be triggered. The session ID, server_ip, version, build and script will be attached to this event
logged_out - There are a few different types of logouts, the reason for the logout will be attached to this event
state_ready - When the agent state changes to READY or CLOSER, this event will trigger, the state will be attached to the event
state_paused - When the agent status changes to PAUSED, this event will trigger, the state will be attached to the event
call_dialed - For manual dial calls this will trigger when the call is dialed, the number dialed and number type are attached to this event
call_answered - For auto-dial and inbound calls this is the first trigger event. For manual dial it triggers when Answer signal is received. call_id is attached to event
call_dead - This indicates that the customer line has hung up before the agent clicked to hang up the call
call_script - Triggered when the script tab has loaded
other_answered - Triggers if EMAIL or CHAT is received by the agent, type will be attached to event
agent_hangup - This is when the agent hangs up the call
dispo_screen_open - The dispo screen has been opened and is awaiting the agent action to set a disposition
dispo_set - This is when the agent submits a disposition for the call they jsut finished, a message containing the selected disposition will be attached to this event
3way_start - This indicates that the agent has started a 3way call, where the call is going will be attached to this event
3way_answered - This indicates that the 3way party has answered the call
3way_agent_hangup - This indicates that the agent has clicked to hangup the 3way call
3way_agent_leave - This indicates that the agent has clicked to leave the 3way call and move to a new session
transfer_local_closer - The agent has transferred a call to an In-Group using Local Closer, the in-group transferred to will be attached to the event
transfer_blind - The agent has blind transferred a call, the destination transferred to will be attached to the event
park_started - This indicates that the agent has sent the customer to a park
park_retrieved - This indicates that the agent has received the customer back from park
park_ivr_started - This indicates that the agent has sent the customer to a park IVR
park_ivr_retrieved - This indicates that the agent has received the customer back from a park IVR
agent_alert - These are the small box agent alerts that appear to the agent, the message will be attached to this event. Example is "Dial timed out..."
login_invalid - This agent screen was not opened properly
session_disabled - Another live agent session was open using your user ID. It has been disabled. Click OK to continue to the agent screen
blind_monitor_alert - Blind monitor alerts are enabled in the campaign, and someone is monitoring this agent
manual_dial_open - The Manual Dial screen has been opened
callback_select_open - The Scheduled Callbacks date selection screen has been opened
time_sync - There is a Time Synchronization issue on the system
session_disabled - This agent's session has been disabled
customer_gone - The customer has gone screen has been opened
none_in_session - There is noone in the agent session
transfer_panel_open - The transfer conference panel has been opened
transfer_panel_closed - The transfer conference panel has been closed
ingroup_screen_open - The In-Group selection screen has been opened
territory_screen_open - The Territory selection screen has been opened
contact_search_open - The Contact search screen has been opened
lead_search_open - The lead search screen has been opened
pause_code_open - The pause code selection screen has been opened
+4 -2
View File
@@ -1712,7 +1712,9 @@ enable_auto_reports ENUM('1','0') default '0',
enable_pause_code_limits ENUM('1','0') default '0',
enable_drop_lists ENUM('0','1','2') default '0',
allow_ip_lists ENUM('0','1','2') default '0',
system_ip_blacklist VARCHAR(30) default ''
system_ip_blacklist VARCHAR(30) default '',
agent_push_events ENUM('0','1') default '0',
agent_push_url TEXT
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -4005,4 +4007,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1505',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1506',db_schema_update_date=NOW(),reload_timestamp=NOW();
+15 -3
View File
@@ -14,20 +14,32 @@
# VARhttp://127.0.0.1/agc/get2post.php?uniqueid=--A--uniqueid--B--&type=start&HTTPSURLTOPOST=127.0.0.1/agc/vdc_call_url_test.php?lead_id=--A--lead_id--B--
# VARhttp://127.0.0.1/agc/get2post.php?uniqueid=--A--uniqueid--B--&type=start&headers=HEADERXYZ---XYZvalue-----HEADERABC---ABCvalue&HTTPURLTOPOST=127.0.0.1/agc/vdc_call_url_test.php?lead_id=--A--lead_id--B--
#
# Example Agent Events Push URL:
# get2post.php?uniqueid=--A--epoch--B--.--A--agent_log_id--B--&type=event&HTTPURLTOPOST=192.168.1.3/agc/vdc_call_url_test.php?user=--A--user--B--&lead_id=--A--lead_id--B--&event=--A--event--B--&message=--A--message--B--
#
# CHANGELOG:
# 160302-1159 - First build of script
# 170324-1218 - Added headers options
# 170418-1257 - Added ability to use some special characters in headers
# 170531-0925 - Added ability to accept POST query string
#
$version = '2.14-3';
$build = '170418-1257';
$version = '2.14-4';
$build = '170531-0925';
require("dbconnect_mysqli.php");
require("functions.php");
$query_string = getenv("QUERY_STRING");
$request_uri = getenv("REQUEST_URI");
$POST_URI = '';
foreach($_POST as $key=>$value)
{$POST_URI .= '&'.$key.'='.$value;}
if (strlen($POST_URI)>1)
{$POST_URI = preg_replace("/^&/",'',$POST_URI);}
$POST_URI = preg_replace("/'|\"|\\\\/","",$POST_URI);
if ( (strlen($query_string) < 3) and (strlen($POST_URI) > 2) )
{$query_string = $POST_URI;}
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
@@ -184,7 +196,7 @@ if (preg_match("/HTTPURLTOPOST=|HTTPSURLTOPOST=/",$query_string))
{print "ERROR: post url is invalid"; exit;}
}
else
{print "ERROR: post url is not populated"; exit;}
{print "ERROR: post url is not populated - " . strlen($query_string); exit;}
#$output = '';
+5
View File
@@ -262,3 +262,8 @@ index (monitor_start_time)
CREATE TABLE vicidial_rt_monitor_log_archive LIKE vicidial_rt_monitor_log;
UPDATE system_settings SET db_schema_version='1505',db_schema_update_date=NOW() where db_schema_version < 1505;
ALTER TABLE system_settings ADD agent_push_events ENUM('0','1') default '0';
ALTER TABLE system_settings ADD agent_push_url TEXT;
UPDATE system_settings SET db_schema_version='1506',db_schema_update_date=NOW() where db_schema_version < 1506;
+9 -2
View File
@@ -11,10 +11,11 @@
# 100113-2023 - Added dispo_name
# 130328-0023 - Converted ereg to preg functions
# 170324-1251 - Added more debug output
# 170529-2239 - Added event/message
#
$version = '2.14-4';
$build = '170324-1251';
$version = '2.14-5';
$build = '170529-2239';
require("dbconnect.php");
@@ -155,6 +156,10 @@ if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];}
elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];}
if (isset($_GET["dispo_name"])) {$dispo_name=$_GET["dispo_name"];}
elseif (isset($_POST["dispo_name"])) {$dispo_name=$_POST["dispo_name"];}
if (isset($_GET["event"])) {$event=$_GET["event"];}
elseif (isset($_POST["event"])) {$event=$_POST["event"];}
if (isset($_GET["message"])) {$message=$_GET["message"];}
elseif (isset($_POST["message"])) {$message=$_POST["message"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -293,6 +298,8 @@ $output .= "$talk_time|";
$output .= "$talk_time_min|";
$output .= "$agent_log_id|";
$output .= "$dispo_name|";
$output .= "$event|";
$output .= "$message|";
echo "$output\n$query_string\n";
+188 -12
View File
@@ -553,10 +553,11 @@
# 170429-0851 - Added callback_display_days option
# 170430-1005 - Added three_way_record_stop and hangup_xfer_record_start campaign options
# 170513-1527 - Added debug logging of all alert boxes
# 170531-0937 - Added Agent Events Push function
#
$version = '2.14-523c';
$build = '170513-1527';
$version = '2.14-524c';
$build = '170531-0937';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=87;
$one_mysql_log=0;
@@ -655,7 +656,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 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 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";}
@@ -695,6 +696,8 @@ if ($qm_conf_ct > 0)
$SSagent_xfer_park_3way = $row[29];
$admin_web_directory = $row[30];
$SSagent_script = $row[31];
$agent_push_events = $row[32];
$agent_push_url = $row[33];
}
else
{
@@ -4527,6 +4530,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var three_way_record_stop='<?php echo $three_way_record_stop ?>';
var hangup_xfer_record_start='<?php echo $hangup_xfer_record_start ?>';
var hangup_both=0;
var agent_push_events='<?php echo $agent_push_events ?>';
var agent_push_url='<?php echo $agent_push_url ?>';
var version='<?php echo $version ?>';
var build='<?php echo $build ?>';
var script_name='<?php echo $script_name ?>';
var transfer_panel_open=0;
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\" />";
@@ -4919,6 +4928,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// dialedcall_send_hangup();
// }
agent_events('3way_agent_leave', '');
if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
}
@@ -5013,6 +5024,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (SMDclick=='YES')
{button_click_log = button_click_log + "" + SQLdate + "-----SendManualDial---" + taskFromConf + " " + agent_dialed_type + " " + manual_string + " " + three_way_call_cid + " " + threeway_cid + " " + dial_conf_exten + " " + sending_preset_name + " ";}
agent_events('3way_start', agent_dialed_type + ' ' + manual_string);
if (taskFromConf == 'YES')
{
// give extra time for custom fields to commit before consultative transfers
@@ -5431,17 +5444,20 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
button_click_log = button_click_log + "" + SQLdate + "-----agent_disabled---" + AGLogiN + " " + vicidial_agent_disable + "|";
showDiv('AgenTDisablEBoX');
refresh_interval = 7300000;
agent_events('session_disabled', 'LIVE_AGENT');
}
if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) )
{
button_click_log = button_click_log + "" + SQLdate + "-----agent_disabled---" + AGLogiN + " " + vicidial_agent_disable + "|";
showDiv('AgenTDisablEBoX');
refresh_interval = 7300000;
agent_events('session_disabled', 'DEAD_EXTERNAL');
}
if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') )
{
button_click_log = button_click_log + "" + SQLdate + "-----system_disabled---" + AGLogiN + " " + vicidial_agent_disable + "|";
showDiv('SysteMDisablEBoX');
agent_events('time_sync', '');
}
if (AGLogiN == 'SHIFT_LOGOUT')
{
@@ -5830,12 +5846,14 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
if (CheckDEADcallON < 1)
{
agent_events('call_dead', LasTCID);
if( document.images )
{ document.images['livecall'].src = image_livecall_DEAD.src;}
CheckDEADcallON=1;
CheckDEADcallCOUNT++;
customer_sec = VD_live_call_secondS;
button_click_log = button_click_log + "" + SQLdate + "-----dead_call---" + customer_sec + " " + lastcustchannel + " " + lastcustserverip + " " + CalLCID + "|";
button_click_log = button_click_log + "" + SQLdate + "-----dead_call---" + customer_sec + " " + lastcustchannel + " " + lastcustserverip + " " + LasTCID + "|";
if ( (xfer_in_call > 0) && (customer_3way_hangup_logging=='ENABLED') )
{
@@ -5852,12 +5870,14 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
if (CheckDEADcallON < 1)
{
agent_events('call_dead', LasTCID);
if( document.images )
{ document.images['livecall'].src = image_livechat_DEAD.src;}
CheckDEADcallON=1;
CheckDEADcallCOUNT++;
customer_sec = VD_live_call_secondS;
button_click_log = button_click_log + "" + SQLdate + "-----dead_call---" + customer_sec + " " + lastcustchannel + " " + lastcustserverip + " " + CalLCID + "|";
button_click_log = button_click_log + "" + SQLdate + "-----dead_call---" + customer_sec + " " + lastcustchannel + " " + lastcustserverip + " " + LasTCID + "|";
}
}
if (InGroupChange > 0)
@@ -6302,6 +6322,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{redirectvalue = lastcustchannel}
if ( (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
{
var temp_blind_dialstring='';
if (tasklockedquick > 0)
{document.vicidial_form.xfernumber.value = quick_transfer_button_orig;}
var queryCID = "XBvdcW" + epoch_sec + user_abb;
@@ -6349,6 +6370,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value;
no_delete_VDAC=1;
temp_blind_dialstring = 'vmail';
}
if (blindxferdialstring.length<'1')
{
@@ -6360,6 +6382,10 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
else
{
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + blindxfercontext + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id + "&nodeletevdac=" + no_delete_VDAC + "&preset_name=" + document.vicidial_form.xfername.value + "&CalLCID=" + CalLCID + "&customerparked=" + customerparked;
if (temp_blind_dialstring != 'vmail')
{temp_blind_dialstring = blindxferdialstring;}
agent_events('transfer_blind', temp_blind_dialstring);
}
}
if (taskvar == 'XfeRINTERNAL')
@@ -6389,18 +6415,24 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&customerparked=" + customerparked;
agent_events('transfer_local_closer', XfeR_GrouP);
}
if (taskvar == 'XfeR')
{
var queryCID = "LRvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&customerparked=" + customerparked;
agent_events('transfer_blind', redirectdestination);
}
if (taskvar == 'VMAIL')
{
var queryCID = "LVvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&customerparked=" + customerparked;
agent_events('transfer_vmail', redirectdestination);
}
if (taskvar == 'ENTRY')
{
@@ -6454,6 +6486,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
customerparked=1;
customerparkedcounter=0;
agent_events('park_started', '');
}
if (taskvar == 'FROMParK')
{
@@ -6481,6 +6515,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
customerparked=0;
customerparkedcounter=0;
agent_events('park_retrieved', '');
}
if (taskvar == 'ParKivr')
{
@@ -6502,6 +6538,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
customerparked=1;
customerparkedcounter=0;
agent_events('park_ivr_started', '');
}
if (taskvar == 'FROMParKivr')
{
@@ -6529,6 +6567,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
customerparked=0;
customerparkedcounter=0;
agent_events('park_ivr_retrieved', '');
}
if (taskvar == 'ParKXfeR')
@@ -7207,6 +7247,10 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
var ABtop='50px';
var ABleft='5px';
}
else
{
agent_events('agent_alert', temp_message);
}
document.getElementById("AlertBox").style.top = ABtop;
document.getElementById("AlertBox").style.left = ABleft;
@@ -7380,6 +7424,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
showDiv('NeWManuaLDiaLBox');
agent_events('manual_dial_open', '');
document.vicidial_form.search_phone_number.value='';
document.vicidial_form.search_lead_id.value='';
document.vicidial_form.search_vendor_lead_code.value='';
@@ -8230,6 +8276,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
xferchannellive=1;
XDcheck = '';
agent_events('3way_answered', '');
}
}
else
@@ -8253,7 +8301,6 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
else
{
custchannellive=1;
document.vicidial_form.uniqueid.value = MDlookResponse_array[0];
document.getElementById("callchannel").innerHTML = MDlookResponse_array[1];
lastcustchannel = MDlookResponse_array[1];
@@ -8372,6 +8419,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
DialLog("start");
custchannellive=1;
agent_events('call_answered', CIDcheck);
}
}
}
@@ -8721,6 +8770,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
var man_status = "<?php echo _QXZ("Waiting for Ring..."); ?>";
}
agent_events('call_dialed', mdnPhonENumbeR + " " + agent_dialed_type);
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
@@ -9712,6 +9763,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
else
{VDRP_stage = 'READY';}
}
agent_events('state_ready', VDRP_stage);
AutoDialReady = 1;
AutoDialWaiting = 1;
if (dial_method == "INBOUND_MAN")
@@ -9728,6 +9780,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
else
{
VDRP_stage = 'PAUSED';
agent_events('state_paused', VDRP_stage);
VDRP_stage_seconds=0;
AutoDialReady = 0;
AutoDialWaiting = 0;
@@ -9906,6 +9959,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
new_script_content = xmlhttp.responseText;
document.getElementById(script_span).innerHTML = new_script_content;
agent_events('call_script', script_span);
}
}
delete xmlhttp;
@@ -10138,6 +10192,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
document.vicidial_form.SecondS.value = 0;
document.getElementById("SecondSDISP").innerHTML = '0';
agent_events('call_answered', CalLCID);
if (uniqueid_status_display=='ENABLED')
{custom_call_id = " Call ID " + VDIC_data_VDAC[1];}
if (uniqueid_status_display=='ENABLED_PREFIX')
@@ -10740,8 +10796,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
xmlhttprequestcheckother = new XMLHttpRequest();
}
if (xmlhttprequestcheckother)
{
{
checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&orig_pass=" + orig_pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMINGother" + "&agent_log_id=" + agent_log_id + "&phone_login=" + phone_login + "&agent_email=" + LOGemail + "&conf_exten=" + session_id + "&camp_script=" + campaign_script + '' + "&in_script=" + CalL_ScripT_id + "&customer_server_ip=" + lastcustserverip + "&exten=" + extension + "&original_phone_login=" + original_phone_login + "&phone_pass=" + phone_pass;
if (!manual_chat_override)
@@ -11438,9 +11493,10 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
var dial_display_number = phone_number_format(callnum);
alert(" <?php echo _QXZ("Incoming:"); ?> " + dial_display_number + "\n <?php echo _QXZ("Group"); ?>- " + VDIC_data_VDIG[1] + " &nbsp; " + VDIC_fronter);
}
agent_events('other_answered', CalL_AutO_LauncH);
}
xmlhttprequestcheckother = undefined;
delete xmlhttprequestcheckother;
xmlhttprequestcheckother = undefined;
delete xmlhttprequestcheckother;
}
}
}
@@ -11974,6 +12030,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// alert(xmlhttp.responseText);
// }
agent_events('agent_hangup', '');
}
}
process_post_hangup=1;
@@ -12236,6 +12293,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
Nactiveext = null;
Nactiveext = xmlhttp.responseText;
// alert(xmlhttp.responseText);
agent_events('3way_agent_hangup', '');
}
}
process_post_hangup=1;
@@ -12575,6 +12634,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
PauseCode_HTML = PauseCode_HTML + "</span></font></td></tr></table><br /><br />" + Go_BacK_LinK;
document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML;
agent_events('pause_code_open', '');
}
}
if (focus_blur_enabled==1)
@@ -12628,6 +12689,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
showDiv('SearcHForMDisplaYBox');
if ( (VD_live_customer_call!=1) || (inOUT=='OUT') )
{WaitingForNextStep=1;}
agent_events('lead_search_open', '');
}
}
@@ -12640,6 +12702,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{button_click_log = button_click_log + "" + SQLdate + "-----generate_contacts_search---|";}
HidEGenDerPulldown();
showDiv('SearcHContactsDisplaYBox');
agent_events('contact_search_open', '');
}
@@ -12937,6 +13000,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
showDiv('CallBackSelectBox');
agent_events('callback_select_open', '');
}
else
{
@@ -12990,6 +13055,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
SendURLs(dispo_urls,"dispo");
}
waiting_on_dispo=0;
agent_events('dispo_set', DispoChoice);
}
}
delete xmlhttp;
@@ -13634,6 +13701,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
showDiv('CustomerGoneBox');
agent_events('customer_gone', '');
document.getElementById("callchannel").innerHTML = '';
document.vicidial_form.callserverip.value = '';
document.getElementById("CustomerGoneChanneL").innerHTML = lastcustchannel;
@@ -13661,6 +13730,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
function NoneInSession()
{
showDiv('NoneInSessionBox');
agent_events('none_in_session', '');
document.getElementById("NoneInSessionID").innerHTML = session_id;
WaitingForNextStep=1;
}
@@ -14206,6 +14276,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
else
{
agent_events('logged_out', tempreason);
document.getElementById("LogouTProcess").innerHTML = "<br /><br /><font class=\"loading_text\"><?php echo _QXZ("LOGOUT PROCESSING..."); ?></font><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <img src=\"./images/<?php echo _QXZ("agent_loading_animation.gif"); ?>\" height=\"206px\" width=\"206px\" alt=\"<?php echo _QXZ("LOGOUT PROCESSING..."); ?>\" />";
// document.getElementById("LogouTProcess").innerHTML = "<?php echo _QXZ("LOGOUT PROCESSING..."); ?>";
var xmlhttp=false;
@@ -15976,6 +16048,90 @@ function phone_number_format(formatphone) {
}
// ################################################################################
// Run the Agent Push Events process
function agent_events(event_type,event_msg)
{
if ( (agent_push_events > 0) && (agent_push_url.length > 10) )
{
button_click_log = button_click_log + "" + SQLdate + "-----AgentEvent---" + event_type + "|";
// if (event_type == 'logged_out')
// {check_for_conf_calls(session_id, '0');}
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
var RGnl = new RegExp("[\\r]\\n","g");
var RGtab = new RegExp("\t","g");
var RGplus = new RegExp(" |\\t|\\n","g");
var regWF = new RegExp("\\`|\\:|\\;|\\#|\\\"|\\{|\\}|\\^|\\$|\\r|\\t|\\n|","ig");
var temp_agent_push_url = agent_push_url;
var SCuser = user;
var SCevent = event_type;
var SCmessage = event_msg;
var SClead_id = document.vicidial_form.lead_id.value;
var SCepoch = UnixTime;
var SCagent_log_id = agent_log_id;
SCuser = SCuser.replace(RGplus,'+');
SCevent = SCevent.replace(RGplus,'+');
SCmessage = SCmessage.replace(RGplus,'+');
SClead_id = SClead_id.replace(RGplus,'+');
var RGuser = new RegExp("--A--user--B--","g");
var RGevent = new RegExp("--A--event--B--","g");
var RGmessage = new RegExp("--A--message--B--","g");
var RGlead_id = new RegExp("--A--lead_id--B--","g");
var RGepoch = new RegExp("--A--epoch--B--","g");
var RGagent_log_id = new RegExp("--A--agent_log_id--B--","g");
temp_agent_push_url = temp_agent_push_url.replace(RGuser, SCuser);
temp_agent_push_url = temp_agent_push_url.replace(RGevent, SCevent);
temp_agent_push_url = temp_agent_push_url.replace(RGmessage, SCmessage);
temp_agent_push_url = temp_agent_push_url.replace(RGlead_id, SClead_id);
temp_agent_push_url = temp_agent_push_url.replace(RGepoch, SCepoch);
temp_agent_push_url = temp_agent_push_url.replace(RGagent_log_id, SCagent_log_id);
temp_agent_push_url = temp_agent_push_url.replace(RGplus, '+');
temp_agent_push_url = temp_agent_push_url.replace(RGnl, '+');
temp_agent_push_url = temp_agent_push_url.replace(RGtab, '+');
temp_agent_push_url = temp_agent_push_url.replace(regWF, '');
var URL_array = temp_agent_push_url.split('?');
var agent_push_script = URL_array[0];
var agent_push_data = temp_agent_push_url.split(/\?(.+)/)[1];
xmlhttp.open('POST', agent_push_script);
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(agent_push_data);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
// alert(xmlhttp.responseText);
document.getElementById("debugbottomspan").innerHTML = "AGENT EVENT " + xmlhttp.responseText + "| URL: " + agent_push_script + "| DATA: " + agent_push_data;
}
}
delete xmlhttp;
}
}
}
// ################################################################################
// Refresh the FORM content
function FormContentsLoad(FRMrefresh)
@@ -16110,7 +16266,8 @@ function phone_number_format(formatphone) {
else
{
HidEGenDerPulldown();
showDiv('CloserSelectBox')
showDiv('CloserSelectBox');
agent_events('ingroup_screen_open', '');
}
}
}
@@ -16137,7 +16294,8 @@ function phone_number_format(formatphone) {
}
if (move_on == 1)
{
showDiv('TerritorySelectBox')
showDiv('TerritorySelectBox');
agent_events('territory_screen_open', '');
}
}
@@ -16611,6 +16769,7 @@ function phone_number_format(formatphone) {
CloserSelectContent_create();
if (VU_agent_choose_ingroups_DV == "MGRLOCK")
{VU_agent_choose_ingroups_skip_count = mrglock_ig_select_ct;}
agent_events('ingroup_screen_open', '');
}
else
{
@@ -16632,6 +16791,7 @@ function phone_number_format(formatphone) {
TerritorySelectContent_create();
if (agent_select_territories == "MGRLOCK")
{agent_select_territories_skip_count=4;}
agent_events('territory_screen_open', '');
}
else
{
@@ -16742,6 +16902,7 @@ function phone_number_format(formatphone) {
// alert("IFRAME submitting!");
customsubmit_trigger=1;
}
agent_events('dispo_screen_open', '');
}
// trigger custom form submit if standard form has already been submitted or 3 seconds have gone by
if (customsubmit_trigger > 0)
@@ -17054,6 +17215,7 @@ function phone_number_format(formatphone) {
{
document.getElementById("blind_monitor_alert_span_contents").innerHTML = blind_monitor_message;
showDiv('blind_monitor_alert_span');
agent_events('blind_monitor_alert', '');
}
if ( (blind_monitor_filename.length > 0) && ( (blind_monitor_warning=='AUDIO') || (blind_monitor_warning=='ALERT_AUDIO')|| (blind_monitor_warning=='NOTICE_AUDIO') || (blind_monitor_warning=='ALL') ) )
{
@@ -17334,11 +17496,17 @@ function phone_number_format(formatphone) {
if (check_n==2)
{
hideDiv('LoadingBox');
agent_events('logged_in', session_id + ' ' + server_ip + ' ' + version + ' ' + build + ' ' + script_name);
if (deactivated_old_session > 0)
{agent_events('session_disabled', '');}
if (invalid_opener > 0)
{
refresh_interval = 7300000;
logout_stop_timeouts = 1;
showDiv('InvalidOpenerSpan');
agent_events('login_invalid', '<?php echo _QXZ("This agent screen was not opened properly."); ?>');
}
}
}
@@ -17528,6 +17696,9 @@ function phone_number_format(formatphone) {
{document.getElementById("QuickXfer").innerHTML = "<img src=\"./images/<?php echo _QXZ("vdc_LB_quickxfer_OFF.gif"); ?>\" border=\"0\" alt=\"QUICK TRANSFER\" />";}
if (custom_3way_button_transfer_enabled > 0)
{document.getElementById("CustomXfer").innerHTML = "<img src=\"./images/<?php echo _QXZ("vdc_LB_customxfer_OFF.gif"); ?>\" border=\"0\" alt=\"Custom Transfer\" />";}
agent_events('transfer_panel_open', '');
transfer_panel_open=1;
}
else
{
@@ -17551,6 +17722,11 @@ function phone_number_format(formatphone) {
document.getElementById("CustomXfer").innerHTML = "<a href=\"#\" onclick=\"custom_button_transfer();return false;\"><img src=\"./images/<?php echo _QXZ("vdc_LB_customxfer.gif"); ?>\" border=\"0\" alt=\"Custom Transfer\" /></a>";
}
}
if (transfer_panel_open > 0)
{
agent_events('transfer_panel_closed', '');
transfer_panel_open=0;
}
}
if (three_way_call_cid == 'AGENT_CHOOSE')
{
+20 -4
View File
File diff suppressed because one or more lines are too long
+11
View File
@@ -127,6 +127,7 @@
# 170429-0810 - Added callback_display_days entry
# 170430-0957 - Added three_way_record_stop and hangup_xfer_record_start entries
# 170516-0628 - Added rt_monitor_log_report entry
# 170529-2337 - Added agent push events entries
#
@@ -5444,6 +5445,16 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
<BR>
<B><?php echo _QXZ("Chat URL"); ?> -</B><?php echo _QXZ("This is the location where you have placed the chat web pages for customer use."); ?>
<BR>
<A NAME="settings-agent_push_events">
<BR>
<B><?php echo _QXZ("Agent Push Events"); ?> -</B><?php echo _QXZ("This setting will enable the sending of events from agent screens to the URL defined below. Default is 0 for disabled."); ?>
<BR>
<A NAME="settings-agent_push_url">
<BR>
<B><?php echo _QXZ("Agent Push URL"); ?> -</B><?php echo _QXZ("If Agent Push Events are enabled above, this is the URL that the events will be sent to. The variables that you can use within the URL are --A--user--B--, --A--event--B--, --A--message--B--, --A--lead_id--B--. Since this function uses AJAX, it must reference a local script on the web server. If you want to reference an external web address then you should use the get2post.php script that can be found in the extras directory."); ?>
<BR>
<A NAME="settings-log_recording_access">
<BR>