added user to recording_log table and associated scripts
added recordings list to user_stats.php page changed user_stats.php page to use time range for calls list and recordings list git-svn-id: svn://192.168.202.10@428 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
@@ -944,7 +945,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$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<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
|
||||
@@ -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 "<center>\n";
|
||||
|
||||
echo "<B>CALLS TO THIS LEAD:</B>\n";
|
||||
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
echo "<tr $bgcolor><td><font size=2>$row[4]</td>";
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td><font size=2>$row[4]</td>";
|
||||
echo "<td align=left><font size=2> $row[7]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[8]</td>\n";
|
||||
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
|
||||
@@ -437,7 +441,6 @@ echo "<tr><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td
|
||||
echo "<td align=right><font size=2> $row[2] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[1] </td></tr>\n";
|
||||
|
||||
$u++;
|
||||
}
|
||||
|
||||
|
||||
@@ -445,10 +448,10 @@ echo "</TABLE></center>\n";
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
|
||||
echo "<TABLE width=700 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> RECID</td><td align=left><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td></tr>\n";
|
||||
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\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 "<tr><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td>
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td align=left><font size=2> $row[12] </td>";
|
||||
echo "<td align=left><font size=2> $row[4] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[8] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[0] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[10] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[11] </td>\n";
|
||||
echo "<td align=center><font size=2> $row[10] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[11] </td>\n";
|
||||
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
|
||||
echo "</tr>\n";
|
||||
|
||||
$u++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 "<br><br>\n";
|
||||
|
||||
echo "<center>\n";
|
||||
|
||||
echo "<B>LAST 50 CALLS:</B>\n";
|
||||
echo "<B>CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\n";
|
||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
echo "<tr $bgcolor><td><font size=2>$row[4]</td>";
|
||||
$u++;
|
||||
echo "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td><font size=2>$row[4]</td>";
|
||||
echo "<td align=left><font size=2> $row[7]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[8]</td>\n";
|
||||
echo "<td align=left><font size=2> $row[10] </td>\n";
|
||||
@@ -278,13 +283,47 @@ echo "<tr><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td
|
||||
echo "<td align=right><font size=2> $row[2] </td>\n";
|
||||
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td></tr>\n";
|
||||
|
||||
$u++;
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
|
||||
|
||||
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td></tr>\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 "<tr $bgcolor>";
|
||||
echo "<td><font size=1>$u</td>";
|
||||
echo "<td align=left><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[12]\" target=\"_blank\">$row[12]</A> </td>";
|
||||
echo "<td align=left><font size=2> $row[4] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[8] </td>\n";
|
||||
echo "<td align=left><font size=2> $row[0] </td>\n";
|
||||
echo "<td align=center><font size=2> $row[10] </td>\n";
|
||||
echo "<td align=right><font size=2> $row[11] </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
Reference in New Issue
Block a user