+1 Dale<div>Alternatively I'd troubles using the MixMonitor() command execution, so what I did is used System(my commands here) just after the StopMixMonitor().</div><div>Using StopMixMonitor() is always recommended to guarantee save the recorded file and using any commands via System() is easy.</div>
<div><br><div class="gmail_quote">On Wed, Sep 21, 2011 at 6:57 AM, Dale Noll <span dir="ltr"><<a href="mailto:dnoll@wi.rr.com">dnoll@wi.rr.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div text="#000000" bgcolor="#ffffff">
I am not real familiar with the size of MixMonitor parameters, but
just looking at the output, I would suggest you change the logic to
call a script with a single argument.<br>
something like this,<br>
<br>
MixMonitor(${FILENAME},bW(2),/usr/local/bin/convert_to_mp3
^{FILENAME})<br>
<br>
--- /usr/local/bin/convert_to_mp3 --<br>
#!/bin/bash<br>
<br>
WAV=$1<br>
MP3=$(echo $1 | sed 's/\.wav$/.mp3/')<br>
<span style="font-family:"Courier New"">/usr/bin/lame
"${WAV}" "${MP3}" </span><span style="font-family:"Courier New"">-b 16 -s 9.6 -m m --bitwidth 8 --lowpass 9.6
--resample 8 --lowpass-width 1 && rm -f "${WAV}"<br>
<br>
--- end of script ---<br>
Set the permissions so it is executable by the asterisk owner.<br>
<br>
Note: This has not been tested and is intended as a starting
point.<br>
<br>
<br>
</span>Dale<div><div></div><div class="h5"><br>
<br>
<br>
On 09/20/2011 07:53 PM, Ikka - Mitra Kreasindo wrote:
<blockquote type="cite">
<div>
<p class="MsoNormal"><span style="color:rgb(31, 73, 125)">Is
anyone can help me with this ? I’m really desperate…<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31, 73, 125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31, 73, 125)">Thx
in ad.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31, 73, 125)"><u></u> <u></u></span></p>
<div>
<div style="border-right:medium none;border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10pt">From:</span></b><span style="font-size:10pt">
<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>
[<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">mailto:asterisk-users-bounces@lists.digium.com</a>] <b>On
Behalf Of </b>Ikka - Mitra Kreasindo<br>
<b>Sent:</b> Wednesday, September 14, 2011 5:02 PM<br>
<b>To:</b> 'Asterisk Users Mailing List - Non-Commercial
Discussion'<br>
<b>Subject:</b> [asterisk-users] Mixmonitor command
parameter problem on Asterisk 1.8.4<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dear all…<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m using MixMonitor command in my
dialplan, and I used the “command” parameter to execute some
thing after recording the file.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I used the command parameter to convert the
wav file that created earlier to MP3 and than deleted the WAV
file.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It worked fine with asterisk 1.4.21.2. and
1.6x<u></u><u></u></p>
<p class="MsoNormal">But than I have a new asterisk server with
asterisk 1.8.4. The command parameter doesn’t work. It’s
trimed for about 297 character only. The rest was gone. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This is part of the log with Asterisk
1.4.21.2<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> -- Executing [08129981925@speedy:7]
MixMonitor("SIP/10001-b7d71bd0",
"/var/spool/asterisk/recording/speedy/2011/09/14/-08129981925-Ikka_Testing-10001-20110914-163803.wav|bW(2)|/usr/bin/lame
"/var/spool/asterisk/recording/speedy/2011/09/14/-08129981925-Ikka_Testing-10001-20110914-163803.wav"
"/var/spool/asterisk/recording/speedy/2011/09/14/-08129981925-Ikka_Testing-10001-20110914-163803.mp3"
-b 16 -s 9.6 -m m --bitwidth 8 --lowpass 9.6 --resample 8
--lowpass-width 1 && rm -f
"/var/spool/asterisk/recording/speedy/2011/09/14/-08129981925-Ikka_Testing-10001-20110914-163803.wav"")
in new stack<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This is part of the log with Asterisk 1.8.4<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> -- Executing [08129981925@speedy:7]
MixMonitor("SIP/10001-0000001a",
"/var/spool/asterisk/recording/speedy/2011/09/14/ACCOUNT-08129981925-Admin_IT-10001-20110914-165248.wav,bW(2),/usr/bin/lame
"/var/spool/asterisk/recording/speedy/2011/09/14/ACCOUNT-08129981925-Admin_IT-10001-20110914-165248.wav"
"/var/spool/asterisk") in new stack<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">As you can see, with 1.8.4 the command
paramater is trimed… <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there some changes / bug with MixMonitor
in Asterisk 1.8.4 ? Is there a quick workaround for this
problem ? <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<br>
</div>
<pre><fieldset></fieldset>
</pre>
</blockquote>
<br>
</div></div><font color="#888888"><pre cols="72">--
"The truth speaks for itself. I'm just the messenger."
Lyta Alexander - Babylon 5
</pre>
</font></div>
<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></blockquote></div><br></div>