Hi, hansg
I happen to view your tread here while having the same/somewhat similar issue.
The way I understand it you want to store and access the recordings at a shared/mounted drive
you already made the mounted drive as document root for your FTP at /home/archive correct?
This is quite long and I still might not be able state all completely here so just let me know which method you want to try.
Now if enabling AST_CRON_audio_3_ftp.pl changes the recording link/LOCATION to ftp url as supposed to example LOCATION is =
ftp://yourftphost/recordingsdirectory/ then you can access the recordings at the mounted drive just fine.
And note to pass --MP3 if you want the script to store MP3 and now .wav
/usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3
Else if AST_CRON_audio_3_ftp.pl does not work for you and having problem for some reason like in my case where ftp is located at VPS internal ip and behind firewall(NAT) then most likely you just need to configure the ftp commands AST_CRON_audio_3_ftp.pl adding the line "passive" example below.
$ftp = Net::FTP->new("$VARFTP_host", Port => $VARFTP_port, Debug => $FTPdb);
$ftp->passive("passive");
$ftp->login("$VARFTP_user","$VARFTP_pass");
$ftp->cwd("$VARFTP_dir");
Just find those lines on the AST_CRON_audio_3_ftp.pl script and add $ftp->passive("passive"); as shown above.
Now if you want other method to store your MP3 files to shared/mounted drive and access recordings on that location then you can just pass as copy command from /var/spool/asterisk/monitorDONE/MP3 to /mnt/nfs/
Additional method needed though to create a script and schedule it at crontab
but the copy command from MP3 files to mounted drive should like below
like cp -d /var/spool/asterisk/monitorDONE/MP3/* /mnt/nfs/
create a file at any location you can call say at /home/backup-script
sudo nano /home/backup-script
enter below and save
#!/bin/bash
cp -d /var/spool/asterisk/monitorDONE/MP3/* /mnt/nfs/
sudo chmod 755 /home/backup-script
crontab -e
and add at the bottom
#back-up script
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /home/backup-script
Using this method you need to enable below script at crontab just uncomment the script.
since you will have same files at two locations /var/spool/asterisk/monitorDONE/MP3 and /mnt/nfs
make sure to change the location as show below since the default location is just /var/spool/asterisk/monitorDONE
### remove old recordings more than 7 days old
24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/MP3 -maxdepth 7 -type f -mtime +7 -print | xargs rm -f
now to make your site run a redirect to /mnt/nfs if files are already deleted at first location and will now go to /mnt/nfs/ to look for the files.
Edit the .conf file where you added below Alias rule.
httpd.conf, apache2.conf or 000-default.conf depends on where you declare this rule.
edit you original conf file to
Alias /RECORDINGS/MP3/ "/var/spool/asterisk/monitorDONE/MP3/"
<Directory "/var/spool/asterisk/monitorDONE/MP3">
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /mnt/nfs/$1 [R=302,L]
# if you want to redirect to ftp address of /mnt/nfs/ the use below " just choose one from the # two RewriteRule
RewriteRule (.*)
ftp://user:pass@yourftphost/directory/$1 [R=302,L]
<files *.mp3>
Forcetype application/forcedownload
</files>
</Directory>
Sorry I know its a lot but it works perfectly. just let me know if I need to go and futher explanation.
Hope this helps