[asterisk-users] recording in mp3
andrew Colin
andrew at vsave.co.za
Thu Jul 3 14:09:48 CDT 2014
Can you explain?
Sent from Samsung Mobile
<div>-------- Original message --------</div><div>From: Tiago Geada <tiago.geada at gmail.com> </div><div>Date:03/07/2014 9:04 PM (GMT+02:00) </div><div>To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com> </div><div>Subject: Re: [asterisk-users] recording in mp3 </div><div>
</div>no need.
mixmonitor has a argument that is a script ran just as the recording is finished.
we use this to move the file from ramfs to final destination.
you can use it to use sox and convert it...
On 2 July 2014 18:54, Dave Platt <dplatt at radagast.org> wrote:
> Problem with this is client needs to listen to the call recordings and my interface will only display .wav or .mp3 so they will moan if they have to wait until the next day for today's recordings
If you're up to writing a bit of shell script, and are running
on Linux, you could automate the conversion process so that it
happens as soon as the recording is completed.
Look at the "inotify" system service (man section 7) and the
"inotifywatch" program. You can tell inotifywatch to monitor
files being written into a specific directory (or set of
directories) and output a series of events when files in this
directory are open or closed.
What you'd probably want to do, is catch the "close_write"
events (a file has been closed, and it had been opened in
a mode which allows it to be written). When you see a
close_write event for a recording file of the sort that
Asterisk writes, you'd check to see if it's been converted
to your desired format yet. If not, fire off a separate
task (e.g. via "batch") to convert it.
Here's a very simple script I did to do something like this...
run a periodic-processing script a few seconds after files
with a specific name pattern have been touched in any way.
It's not sophisticated enough to look only for close or
close_wait events, but it should give you the idea.
#!/bin/bash
function processevents () {
action=0
while true ; do
if [ $action == 0 ] ; then
timeout=300
else
timeout=5
fi
read -t $timeout event
if [ $? != 0 ] ; then
action=0
/data/soundchaser/periodic
else
if [[ $event =~ ".wav" || $event =~ ".gotit" ]] ; then
action=1
fi
fi
done
}
cd /data/soundchaser
inotifywait -m /data/soundchaser/public_html/done | processevents
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140703/efd325f5/attachment.html>
More information about the asterisk-users
mailing list