Index: /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/bootstrap.php
===================================================================
--- /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/bootstrap.php (revision 4993)
+++ /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/bootstrap.php (revision 6832)
@@ -98,4 +98,6 @@
*/
function getFiles($path,$filter,$recursive_max,$recursive_count) {
+ global $SETTINGS_MAX_FILES;
+ $SETTINGS_MAX_FILES = isset($SETTINGS_MAX_FILES) ? $SETTINGS_MAX_FILES : 3000;
$files = array();
@@ -110,5 +112,5 @@
$fileCount++;
- if ($fileCount>3000) {
+ if ($fileCount>$SETTINGS_MAX_FILES) {
$_SESSION['ari_error']
.= _("To many files in $msg_path Not all files processed") . "
";
Index: /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/display.php
===================================================================
--- /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/display.php (revision 1395)
+++ /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/display.php (revision 6832)
@@ -171,6 +171,6 @@
function displayNavigationBlock($m,$q,$url_opts,$start,$span,$total) {
- $start = $start=='' ? 0 : $start ;
- $span = $span=='' ? 15 : $span ;
+ $start = ($start=='' || !ctype_digit($start)) ? 0 : $start;
+ $span = ($span=='' || !ctype_digit($span)) ? 15 : $span;
$total_pages = ceil($total/$span);
Index: /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/login.php
===================================================================
--- /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/login.php (revision 6419)
+++ /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/login.php (revision 6832)
@@ -336,6 +336,9 @@
$_SESSION['ari_user']['default_page'] = $default_page;
- // force the session data saved
- session_write_close();
+ // Make sure nothing stale is here:
+ //
+ unset($_SESSION['ari_user']['recfiles']);
+
+ // don't force the session data saved, there may be voicemail or callmonitor files still
}
}
Index: /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/main.conf.php
===================================================================
--- /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/main.conf.php (revision 4993)
+++ /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/includes/main.conf.php (revision 6832)
@@ -68,5 +68,5 @@
#
-# Admin only account
+# Admin only account - change defaults to prevent unauthorized access to call recordings
#
$ARI_ADMIN_USERNAME = "admin";
@@ -81,4 +81,5 @@
# Authentication password to unlock cookie password
# This must be all continuous and only letters and numbers
+# Change this password to prevent unauthorized access to cookie contents
#
$ARI_CRYPT_PASSWORD = "z1Mc6KRxA7Nw90dGjY5qLXhtrPgJOfeCaUmHvQT3yW8nDsI2VkEpiS4blFoBuZ";
@@ -263,5 +264,5 @@
$ASTERISK_PROTOCOLS['sip']['config_files'] = "/etc/asterisk/sip.conf;/etc/asterisk/sip_additional.conf";
$ASTERISK_PROTOCOLS['zap']['table'] = "zap";
-$ASTERISK_PROTOCOLS['zap']['config_files'] = "/etc/asterisk/zapata.conf;/etc/asterisk/zapata_additional.conf";
+$ASTERISK_PROTOCOLS['zap']['config_files'] = "/etc/asterisk/zapata.conf;/etc/asterisk/zapata_additional.conf;/etc/asterisk/chan_dahdi.conf;/etc/asterisk/chan_dahdi_additional.conf";
# Settings for Follow-Me Select Boxes in seconds
@@ -326,5 +327,9 @@
$SETTINGS_ALLOW_PHONE_SETTINGS = 1;
-
+#
+# Maximum number of sound files that will be read before an error is generated indicating issues since
+# too many files can be create problems but on some systems this may need to be increased.
+#
+$SETTINGS_MAX_FILES=3000;
?>
Index: /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/modules/callmonitor.module
===================================================================
--- /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/modules/callmonitor.module (revision 6476)
+++ /freepbx/branches/ari_changes/amp_conf/htdocs/recordings/modules/callmonitor.module (revision 6832)
@@ -60,12 +60,18 @@
$files = array();
foreach($_REQUEST as $key => $value) {
- if (preg_match('/selected/',$key)) {
- array_push($files, $value);
+ if (preg_match('/selected/',$key) && isset($_SESSION['ari_user']['recfiles'][$value])) {
+ array_push($files, $_SESSION['ari_user']['recfiles'][$value]);
}
}
if ($a=='delete') {
- $this->deleteRecData($files);
- }
+ if (count($files) > 0) {
+ $this->deleteRecData($files);
+ } else {
+ $_SESSION['ari_error']
+ = _("One or more messages must be selected before clicking delete.");
+ }
+ }
+
if ($a=='ignore') {
@@ -100,8 +106,6 @@
global $CALLMONITOR_ALLOW_DELETE;
global $AJAX_PAGE_REFRESH_ENABLE;
- global $ARI_CRYPT_PASSWORD;
$display = new DisplaySearch();
- $crypt = new Crypt();
// get the search string
@@ -115,8 +119,8 @@
$duration_filter = getArgument($args,'duration_filter');
- $start = $start=='' ? 0 : $start;
- $span = $span=='' ? 15 : $span;
+ $start = ($start=='' || !ctype_digit($start)) ? 0 : $start;
+ $span = ($span=='' || !ctype_digit($span)) ? 15 : $span;
$order = $order=='' ? 'calldate' : $order;
- $sort = $sort=='' ? 'desc' : $sort;
+ $sort = ($sort=='' || strtolower($sort) == 'desc') ? 'desc' : 'asc';
$displayname = $_SESSION['ari_user']['displayname'];
@@ -138,6 +142,12 @@
// build controls
if ($CALLMONITOR_ALLOW_DELETE) {
+ if (count($recordings) > 0) {
+ $controls .= "
@@ -204,11 +214,12 @@
// table body
- $playbackRow = 2; // Index to keep track of where playback control rows should be inserted.
- foreach($data as $key=>$value) {
+ unset($_SESSION['ari_user']['recfiles']);
+ // Index to keep track of where playback control rows should be inserted.
+ $playbackRow = 2;
+ if (is_array($data)) foreach($data as $key=>$value) {
+ $i++;
// recording file
$recording = $recordings[$value['uniqueid'] . $value['calldate']];
- $fileCrypt = $crypt->encrypt($recording,$ARI_CRYPT_PASSWORD);
- $recordingCrypt = urlencode($fileCrypt);
// date and time
@@ -217,14 +228,17 @@
$time = $buf[1];
- // recording delete checkbox
- if ($CALLMONITOR_ALLOW_DELETE) {
- $recording_delete_checkbox = "
";
- $downloadLink = "
";
+ if (is_file($recording)) {
+ $_SESSION['ari_user']['recfiles'][$i] = $recording;
+ $recordingLink = "
";
+ $downloadLink = "
";
+ if ($CALLMONITOR_ALLOW_DELETE) {
+ $recording_delete_checkbox = "