The following error may occur when a user logs in and goes into the call monitor menu.
To many files in /var/spool/asterisk/monitor/filename.gsm Not all files processed
This occurs because by default the maximum number of files allowed is 3,000 which is defined in /var/www/html/recordings/includes/bootstrap.php.
The number of files allowed is defined in the following section. You can increase 3000 to something higher, however as I read it may cause performance issues with the system.
function getFiles($path,$filter,$recursive_max,$recursive_count) {
global $SETTINGS_MAX_FILES;
$SETTINGS_MAX_FILES = isset($SETTINGS_MAX_FILES) ? $SETTINGS_MAX_FILES : 3000;
There is also a typo that can be corrected in the following section. "To many files in" should be "Too many files in".
$fileCount++;
if ($fileCount>$SETTINGS_MAX_FILES) {
$_SESSION['ari_error']
.= _("To many files in $msg_path Not all files processed") . "
";
return;
}
Rather than increasing the number of files allowed, I would suggest creating a cronjob to cleanup the directory. If you edit /etc/crontab you could add the following line which would delete all the files on a weekly basis. You can change the frequency that this occurs with a pre-defined definition or using a custom schedule of your own. For more information check out the Wikipedia article on cron.
@weekly root rm -f /var/spool/asterisk/monitor/*
Hello, I use this:
BalasHapuscat /etc/cron.daily/clean_asterisk
#!/bin/bash
find /var/spool/asterisk/monitor -mtime +14 -type f -delete