Small call center running Asterisk / TrixBox 2.6.2
Requires Perl script to archive voice recordings to remote samba share.
## Deliverables
We have a small Asterisk server which is set to record all calls.
We want a Perl Script that is run every 15 minutes by Cron to move the recorded files from the Asterisk server to another server using Samba.
This script will be installed and maintained by our Administrator.
So the script will need to have configuration data toward the top of the script.
IE directory paths, Samba share path/username/password.
The script should be documented so that we can alter it at a later date.
The script should employ error checking, IE is the Samba machine available.
The script should only move the recording files once the Asterisk has closed the file.
Our paths on the TrixBox install are currently all standard.
Current path of recording files on the Asterisk server
/var/spool/asterisk/monitor/
The recoding file names look something like this;
[login to view URL]
Description of file name.
OUT801 : Call made from SIP extension 801
20100817-112029 : Call made at 2010-08-17 11:20:29
1282018829.1619 : Unique Id of the call record. ( the integer part is a unix timestamp ie '2010-08-17 11:20:29' as TS )
The unique ID ties back to the CDR record on the Asterisks MySQL
These files need to be moved to our NAS unit, using SMB.
( The script should make / check the SMB connection )
To a path with a new directory for each day along these lines.
\\nas\call-recording\2010\2010-08\2010-08-17\[login to view URL]
The script will need to create the directory path.
\\nas\call-recording\YYYY\YYYY-MM\YYYY-MM-DD
I've tested the following regex which works;
'/^OUT(?P<extn>\d+)-(?P<date>\d+)-(?P<time>\d+)-(?P<uniqueWhole>\d+)\.(?P<uniquePart>\d+)\.wav$/'
Don't know if that helps?
Nas server name: nas
Nas user name: asterisk
Nas password: recordme