I have recently started having fun with PBX systems.
The UCP on AsteriskNOW/FreePBX was not an ideal way for me to listen to .wav call recordings on my iPhone in my own time.
The following tutorial will demonstrate how to sync .wav files to an ownCloud server that you can stream your call recordings on any smart phone.
First, get a small ownCloud server.
Log into ownCloud and make a folder called IVR-Recordings.
SSH into your ownCloud server and make a new pair of SSH Keys.
ssh-keygen -t rsa
Put the public key on your Asterisk server for password-less login.
ssh-copy-id -i ~/.ssh/id_rsa.pub root@AST.ERISK.SERVER.IP
Asterisk recordings are stored in /var/spool/asterisk/monitor/
Therefore, we want to rsync the folder to our ownCloud setup as follows:
rsync --ignore-existing -r root@AST.ERISK.SERVER.IP:/var/spool/asterisk/monitor/* /home/admin/web/OWNCLOUD.DOMAIN/public_html/data/admin/files/IVR-Recordings/
rsync to copy the recording folder, –ignore-existing to ignore recordings already copied, -r to copy them recursively. Replace AST.ERISK.SERVER.IP with your Asterisk/FreePBX server IP.
If doing this as root, the new recordings will be owned by root, so let’s chown them to admin:
chown admin:admin -R /home/admin/web/OWNCLOUD.DOMAIN/public_html/data/admin/files/IVR-Recordings/
Now the files are in the IVR-Recordings folder, but not yet picked up by ownCloud so we need ownCloud to “rescan the filesystem” and put the new files in it’s system:
sudo -u admin php /home/admin/web/OWNCLOUD.DOMAIN/public_html/occ files:scan --all
As root, this will run “occ”, a PHP file by ownCloud, that has many cool commands. It will rescan the filesystem for missing files, i.e. the recordings that we just imported.