diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql
index fa5b7cad..c5de13a2 100644
--- a/extras/MySQL_AST_CREATE_tables.sql
+++ b/extras/MySQL_AST_CREATE_tables.sql
@@ -139,8 +139,10 @@ length_in_min DOUBLE(8,2),
filename VARCHAR(50),
location VARCHAR(255),
lead_id INT(9) UNSIGNED,
+user VARCHAR(20),
index (filename),
-index(lead_id)
+index(lead_id),
+index(user)
);
CREATE TABLE live_inbound (
diff --git a/extras/upgrade_2.0.2.sql b/extras/upgrade_2.0.2.sql
index c0d99fa6..01d01f2c 100644
--- a/extras/upgrade_2.0.2.sql
+++ b/extras/upgrade_2.0.2.sql
@@ -48,3 +48,5 @@ ALTER TABLE vicidial_list ADD index (postal_code);
ALTER TABLE recording_log ADD lead_id INT(9) UNSIGNED;
ALTER TABLE recording_log ADD index (lead_id);
+ALTER TABLE recording_log ADD user VARCHAR(20);
+ALTER TABLE recording_log ADD index (user);
diff --git a/www/agc/manager_send.php b/www/agc/manager_send.php
index 4049b96c..d8434635 100644
--- a/www/agc/manager_send.php
+++ b/www/agc/manager_send.php
@@ -63,6 +63,7 @@
# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers
# 61004-1526 - Added parsing of volume control command and lookup or number
# 61130-1617 - Added lead_id to MonitorConf for recording_log
+# 61201-1115 - Added user to MonitorConf for recording_log
#
require("dbconnect.php");
@@ -882,7 +883,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
if ($ACTION=="Monitor")
{
- $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id')";
+ $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')";
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
@@ -944,7 +945,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
- $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id')";
+ $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')";
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
diff --git a/www/vicidial/admin_modify_lead.php b/www/vicidial/admin_modify_lead.php
index a642ef70..2d9639e2 100644
--- a/www/vicidial/admin_modify_lead.php
+++ b/www/vicidial/admin_modify_lead.php
@@ -104,6 +104,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
# 60609-1112 - Added DNC list addition if status changed to DNC
# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat
# 61130-1639 - Added recording_log lookup and list for this lead_id
+# 61201-1136 - Added recording_log user(TSR) display and link
#
$STARTtime = date("U");
@@ -414,9 +415,9 @@ echo "
\n";
echo "CALLS TO THIS LEAD:\n";
echo "\n";
-echo "| DATE/TIME | LENGTH | STATUS | TSR | CAMPAIGN | LIST | LEAD |
\n";
+echo "| # | DATE/TIME | LENGTH | STATUS | TSR | CAMPAIGN | LIST | LEAD |
\n";
- $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;";
+ $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
@@ -429,7 +430,10 @@ echo "| DATE/TIME | LENGTH | $row[4] | ";
+ $u++;
+ echo "
";
+ echo "| $u | ";
+ echo "$row[4] | ";
echo " $row[7] | \n";
echo " $row[8] | \n";
echo " $row[11] | \n";
@@ -437,7 +441,6 @@ echo "
| DATE/TIME | LENGTH | $row[2] \n";
echo " $row[1] |
\n";
- $u++;
}
@@ -445,10 +448,10 @@ echo "
\n";
echo "
\n";
echo "RECORDINGS FOR THIS LEAD:\n";
-echo "\n";
-echo "| LEAD | DATE/TIME | SECONDS | RECID | FILENAME | LOCATION |
\n";
+echo "\n";
+echo "| # | LEAD | DATE/TIME | SECONDS | RECID | FILENAME | LOCATION | TSR |
\n";
- $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 50;";
+ $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
@@ -461,16 +464,18 @@ echo "| LEAD | DATE/TIME |
else
{$bgcolor='bgcolor="#9BB9FB"';}
+ $u++;
echo "
";
+ echo "| $u | ";
echo " $row[12] | ";
echo " $row[4] | \n";
echo " $row[8] | \n";
echo " $row[0] | \n";
- echo " $row[10] | \n";
- echo " $row[11] | \n";
+ echo " $row[10] | \n";
+ echo " $row[11] | \n";
+ echo " $row[13] | ";
echo "
\n";
- $u++;
}
diff --git a/www/vicidial/closer-fronter_popup.php b/www/vicidial/closer-fronter_popup.php
index 98938487..98a58eca 100644
--- a/www/vicidial/closer-fronter_popup.php
+++ b/www/vicidial/closer-fronter_popup.php
@@ -7,6 +7,7 @@
# CHANGES
#
# 60620-1020 - Added variable filtering to eliminate SQL injection attack threat
+# 61201-1114 - Added lead_id and user to recording_log entry
#
require("dbconnect.php");
@@ -245,7 +246,7 @@ if ($parked_count > 0)
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
- $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id) values('Zap/" . mysql_real_escape_string($channel) . "','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "','$lead_id')";
+ $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('Zap/" . mysql_real_escape_string($channel) . "','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "','$lead_id','$user')";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
diff --git a/www/vicidial/closer-fronter_popup2.php b/www/vicidial/closer-fronter_popup2.php
index 8914ed35..1c98063d 100644
--- a/www/vicidial/closer-fronter_popup2.php
+++ b/www/vicidial/closer-fronter_popup2.php
@@ -7,6 +7,7 @@
# CHANGES
#
# 60620-1025 - Added variable filtering to eliminate SQL injection attack threat
+# 61201-1114 - Added lead_id and user to recording_log entry
#
require("dbconnect.php");
@@ -259,7 +260,7 @@ if ($parked_count > 0)
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
- $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id) values('$channel','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "','$lead_id')";
+ $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "','$lead_id','$user')";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
diff --git a/www/vicidial/user_stats.php b/www/vicidial/user_stats.php
index ba10a76b..b5336d06 100644
--- a/www/vicidial/user_stats.php
+++ b/www/vicidial/user_stats.php
@@ -6,6 +6,7 @@
# CHANGES
#
# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat
+# 61201-1136 - Added recordings display and changed calls to time range with 10000 limit
#
header ("Content-type: text/html; charset=utf-8");
@@ -254,11 +255,12 @@ echo "
\n";
echo "\n";
-echo "LAST 50 CALLS:\n";
+echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n";
echo "\n";
-echo "| DATE/TIME | LENGTH | STATUS | PHONE | CAMPAIGN | LIST | LEAD |
\n";
+echo "| # | DATE/TIME | LENGTH | STATUS | PHONE | CAMPAIGN | LIST | LEAD |
\n";
- $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by call_date desc limit 50;";
+ $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
+ echo "|$stmt|\n";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
@@ -270,7 +272,10 @@ echo "| DATE/TIME | LENGTH | $row[4] | ";
+ $u++;
+ echo "
";
+ echo "| $u | ";
+ echo "$row[4] | ";
echo " $row[7] | \n";
echo " $row[8] | \n";
echo " $row[10] | \n";
@@ -278,13 +283,47 @@ echo "
| DATE/TIME | LENGTH | $row[2] \n";
echo " $row[1] |
\n";
- $u++;
}
echo "
\n";
+
+echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n";
+echo "\n";
+echo "| # | LEAD | DATE/TIME | SECONDS | RECID | FILENAME | LOCATION |
\n";
+
+ $stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;";
+ echo "|$stmt|\n";
+ $rslt=mysql_query($stmt, $link);
+ $logs_to_print = mysql_num_rows($rslt);
+
+ $u=0;
+ while ($logs_to_print > $u)
+ {
+ $row=mysql_fetch_row($rslt);
+ if (eregi("1$|3$|5$|7$|9$", $u))
+ {$bgcolor='bgcolor="#B9CBFD"';}
+ else
+ {$bgcolor='bgcolor="#9BB9FB"';}
+
+ $u++;
+ echo "";
+ echo "| $u | ";
+ echo " $row[12] | ";
+ echo " $row[4] | \n";
+ echo " $row[8] | \n";
+ echo " $row[0] | \n";
+ echo " $row[10] | \n";
+ echo " $row[11] | \n";
+ echo "
\n";
+
+ }
+
+
+echo "
\n";
+
$ENDtime = date("U");
$RUNtime = ($ENDtime - $STARTtime);