<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body ><div><div></div><div>Can you explain?</div><div><br></div><div><br></div><div><div style="font-size:9px;color:#575757">Sent from Samsung Mobile</div></div></div><br><br><div>-------- Original message --------</div><div>From: Tiago Geada <tiago.geada@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@lists.digium.com> </div><div>Subject: Re: [asterisk-users] recording in mp3 </div><div><br></div><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(0,0,102)">no need.<br><br><br>mixmonitor has a argument that is a script ran just as the recording is finished.<br><br>
we use this to move the file from ramfs to final destination.<br><br>you can use it to use sox and convert it...<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 2 July 2014 18:54, Dave Platt <span dir="ltr"><<a href="mailto:dplatt@radagast.org" target="_blank">dplatt@radagast.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
> 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<br>
<br>
</div>If you're up to writing a bit of shell script, and are running<br>
on Linux, you could automate the conversion process so that it<br>
happens as soon as the recording is completed.<br>
<br>
Look at the "inotify" system service (man section 7) and the<br>
"inotifywatch" program.  You can tell inotifywatch to monitor<br>
files being written into a specific directory (or set of<br>
directories) and output a series of events when files in this<br>
directory are open or closed.<br>
<br>
What you'd probably want to do, is catch the "close_write"<br>
events (a file has been closed, and it had been opened in<br>
a mode which allows it to be written).  When you see a<br>
close_write event for a recording file of the sort that<br>
Asterisk writes, you'd check to see if it's been converted<br>
to your desired format yet.  If not, fire off a separate<br>
task (e.g. via "batch") to convert it.<br>
<br>
Here's a very simple script I did to do something like this...<br>
run a periodic-processing script a few seconds after files<br>
with a specific name pattern have been touched in any way.<br>
It's not sophisticated enough to look only for close or<br>
close_wait events, but it should give you the idea.<br>
<br>
#!/bin/bash<br>
<br>
function processevents () {<br>
 action=0<br>
 while true ; do<br>
   if [ $action == 0 ] ; then<br>
       timeout=300<br>
   else<br>
       timeout=5<br>
   fi<br>
   read -t $timeout event<br>
   if [ $? != 0 ] ; then<br>
      action=0<br>
      /data/soundchaser/periodic<br>
   else<br>
      if [[ $event =~ ".wav" || $event =~ ".gotit" ]] ; then<br>
          action=1<br>
      fi<br>
   fi<br>
 done<br>
}<br>
<br>
cd /data/soundchaser<br>
<br>
inotifywait -m /data/soundchaser/public_html/done | processevents<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br></div>
</body>