Added display of vicidial_vmm_counts data, if $CIDdisplay=="Yes" to modify lead page

Remove commas from mailbox name before writing to conf file, use "Full Name" for a phone's mailbox name, if set in keepalive_ALL script

git-svn-id: svn://192.168.202.10@3468 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-06-30 21:27:53 +00:00
parent 53eb23b807
commit 118367f4d8
3 changed files with 71 additions and 5 deletions
+10 -4
View File
@@ -149,9 +149,10 @@
# 210325-2145 - Fix for -adfill-delay= CLI flag, Issue #1266
# 210429-1644 - Added mohsuggest config for SIP and IAX phones
# 210605-1407 - Added purging of vicidial_tiltx_shaken_log log entries
# 210630-1630 - Remove commas from mailbox name before writing to conf file, use "Full Name" for a phone's mailbox name, if set
#
$build = '210605-1407';
$build = '210630-1630';
$DB=0; # Debug flag
$teodDB=0; # flag to log Timeclock End of Day processes to log file
@@ -3957,7 +3958,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
while ($sthArows > $i)
{
##### Get the distinct phone entries #####
$stmtA = "SELECT extension,pass,email,delete_vm_after_email,voicemail_timezone,voicemail_options FROM phones where active='Y' and voicemail_id='$voicemail[$i]';";
$stmtA = "SELECT extension,pass,email,delete_vm_after_email,voicemail_timezone,voicemail_options,fullname FROM phones where active='Y' and voicemail_id='$voicemail[$i]';";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -3971,11 +3972,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$delete_vm_after_email[$i] = $aryA[3];
$voicemail_timezone[$i] = $aryA[4];
$voicemail_options[$i] = $aryA[5];
$fullname[$i] = $aryA[6];
$fullname[$i] =~ s/,//gi;
if (length($fullname[$i]) < 1) {$fullname[$i] = "$extension[$i] Mailbox";}
if ($delete_vm_after_email[$i] =~ /Y/)
{$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=yes|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
{$vm .= "$voicemail[$i] => $pass[$i],$fullname[$i],$email[$i],,|delete=yes|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
else
{$vm .= "$voicemail[$i] => $pass[$i],$extension[$i] Mailbox,$email[$i],,|delete=no|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
{$vm .= "$voicemail[$i] => $pass[$i],$fullname[$i],$email[$i],,|delete=no|tz=$voicemail_timezone[$i]|$voicemail_options[$i]\n";}
}
$sthA->finish();
@@ -3999,6 +4003,8 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
@aryA = $sthA->fetchrow_array;
$voicemail_id[$i] = $aryA[0];
$fullname[$i] = $aryA[1];
$fullname[$i] =~ s/,//gi;
if (length($fullname[$i]) < 1) {$fullname[$i] = "Mailbox $voicemail_id[$i]";}
$pass[$i] = $aryA[2];
$email[$i] = $aryA[3];
$delete_vm_after_email[$i] = $aryA[4];
@@ -106,6 +106,7 @@
# 210304-1509 - Added option '5' for modify_lead for this page to work as read-only
# 210421-2120 - Added more screen labels
# 210629-1545 - Added KHOMP stats display
# 210630-0838 - Added display of vicidial_vmm_counts data, if $CIDdisplay=="Yes"
#
require("dbconnect_mysqli.php");
@@ -3170,6 +3171,65 @@ else
echo "</TABLE><BR><BR>\n";
if ($CIDdisplay=="Yes")
{
echo "<B>"._QXZ("VOICEMAIL MESSAGE DAILY COUNT LOGS FOR THIS LEAD").":</B>\n";
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td align=left><font size=2>"._QXZ("DATE")." </td><td align=left><font size=2>"._QXZ("MESSAGE STARTED COUNT")." </td><td align=left><font size=2> &nbsp; "._QXZ("MESSAGE COMPLETED COUNT")."</td></tr>\n";
$stmt="SELECT call_date,vmm_count,vmm_played from vicidial_vmm_counts where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' order by call_date desc limit 500;";
$rslt=mysql_to_mysqli($stmt, $link);
$logs_to_print = mysqli_num_rows($rslt);
if ($DB) {echo "$logs_to_print|$stmt|\n";}
$u=0;
while ($logs_to_print > $u)
{
$row=mysqli_fetch_row($rslt);
if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
else
{$bgcolor="bgcolor=\"#$SSstd_row1_background\"";}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2> $row[0] </td>";
echo "<td align=left><font size=2> $row[1] </td>\n";
echo "<td align=left><font size=2> $row[2] &nbsp; </td>\n";
echo "</tr>\n";
}
if ($archive_log=="Yes")
{
$stmt="SELECT call_date,vmm_count,vmm_played from vicidial_vmm_counts_archive where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' order by call_date desc limit 500;";
$rslt=mysql_to_mysqli($stmt, $link);
$logs_to_print = mysqli_num_rows($rslt);
if ($DB) {echo "$logs_to_print|$stmt|\n";}
$u=0;
while ($logs_to_print > $u)
{
$row=mysqli_fetch_row($rslt);
if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
else
{$bgcolor="bgcolor=\"#$SSstd_row1_background\"";}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2 color='#FF0000'> $row[0] </td>";
echo "<td align=left><font size=2> $row[1] </td>\n";
echo "<td align=left><font size=2> $row[2] &nbsp; </td>\n";
echo "</tr>\n";
}
}
echo "</TABLE><BR><BR>\n";
}
##### BEGIN switch lead log entries #####
$stmt="SELECT * from vicidial_agent_function_log where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and function='switch_lead' order by event_time desc limit 500;";
$rslt=mysql_to_mysqli($stmt, $link);
+1 -1
View File
@@ -1559,7 +1559,7 @@ else
}
$ANI='';
$ANI_stmt="SELECT caller_code from call_log where uniqueid='$vicidial_id' order by event_time;";
$ANI_stmt="SELECT caller_code from call_log where uniqueid='$vicidial_id' order by start_time;";
$ANI_rslt=mysql_to_mysqli($ANI_stmt, $link);
$ANI_logs_to_print = mysqli_num_rows($ANI_rslt);
if ($ANI_logs_to_print > 0)