Added recent session per-call logging and force_fronter_audio_stop Agent API function
git-svn-id: svn://192.168.202.10@3066 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -379,6 +379,10 @@ OTHER CHANGES:
|
||||
Screen. For example, Putting "SMITH" in the SendDTMF field would result
|
||||
in "76484" being sent over DTMF.
|
||||
|
||||
106. Added "force_fronter_audio_stop" Agent API function, allowing an API
|
||||
command to be sent to the fronter session of a closer call to stop
|
||||
playing of an audio_playback pre-recorded audio stream
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# - Auto reset lists at defined times
|
||||
# - Auto restarts Asterisk process if enabled in servers settings
|
||||
#
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 61011-1348 - First build
|
||||
@@ -134,9 +134,10 @@
|
||||
# 180916-1003 - Added vicidial_lists.resets_today resetting at TEOD, timed reset resets_today verification before reset
|
||||
# 180930-1007 - Added more allowed codecs to conf file generation
|
||||
# 181028-1451 - Added vicidial_list stuck QUEUE reset at TEoD
|
||||
# 190220-2258 - Added flushing of vicidial_sessions_recent table
|
||||
#
|
||||
|
||||
$build = '181028-1451';
|
||||
$build = '190220-2258';
|
||||
|
||||
$DB=0; # Debug flag
|
||||
$teodDB=0; # flag to log Timeclock End of Day processes to log file
|
||||
@@ -1462,6 +1463,33 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
}
|
||||
|
||||
|
||||
# roll of SENT/EXPIRED vicidial_sessions_recent records
|
||||
if (!$Q) {print "\nProcessing vicidial_sessions_recent table...\n";}
|
||||
$stmtA = "INSERT IGNORE INTO vicidial_sessions_recent_archive SELECT * from vicidial_sessions_recent where call_date < \"$TDSQLdate\";";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows = $sthA->rows;
|
||||
$event_string = "$sthArows rows inserted into vicidial_sessions_recent_archive table";
|
||||
if (!$Q) {print "$event_string \n";}
|
||||
if ($teodDB) {&teod_logger;}
|
||||
|
||||
$rv = $sthA->err();
|
||||
if (!$rv)
|
||||
{
|
||||
$stmtA = "DELETE FROM vicidial_sessions_recent WHERE call_date < \"$TDSQLdate\";";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows = $sthA->rows;
|
||||
$event_string = "$sthArows rows deleted from vicidial_sessions_recent table";
|
||||
if (!$Q) {print "$event_string \n";}
|
||||
if ($teodDB) {&teod_logger;}
|
||||
|
||||
$stmtA = "optimize table vicidial_sessions_recent;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
}
|
||||
|
||||
|
||||
# roll of vicidial_ccc_log records, keep only 1 day of records in active table
|
||||
if (!$Q) {print "\nProcessing vicidial_ccc_log table...\n";}
|
||||
$stmtA = "INSERT IGNORE INTO vicidial_ccc_log_archive SELECT * from vicidial_ccc_log;";
|
||||
@@ -1727,6 +1755,24 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
##### END vicidial_recent_ascb_calls_archive end of day process removing records older than 7 days #####
|
||||
|
||||
|
||||
##### BEGIN vicidial_sessions_recent_archive end of day process removing records older than 7 days #####
|
||||
$stmtA = "DELETE from vicidial_sessions_recent_archive where call_date < \"$SDSQLdate\";";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print STDERR "\n|$affected_rows vicidial_sessions_recent_archive records older than 7 days purged|\n";}
|
||||
if ($teodDB) {$event_string = "vicidial_sessions_recent_archive records older than 7 days purged: |$stmtA|$affected_rows|"; &teod_logger;}
|
||||
|
||||
$stmtA = "optimize table vicidial_sessions_recent_archive;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
##### END vicidial_sessions_recent_archive end of day process removing records older than 7 days #####
|
||||
|
||||
|
||||
##### BEGIN usacan_phone_dialcode_fix funciton #####
|
||||
if ($usacan_phone_dialcode_fix > 0)
|
||||
{
|
||||
|
||||
@@ -27,8 +27,11 @@
|
||||
# 180519-1431 - Added vicidial_inbound_groups optimization
|
||||
# 181003-2115 - Added optimize of cid_channels_recent_ tables
|
||||
# 190214-1758 - Fix for cid_recent_ table optimization issue
|
||||
# 190222-1321 - Added optional flushing of vicidial_sessions_recent table
|
||||
#
|
||||
|
||||
$session_flush=0;
|
||||
|
||||
### begin parsing run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
{
|
||||
@@ -46,6 +49,7 @@ if (length($ARGV[0])>1)
|
||||
print " [-t] = test\n";
|
||||
print " [--debug] = debugging messages\n";
|
||||
print " [--seconds=XXX] = optional, minimum number of seconds worth of records to keep(default 3600)\n";
|
||||
print " [--session-flush] = flush the vicidial_sessions_recent table\n";
|
||||
print "\n";
|
||||
|
||||
exit;
|
||||
@@ -66,6 +70,11 @@ if (length($ARGV[0])>1)
|
||||
$T=1; $TEST=1;
|
||||
print "\n-----TESTING -----\n\n";
|
||||
}
|
||||
if ($args =~ /--session-flush/i)
|
||||
{
|
||||
$session_flush=1;
|
||||
print "\n----- SESSION FLUSH(vicidial_sessions_recent) ----- $session_flush \n\n";
|
||||
}
|
||||
if ($args =~ /--seconds=/i)
|
||||
{
|
||||
@data_in = split(/--seconds=/,$args);
|
||||
@@ -428,6 +437,27 @@ while ($sthArowsSERVERS > $aas)
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
if ($session_flush > 0)
|
||||
{
|
||||
$stmtA = "DELETE from vicidial_sessions_recent where call_date < '$SQLdate_NEG_1hour';";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
if (!$T) { $affected_rows = $dbhA->do($stmtA);}
|
||||
if (!$Q) {print " - vicidial_sessions_recent flush: $affected_rows rows\n";}
|
||||
|
||||
$stmtA = "OPTIMIZE table vicidial_sessions_recent;";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
if (!$T)
|
||||
{
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
}
|
||||
if (!$Q) {print " - OPTIMIZE vicidial_sessions_recent \n";}
|
||||
}
|
||||
$dbhA->disconnect();
|
||||
|
||||
|
||||
|
||||
+37
-1
@@ -1,4 +1,4 @@
|
||||
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2018-09-08
|
||||
AGENT API DOCUMENT Started: 2008-07-03 Updated: 2019-02-22
|
||||
|
||||
This document describes the functions of an API(Application Programming Interface)
|
||||
for the VICIDIAL Agent screen. This functionality will be rather limited at first
|
||||
@@ -36,6 +36,7 @@ audio_playback - basic play/pause/resume/stop/restart audio in agent session
|
||||
switch_lead - for inbound calls, switches lead_id of live inbound call on agent screen
|
||||
calls_in_queue_count - display a count of the calls waiting in queue for the specific agent
|
||||
force_fronter_leave_3way - will send a command to fronter agent to leave-3way call that executing agent is on
|
||||
force_fronter_audio_stop - will send a command to fronter agent session to stop any audio_playback playing on it
|
||||
|
||||
|
||||
New scripts:
|
||||
@@ -944,6 +945,41 @@ SUCCESS: force_fronter_leave_3way command sent over CCC - test_ccc
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
force_fronter_audio_stop -
|
||||
|
||||
DESCRIPTION:
|
||||
will send a command to fronter agent session to stop any audio_playback playing on it. Will not execute command for the named 'agent_user', but will look for other user session currently on a call with the same lead_id that the named agent_user is on the phone with.
|
||||
|
||||
VALUES:
|
||||
value -
|
||||
REQUIRED, choices are below:
|
||||
LOCAL_ONLY - looks for fronter only on local cluster
|
||||
LOCAL_AND_CCC - looks on local cluster and remote CCC to send command to (will always check local first)
|
||||
CCC_REMOTE - use this when the closer is not on this cluster
|
||||
lead_id -
|
||||
OPTIONAL, only to be used with CCC_REMOTE value commands
|
||||
|
||||
EXAMPLE URLS:
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=force_fronter_audio_stop&value=LOCAL_ONLY
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=force_fronter_audio_stop&value=LOCAL_AND_CCC
|
||||
|
||||
RESPONSES:
|
||||
ERROR: force_fronter_audio_stop not valid - LOCAL_AND_CCC|6666
|
||||
ERROR: auth USER DOES NOT HAVE PERMISSION TO USE THIS FUNCTION - LOCAL_AND_CCC|6666|force_fronter_audio_stop
|
||||
ERROR: no user found - 6666
|
||||
ERROR: agent_user is not logged in - 6666
|
||||
ERROR: agent_user is not on a phone call - 6666
|
||||
ERROR: no fronter session found - |6666|1234
|
||||
ERROR: no fronter found - 6666
|
||||
ERROR: force_fronter_audio_stop error - no audio playing in other agent session - 8600051|10.0.0.5||6666|1234
|
||||
SUCCESS: force_fronter_audio_stop function SENT - LOCAL_AND_CCC||6667|1234
|
||||
SUCCESS: force_fronter_audio_stop command sent over CCC - test_ccc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Other information:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CROSS-CLUSTER COMMUNICATION Started: 2011-05-27 Updated: 2018-09-08
|
||||
CROSS-CLUSTER COMMUNICATION Started: 2011-05-27 Updated: 2019-02-22
|
||||
|
||||
|
||||
--------------------------------
|
||||
@@ -42,7 +42,7 @@ NOTES:
|
||||
# If lead is not found on external system, call will go to the 'B' option in the call menu
|
||||
# If container is not found, call will go to the 'C' option in the call menu
|
||||
# If call_id is not defined, call will go to the 'D' option in the call menu
|
||||
# If you are planning to use the 'force_fronter_leave_3way' function across this CCC connection, make sure you have that API permission set for the API user above
|
||||
# If you are planning to use the 'force_fronter_leave_3way' or 'force_fronter_audio_stop' functions across this CCC connection, make sure you have that API permission set for the API user above
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4008,6 +4008,18 @@ index (call_date),
|
||||
index (lead_id)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_sessions_recent (
|
||||
lead_id INT(9) UNSIGNED,
|
||||
server_ip VARCHAR(15) NOT NULL,
|
||||
call_date DATETIME,
|
||||
user VARCHAR(20),
|
||||
campaign_id VARCHAR(20),
|
||||
conf_exten VARCHAR(20),
|
||||
call_type VARCHAR(1) default '',
|
||||
index(lead_id),
|
||||
index(call_date)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
|
||||
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
|
||||
|
||||
@@ -4227,6 +4239,8 @@ CREATE TABLE vicidial_recent_ascb_calls_archive LIKE vicidial_recent_ascb_calls;
|
||||
CREATE TABLE vicidial_ccc_log_archive LIKE vicidial_ccc_log;
|
||||
CREATE UNIQUE INDEX ccc_unq_key on vicidial_ccc_log_archive(uniqueid, call_date, lead_id);
|
||||
|
||||
CREATE TABLE vicidial_sessions_recent_archive LIKE vicidial_sessions_recent;
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -4306,4 +4320,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='1562',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1563',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -783,3 +783,19 @@ ALTER TABLE system_settings ADD manual_dial_validation ENUM('0','1','2','3','4')
|
||||
ALTER TABLE vicidial_campaigns ADD manual_dial_validation ENUM('Y','N') default 'N';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1562',db_schema_update_date=NOW() where db_schema_version < 1562;
|
||||
|
||||
CREATE TABLE vicidial_sessions_recent (
|
||||
lead_id INT(9) UNSIGNED,
|
||||
server_ip VARCHAR(15) NOT NULL,
|
||||
call_date DATETIME,
|
||||
user VARCHAR(20),
|
||||
campaign_id VARCHAR(20),
|
||||
conf_exten VARCHAR(20),
|
||||
call_type VARCHAR(1) default '',
|
||||
index(lead_id),
|
||||
index(call_date)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_sessions_recent_archive LIKE vicidial_sessions_recent;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1563',db_schema_update_date=NOW() where db_schema_version < 1563;
|
||||
|
||||
@@ -74,7 +74,7 @@ $VUselected_language = $SSdefault_language;
|
||||
###########################################
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'chat');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
+275
-4
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# api.php
|
||||
#
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2019 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
|
||||
@@ -97,10 +97,11 @@
|
||||
# 180323-2227 - Fix for dial_ingroup error message on external_dial function
|
||||
# 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
|
||||
#
|
||||
|
||||
$version = '2.14-63';
|
||||
$build = '180908-1433';
|
||||
$version = '2.14-64';
|
||||
$build = '190222-1152';
|
||||
|
||||
$startMS = microtime();
|
||||
|
||||
@@ -448,7 +449,7 @@ else
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,1);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,1,'api');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
@@ -4388,6 +4389,276 @@ if ($function == 'force_fronter_leave_3way')
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### BEGIN - force_fronter_audio_stop - will send a command to fronter session to stop playing soundboard audio
|
||||
################################################################################
|
||||
if ($function == 'force_fronter_audio_stop')
|
||||
{
|
||||
if ( ( ($value!='LOCAL_ONLY') and ($value!='LOCAL_AND_CCC') and ($value!='CCC_REMOTE') ) or ( (strlen($agent_user)<1) and (strlen($alt_user)<2) ) )
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("force_fronter_audio_stop not valid");
|
||||
echo "$result: $result_reason - $value|$agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (!preg_match("/ $function /",$VUapi_allowed_functions)) and (!preg_match("/ALL_FUNCTIONS/",$VUapi_allowed_functions)) )
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("auth USER DOES NOT HAVE PERMISSION TO USE THIS FUNCTION");
|
||||
echo "$result: $result_reason - $value|$user|$function|$VUuser_group\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
if (strlen($alt_user)>1)
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_users where custom_three='$alt_user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$agent_user = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("no user found");
|
||||
echo "$result: $result_reason - $alt_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
$stmt = "SELECT count(*) from vicidial_live_agents where user='$agent_user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
if ( ($row[0] > 0) or ($value == 'CCC_REMOTE') )
|
||||
{
|
||||
$Alead_id=0;
|
||||
### grab the lead_id for this logged-in agent
|
||||
$stmt="SELECT lead_id from vicidial_live_agents where user='$agent_user';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$vla_ct = mysqli_num_rows($rslt);
|
||||
if ($vla_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$Alead_id = $row[0];
|
||||
}
|
||||
|
||||
if ( ($Alead_id > 0) or ( (strlen($lead_id) > 0) and ($value == 'CCC_REMOTE') ) )
|
||||
{
|
||||
$QUERYlead_id = $Alead_id;
|
||||
if ($value == 'CCC_REMOTE')
|
||||
{$QUERYlead_id = $lead_id;}
|
||||
|
||||
$other_agent='';
|
||||
$fronter_found=0;
|
||||
$VLAconf_exten='';
|
||||
$VLAserver_ip='';
|
||||
### user ID of fronter agent
|
||||
$stmt="SELECT user from vicidial_live_agents where user!='$agent_user' and lead_id='$QUERYlead_id' order by last_call_time limit 1;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$vla_ct = mysqli_num_rows($rslt);
|
||||
if ($vla_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$other_agent = $row[0];
|
||||
$fronter_found++;
|
||||
}
|
||||
else
|
||||
{
|
||||
### search recent sessions on this cluster for this lead ID, if the fronter has left the 3way call
|
||||
$stmt="SELECT user,conf_exten,server_ip from vicidial_sessions_recent where user!='$agent_user' and lead_id='$QUERYlead_id' and call_date > DATE_SUB(NOW(), INTERVAL 5 MINUTE) order by call_date desc limit 1;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$vla_ct = mysqli_num_rows($rslt);
|
||||
if ($vla_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$other_agent = $row[0];
|
||||
$VLAconf_exten = $row[1];
|
||||
$VLAserver_ip = $row[2];
|
||||
$fronter_found++;
|
||||
}
|
||||
}
|
||||
if ($fronter_found > 0)
|
||||
{
|
||||
if ( (strlen($VLAserver_ip) < 5) and (strlen($VLAconf_exten) < 1) )
|
||||
{
|
||||
$stmt = "select conf_exten,server_ip from vicidial_live_agents where user='$other_agent';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$rl_ct = mysqli_num_rows($rslt);
|
||||
if ($rl_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$VLAconf_exten = $row[0];
|
||||
$VLAserver_ip = $row[1];
|
||||
}
|
||||
}
|
||||
if ( (strlen($VLAconf_exten) > 5) and (strlen($VLAserver_ip) > 5) )
|
||||
{
|
||||
$valueCIDfull = "\"STOP\" <473782158521111>";
|
||||
|
||||
$stmt = "SELECT channel from live_channels where extension='$VLAconf_exten' and server_ip='$VLAserver_ip' and channel LIKE \"IAX2/ASTplay%\";";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$rl_ct = mysqli_num_rows($rslt);
|
||||
|
||||
if ($rl_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$VLAchannel = $row[0];
|
||||
$VLAchannel_inc = $VLAchannel;
|
||||
$VLAchannel_inc = preg_replace("/IAX2\/ASTplay-/",'',$VLAchannel_inc);
|
||||
|
||||
$stmtX="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$VLAserver_ip','','Hangup','PLAYHU$ENTRYdate','Channel: $VLAchannel','','','','','','','','','');";
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$data = "$VLAconf_exten|$VLAserver_ip|$stage";
|
||||
$result_reason = _QXZ("force_fronter_audio_stop error - no audio playing in other agent session");
|
||||
echo "$result: $result_reason - $data|$agent_user|$other_agent\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
if ($format=='debug') {echo "\n<!-- $stmtX -->";}
|
||||
$rslt=mysql_to_mysqli($stmtX, $link);
|
||||
$result = _QXZ("SUCCESS");
|
||||
$data = "$value|$stage";
|
||||
$result_reason = _QXZ("force_fronter_audio_stop function sent");
|
||||
echo "$result: $result_reason - $data|$agent_user|$other_agent\n";
|
||||
$data = "$epoch";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$data = "$stage";
|
||||
$result_reason = _QXZ("force_fronter_audio_stop error - no fronter session found");
|
||||
echo "$result: $result_reason - $data|$agent_user|$other_agent\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($value == 'LOCAL_AND_CCC')
|
||||
{
|
||||
# check for CCC-fronted call on this server
|
||||
$stmt="SELECT remote_lead_id,container_id from vicidial_ccc_log where lead_id='$QUERYlead_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$vcl_ct = mysqli_num_rows($rslt);
|
||||
if ($vcl_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$remote_lead_id = $row[0];
|
||||
$container_id = $row[1];
|
||||
|
||||
$stmt="SELECT container_entry from vicidial_settings_containers where container_id='$container_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$vsc_ct = mysqli_num_rows($rslt);
|
||||
if ($vsc_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$container_entry = $row[0];
|
||||
$container_entry = preg_replace("/ccc_lead_info/","force_fronter_audio_stop&value=CCC_REMOTE&lead_id=$remote_lead_id&agent_user=CCC_REMOTE",$container_entry);
|
||||
$container_entry = preg_replace("/vicidial\/non_agent_|admin\/non_agent_/","agc/",$container_entry);
|
||||
|
||||
$SQL_log = "$container_entry";
|
||||
$SQL_log = preg_replace('/;/','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date='$NOW_TIME',url_type='start',url='$SQL_log',url_response='';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$affected_rows = mysqli_affected_rows($link);
|
||||
$url_id = mysqli_insert_id($link);
|
||||
|
||||
$URLstart_sec = date("U");
|
||||
|
||||
### grab the call_start_url ###
|
||||
if ($DB > 0) {echo "$container_entry<BR>\n";}
|
||||
$SCUfile = file("$container_entry");
|
||||
if ( !($SCUfile) )
|
||||
{
|
||||
$error_array = error_get_last();
|
||||
$error_type = $error_array["type"];
|
||||
$error_message = $error_array["message"];
|
||||
$error_line = $error_array["line"];
|
||||
$error_file = $error_array["file"];
|
||||
}
|
||||
|
||||
if ($DB > 0) {echo "$SCUfile[0]<BR>\n";}
|
||||
|
||||
### update url log entry
|
||||
$URLend_sec = date("U");
|
||||
$URLdiff_sec = ($URLend_sec - $URLstart_sec);
|
||||
if ($SCUfile)
|
||||
{
|
||||
$SCUfile_contents = implode("", $SCUfile);
|
||||
$SCUfile_contents = preg_replace('/;/','',$SCUfile_contents);
|
||||
$SCUfile_contents = addslashes($SCUfile_contents);
|
||||
$fronter_found++;
|
||||
|
||||
$result = _QXZ("SUCCESS");
|
||||
$result_reason = _QXZ("force_fronter_audio_stop command sent over CCC")." - $container_id";
|
||||
echo "$result: $result_reason\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$SCUfile_contents = "PHP ERROR: Type=$error_type - Message=$error_message - Line=$error_line - File=$error_file";
|
||||
}
|
||||
$stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$affected_rows = mysqli_affected_rows($link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fronter_found < 1)
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("no fronter found");
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("agent_user is not on a phone call");
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = _QXZ("ERROR");
|
||||
$result_reason = _QXZ("agent_user is not logged in");
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
################################################################################
|
||||
### END - force_fronter_audio_stop
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### BEGIN - optional "close window" link
|
||||
################################################################################
|
||||
|
||||
@@ -147,7 +147,7 @@ $VUselected_language = $SSdefault_language;
|
||||
###########################################
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'chat_db_query');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ $random = (rand(1000000, 9999999) + 10000000);
|
||||
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,0,'conf_exten_check');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ if (preg_match("/$TD$dispo$TD/",$sale_status))
|
||||
}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'deactivate_lead');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ if ($match_found > 0)
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'dispo_add_FPG');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ if ($match_found > 0)
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'dispo_change_status');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ if ($match_found > 0)
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'dispo_move_list');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ if ($match_found > 0)
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'dispo_send_email');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
# $mysql_queries = 26
|
||||
|
||||
##### BEGIN validate user login credentials, check for failed lock out #####
|
||||
function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash,$api_call)
|
||||
function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash,$api_call,$source)
|
||||
{
|
||||
require("dbconnect_mysqli.php");
|
||||
|
||||
@@ -115,7 +115,7 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
|
||||
if ($auth < 1)
|
||||
{
|
||||
$auth_key='BAD'."|$stmt";
|
||||
$auth_key='BAD'."|$bcrypt|$source|$stmt";
|
||||
$stmt="SELECT failed_login_count,UNIX_TIMESTAMP(last_login_date) from vicidial_users where user='$user';";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# manager_send.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
@@ -140,13 +140,14 @@
|
||||
# 170528-0850 - Fix for rare inbound logging issue #1017, Added additional variable filtering
|
||||
# 170921-2009 - Fix for CALLID in beginning of recording filename
|
||||
# 180522-1920 - Added more agent debug output for recordings
|
||||
# 190222-1318 - Added recent session per-call logging
|
||||
#
|
||||
|
||||
$version = '2.14-87';
|
||||
$build = '180522-1920';
|
||||
$version = '2.14-88';
|
||||
$build = '190222-1318';
|
||||
$php_script = 'manager_send.php';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=142;
|
||||
$mysql_log_count=143;
|
||||
$one_mysql_log=0;
|
||||
$SSagent_debug_logging=0;
|
||||
$startMS = microtime();
|
||||
@@ -362,7 +363,7 @@ if (strlen($meetme_enter_leave3way_filename) > 0)
|
||||
{$threeway_context = 'meetme-enter-leave3way';}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0,'manager_send');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
@@ -576,6 +577,14 @@ if ($ACTION=="Originate")
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02119',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ( (strlen($lead_id) > 0) and (strlen($session_id) > 0) and (preg_match("/^DC/",$queryCID)) )
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_sessions_recent SET lead_id='$lead_id',server_ip='$server_ip',call_date=NOW(),user='$user',campaign_id='$campaign',conf_exten='$session_id',call_type='X';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02143',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($agent_dialed_number > 0)
|
||||
{
|
||||
if (strlen($lead_id)<1) {$lead_id='0';}
|
||||
|
||||
@@ -364,7 +364,7 @@ else
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($VD_login,$VD_pass,'',1,0,0,0);
|
||||
$auth_message = user_authorization($VD_login,$VD_pass,'',1,0,0,0,'phone_only');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ if ($SSallow_chats < 1)
|
||||
}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'vdc_chat_display');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -467,13 +467,14 @@
|
||||
# 181005-1744 - Added SYSTEM option for manual_dial_filter
|
||||
# 190106-1353 - Added manual_dial_validation feature
|
||||
# 190216-0805 - Fix for user-group, in-group and campaign allowed/permissions matching issues
|
||||
# 190220-1005 - Added vicidial_sessions_recent inserts when lead is set to INCALL status
|
||||
#
|
||||
|
||||
$version = '2.14-361';
|
||||
$build = '190216-0805';
|
||||
$version = '2.14-362';
|
||||
$build = '190220-1005';
|
||||
$php_script = 'vdc_db_query.php';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=787;
|
||||
$mysql_log_count=792;
|
||||
$one_mysql_log=0;
|
||||
$DB=0;
|
||||
$VD_login=0;
|
||||
@@ -1138,7 +1139,7 @@ if ($ACTION == 'LogiNCamPaigns')
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0,'vdc_db_query');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
@@ -4064,7 +4065,6 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$CBcallback_time = trim("$row[1]");
|
||||
$CBuser = trim("$row[2]");
|
||||
$CBcomments = trim("$row[3]");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4122,6 +4122,11 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00439',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="INSERT INTO vicidial_sessions_recent SET lead_id='$lead_id',server_ip='$server_ip',call_date=NOW(),user='$user',campaign_id='$campaign',conf_exten='$conf_exten',call_type='M';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00788',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$campaign_cid_override='';
|
||||
$LISTweb_form_address='';
|
||||
$LISTweb_form_address_two='';
|
||||
@@ -8155,6 +8160,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$alt_phone_count='';
|
||||
$INclosecallid='';
|
||||
$INxfercallid='';
|
||||
$rct = 'Q';
|
||||
|
||||
if ( (strlen($campaign)<1) || (strlen($server_ip)<1) )
|
||||
{
|
||||
@@ -8439,6 +8445,8 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
else
|
||||
{$dialed_label = 'ALT';}
|
||||
}
|
||||
if ($call_type == 'IN') {$rct = 'Y';}
|
||||
else {$rct = 'V';}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8447,11 +8455,13 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
if (preg_match('/^M|^V/',$callerid))
|
||||
{
|
||||
$call_type = 'OUT';
|
||||
$rct = 'V';
|
||||
$VDADchannel_group = $campaign;
|
||||
}
|
||||
else
|
||||
{
|
||||
$call_type = 'IN';
|
||||
$rct = 'Y';
|
||||
$stmt = "SELECT campaign_id,closecallid,xfercallid from vicidial_closer_log where lead_id = '$lead_id' order by closecallid desc limit 1;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -8473,6 +8483,11 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
}
|
||||
}
|
||||
|
||||
$stmt="INSERT INTO vicidial_sessions_recent SET lead_id='$lead_id',server_ip='$server_ip',call_date=NOW(),user='$user',campaign_id='$VDADchannel_group',conf_exten='$conf_exten',call_type='$rct';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00789',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ( ($call_type=='OUT') or ($call_type=='OUTBALANCE') )
|
||||
{
|
||||
$stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';";
|
||||
@@ -9792,6 +9807,11 @@ if ($ACTION == 'VDADcheckINCOMINGother')
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00493',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="INSERT INTO vicidial_sessions_recent SET lead_id='$lead_id',server_ip='$server_ip',call_date=NOW(),user='$user',campaign_id='$VDADchannel_group',conf_exten='$conf_exten',call_type='E';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00790',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
|
||||
### IF incoming result => answer email, not chat...
|
||||
|
||||
@@ -9958,7 +9978,11 @@ if ($ACTION == 'VDADcheckINCOMINGother')
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00645',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
|
||||
$stmt="INSERT INTO vicidial_sessions_recent SET lead_id='$lead_id',server_ip='$server_ip',call_date=NOW(),user='$user',campaign_id='$VDADchannel_group',conf_exten='$conf_exten',call_type='C';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00791',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($email_ct>0 || $chat_ct>0) {
|
||||
@@ -11090,6 +11114,11 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$stmt="INSERT INTO vicidial_sessions_recent SET lead_id='$lead_id',server_ip='$server_ip',call_date=NOW(),user='$user',campaign_id='$VDADchannel_group',conf_exten='$conf_exten',call_type='S';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00792',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
### update the recording_log lead_id to the new lead_id
|
||||
$stmt = "UPDATE recording_log set lead_id='$lead_id' where lead_id='$stage' and user='$user' and vicidial_id='$INclosecallid';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -14883,7 +14912,7 @@ if ($ACTION == 'PauseCodeMgrApr')
|
||||
}
|
||||
else
|
||||
{
|
||||
$auth_message = user_authorization($MgrApr_user,$MgrApr_pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($MgrApr_user,$MgrApr_pass,'',0,0,0,0,'vdc_db_query_mgr');
|
||||
if ($auth_message == 'GOOD')
|
||||
{
|
||||
$auth_pca=0;
|
||||
|
||||
@@ -164,7 +164,7 @@ if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'vdc_email_display');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ if ( ($submit_button=='YES') or ($admin_submit=='YES') )
|
||||
{$auth_api_flag = 1;}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,$auth_api_flag);
|
||||
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,$auth_api_flag,'vdc_form_display');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0,'vdc_script_display');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,0,0,0,'script_notes');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if ( (strlen($soundboard_id) < 1) and (strlen($avatar_id) > 0) ) {$soundboard_id=$avatar_id;}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,0,'vdc_soundboard_display');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
|
||||
@@ -607,10 +607,11 @@
|
||||
# 181003-1737 - Added external_web_socket_url option
|
||||
# 181005-1909 - Added SYSTEM manual_dial_filter option
|
||||
# 190108-0833 - Added manual_dial_validation option, updated dates for 2019
|
||||
# 190222-1316 - Added recent session per-call logging
|
||||
#
|
||||
|
||||
$version = '2.14-576c';
|
||||
$build = '190108-0833';
|
||||
$version = '2.14-577c';
|
||||
$build = '190222-1316';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=87;
|
||||
$one_mysql_log=0;
|
||||
@@ -1014,7 +1015,7 @@ if ($campaign_login_list > 0)
|
||||
$MGR_pass = preg_replace("/\'|\"|\\\\|;/","",$MGR_pass);
|
||||
|
||||
$MGR_auth=0;
|
||||
$auth_message = user_authorization($MGR_login,$MGR_pass,'MGR',0,0,0,0);
|
||||
$auth_message = user_authorization($MGR_login,$MGR_pass,'MGR',0,0,0,0,'vicidial_mgr_ovrd');
|
||||
if (preg_match("/^GOOD/",$auth_message))
|
||||
{$MGR_auth=1;}
|
||||
|
||||
@@ -1384,7 +1385,7 @@ else
|
||||
else
|
||||
{
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($VD_login,$VD_pass,'',1,0,1,0);
|
||||
$auth_message = user_authorization($VD_login,$VD_pass,'',1,0,1,0,'vicidial');
|
||||
if (preg_match("/^GOOD/",$auth_message))
|
||||
{
|
||||
$auth=1;
|
||||
@@ -5475,7 +5476,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{var call_cid = campaign_cid;}
|
||||
}
|
||||
|
||||
VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias="+ usegroupalias + "&preset_name=" + taskpresetname + "&campaign=" + campaign + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + CheckDEADcallON + "&" + alertquery + "&cid_lock=" + cid_lock + "&call_variables=" + taskvariables;
|
||||
VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias="+ usegroupalias + "&preset_name=" + taskpresetname + "&campaign=" + campaign + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + CheckDEADcallON + "&" + alertquery + "&cid_lock=" + cid_lock + "&session_id=" + session_id + "&call_variables=" + taskvariables;
|
||||
xmlhttp.open('POST', 'manager_send.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(VMCoriginate_query);
|
||||
@@ -7787,7 +7788,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
}
|
||||
if (xmlhttprequestselectupdate)
|
||||
{
|
||||
checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=LeaDSearcHSelecTUpdatE" + "&lead_id=" + LSSlead_id + "&stage=" + document.vicidial_form.lead_id.value + "&agent_log_id=" + agent_log_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&user_group=" + VU_user_group;
|
||||
checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=LeaDSearcHSelecTUpdatE" + "&lead_id=" + LSSlead_id + "&stage=" + document.vicidial_form.lead_id.value + "&agent_log_id=" + agent_log_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&user_group=" + VU_user_group + "&conf_exten=" + session_id;
|
||||
xmlhttprequestselectupdate.open('POST', 'vdc_db_query.php');
|
||||
xmlhttprequestselectupdate.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttprequestselectupdate.send(checkVDAI_query);
|
||||
|
||||
@@ -107,7 +107,7 @@ if ($non_latin < 1)
|
||||
}
|
||||
|
||||
$auth=0;
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0);
|
||||
$auth_message = user_authorization($user,$pass,'',0,1,0,0,'voicemail_check');
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
if (strlen($SSagent_debug_logging) > 1)
|
||||
|
||||
@@ -126,7 +126,7 @@ $UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summa
|
||||
|
||||
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
|
||||
|
||||
$APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead update_list update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaign update_did lead_field_info phone_number_log switch_lead ccc_lead_info lead_status_search call_status_stats calls_in_queue_count force_fronter_leave_3way';
|
||||
$APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead update_list update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaign update_did lead_field_info phone_number_log switch_lead ccc_lead_info lead_status_search call_status_stats calls_in_queue_count force_fronter_leave_3way force_fronter_audio_stop';
|
||||
|
||||
|
||||
### BEGIN housecleaning of old static report files, if not done before ###
|
||||
@@ -4468,12 +4468,13 @@ else
|
||||
# 190108-0806 - Added manual_dial_validation system and campaign options, update date for 2019
|
||||
# 190121-2019 - Added RA_AGENT_PHONE on-hook agent option
|
||||
# 190207-2301 - Fix for user-group, in-group and campaign allowed/permissions matching issues
|
||||
# 190221-1831 - Added force_fronter_audio_stop API function
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
|
||||
|
||||
$admin_version = '2.14-698a';
|
||||
$build = '190207-2301';
|
||||
$admin_version = '2.14-699a';
|
||||
$build = '190221-1831';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
|
||||
Reference in New Issue
Block a user