[asterisk-users] Call Recording and Posting

Dan Journo dan at keshercommunications.com
Mon Oct 12 16:38:38 CDT 2009


Thanks for that.

I really appreciate it!

Dan


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ivan Stepaniuk
Sent: 12 October 2009 22:12
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Call Recording and Posting

Dan Journo wrote:
> Thank you for replying. I hadn't thought about the problem of simultaneous calls. It would be a problem if a number of calls ended at the same time.
>
> If you can post it, the script would really be helpful as I'm only a beginner with Linux
    The script is very simple and far from complete, it just moves the 
content into the mounted FTP directory. It has some verbose output as it 
is run from inside another script that redirects the output to a log file.
    The script has a password inside so remember to 'chown root' and 
'chmod 700' the file to protect it from other users.
    You have to set up a cron so the script is run every hour, normally 
putting the script or a link to it inside '/etc/cron.hourly' is enough. 
There is also a /etc/crontab file you can use to setup something more 
complicated if needed (ie: runing it every 2 hours, running at tea 
time...). read 'man cron', and 'man crontab'. 
    You also need to install the magic part, 'curlftps'. in Debian 
that's the name of the package too. I use version curlftpfs 0.9.1 
libcurl/7.18.2 fuse/2.5
    Be careful that in *nix, file.WAV and file.wav are different files.

Here is the script:

#!/bin/sh

MOUNT_POINT="/mnt/remote_ftp"
FTP_HOST="www.ftphost.com/htdocs/recordings"
FTP_USER="ftpusername:difficultpassword"
RECORDINGS="/var/spool/asterisk/monitor/upload"

echo "Starting upload `date` "
echo "Connecting to $FTP_HOST..."
curlftpfs -o user="$FTP_USER" "$FTP_HOST" "$MOUNT_POINT"

echo "Transfering `du -hc "$RECORDINGS"/*.wav | grep total` ..."
mv -vf "$RECORDINGS"/*.wav "$MOUNT_POINT"

echo "Disconnecting."
umount "$MOUNT_POINT"

exit 0

-- 
Iván Stepaniuk
Alba Fotónica S. L.
www.albafotonica.com


_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list