Use with caution, not well tested, give us some feedback please. This will iterate through each domain. The lame settings I have chosen give great quality with good compression.
If you have not installed it already:
Add a cron job for just after midnight or another convenient time eg:
Obviously, you need to be using the default fusionpbx recording location.
Don't forget to make your script executable with chmod +x
If you have not installed it already:
Code:
apt-get install lame
Code:
#!/bin/sh
for DIRECTORY in /var/lib/freeswitch/recordings/*/; do
DIRYESTERDAY=/var/lib/freeswitch/recordings/`basename "$DIRECTORY"`/archive/`date -d "yesterday" +%Y/%b/%d`
if [ -d "$DIRYESTERDAY" ]; then
for WAVFILE in /var/lib/freeswitch/recordings/`basename "$DIRECTORY"`/archive/`date -d 'yesterday' +%Y/%b/%d`/*.wav; do
bname=`basename $WAVFILE .wav`
lame -b 16 -m m -q 8 $WAVFILE $DIRYESTERDAY/$bname.mp3 >> /dev/null
done
rm $DIRYESTERDAY/*.wav
fi
done
chown -R www-data:www-data /var/lib/freeswitch/recordings
Add a cron job for just after midnight or another convenient time eg:
Code:
5 0 * * * /bin/bash /root/convert_wav_to_mp3.sh >/dev/null 2>&1
Obviously, you need to be using the default fusionpbx recording location.
Don't forget to make your script executable with chmod +x