Faraj Khasib
2012-Jan-25 15:29 UTC
[asterisk-users] Executing Script after MixMonitor is called
Hello Guys, I am trying to convert files that are .wac to mp3 after mixmonitor command is called but it doesnt execute the command, I tried the command in terminal it worked, any help please ... below is my dial plan exten=6500,n,Set(MIXMONITOR_EXEC=&& nice -n 19 /usr/local/bin/lame -b 8 -t -F -m m --bitwidth 8 --quiet "/var/spool/asterisk/monitor/${CALLFILENAME}.wav" "/var/spool/asterisk/monitor/${CALLFILENAME}.mp3" && rm -f "/var/spool/asterisk/monitor/${CALLFILENAME}.wav") exten=6500,n,MixMonitor(${CALLFILENAME}.wav,b)
David Backeberg
2012-Jan-27 00:18 UTC
[asterisk-users] Executing Script after MixMonitor is called
On Wed, Jan 25, 2012 at 10:29 AM, Faraj Khasib <fkhasib at iconnecths.com> wrote:> Hello Guys, > I am trying to convert files that are .wac to mp3 after mixmonitor command is called but it doesnt execute the command, I tried the command in terminal it worked, any help please ... below is my dial plan > exten=6500,n,Set(MIXMONITOR_EXEC=&& nice -n 19 /usr/local/bin/lame -b 8 -t -F -m m --bitwidth 8 --quiet "/var/spool/asterisk/monitor/${CALLFILENAME}.wav" "/var/spool/asterisk/monitor/${CALLFILENAME}.mp3" && rm -f "/var/spool/asterisk/monitor/${CALLFILENAME}.wav") > exten=6500,n,MixMonitor(${CALLFILENAME}.wav,b)One obvious thing to try is to make sure that when you're making your shell test that you are running the shell as the same user that asterisk is running as. Set your console to at least verbose = 3, and run the dialplan. What do you get for the error? I will say just looking at that code, you have a mess. It would be simpler to debug if you made a short shell script that consisted of something like shebang /path/to/bash PATH=$1 lame --arguments $1.wav $1.mp3 if [ -f {$1}.mp3 ] ; then rm {$1}.wav and then call that script with the argument that is the path to the file. Will make your dialplan easier to debug, and still get you the equivalent functionality.
Jeremy Kister
2012-Jan-27 05:34 UTC
[asterisk-users] Executing Script after MixMonitor is called
On 1/25/2012 10:29 AM, Faraj Khasib wrote:> I am trying to convert files that are .wac to mp3 after mixmonitor> command is called but it doesnt execute the command, I tried the> command in terminal it worked, any help please ... below is my dial> plan what version of asterisk are you using ? if it's an older version of 1.8 (< 1.8.4) and you're also recording the call, you may be encountering a known bug. https://issues.asterisk.org/jira/browse/ASTERISK-17346 -- Jeremy Kister http://jeremy.kister.net./
Satish Barot
2012-Jan-27 05:59 UTC
[asterisk-users] Executing Script after MixMonitor is called
This is how I use a wav to mp3 script on Mixmonitor in my dialplan (Asterisk 1.8.7.0). ... same => n,MixMonitor(${FILENAME},W(4),/var/spool/asterisk/wav2mp3 ^{FILENAME}) ... and my script is... #!/bin/bash WAV="/var/spool/asterisk/monitor/$1" MP3=$(echo $1 | sed 's/\.wav$/.mp3/') MP3DEST="/var/spool/asterisk/mp3/$MP3" /usr/bin/lame "${WAV}" "${MP3DEST}" --silent -b 16 -s 9.6 -m m --bitwidth 8 --lowpass 9.6 --resample 8 --lowpass-width 1 --SATISH BAROT Ahmedabad,India. On Wed, Jan 25, 2012 at 8:59 PM, Faraj Khasib <fkhasib at iconnecths.com>wrote:> Hello Guys, > I am trying to convert files that are .wac to mp3 after mixmonitor command > is called but it doesnt execute the command, I tried the command in > terminal it worked, any help please ... below is my dial plan > exten=6500,n,Set(MIXMONITOR_EXEC=&& nice -n 19 /usr/local/bin/lame -b 8 -t > -F -m m --bitwidth 8 --quiet > "/var/spool/asterisk/monitor/${CALLFILENAME}.wav" > "/var/spool/asterisk/monitor/${CALLFILENAME}.mp3" && rm -f > "/var/spool/asterisk/monitor/${CALLFILENAME}.wav") > exten=6500,n,MixMonitor(${CALLFILENAME}.wav,b) > > -- > _____________________________________________________________________ > -- 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/20120127/a8bce9da/attachment.htm>