<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Answer for the question number 1:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Use it:</FONT></DIV>
<DIV><FONT size=2>exten=XXXX,1,Macro(ramais-gravados,SIP/${EXTEN})</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT
size=2>[macro-ramais-gravados]<BR>exten=s,1,SetVar(CALLFILENAME=i${CALLERIDNUM}-${TIMESTAMP})<BR>exten=s,2,Monitor(wav,${CALLFILENAME},m)<BR>exten=s,3,Dial(${ARG1},20,Ttr)
<BR>exten=s,4,Hangup</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>This script was changed</FONT></DIV>
<DIV><FONT size=2>2wav2mp3 </FONT></DIV>
<DIV><FONT size=2>#!/bin/sh<BR># create stereo mp3 out of two mono
wav-files<BR># source files will be deleted<BR>#<BR># 2005 05 23 dietmar
zlabinger <A
href="http://www.zlabinger.at/asterisk">http://www.zlabinger.at/asterisk</A><BR>#<BR>#
usage: 2wav2mp3 <wave1> <wave2> <mp3><BR># designed for
Asterisk Monitor(file,format,option) where option is "e" and<BR># the variable
<BR># MONITOR_EXEC/usr/bin/2wav2mp3</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV><FONT size=2>
<DIV><BR># location of SOX and SOXMIX<BR># (set according to your system
settings, eg. /usr/bin)<BR>SOX=/usr/bin/sox<BR>SOXMIX=/usr/bin/soxmix<BR>#lame
is only required when sox does not support liblame<BR>LAME=/usr/bin/lame</DIV>
<DIV> </DIV>
<DIV><BR># command line variables<BR>LEFT="$1"<BR>RIGHT="$2"<BR>OUT="$3"</DIV>
<DIV> </DIV>
<DIV>#test if input files exist<BR>test ! -r $LEFT && exit<BR>test ! -r
$RIGHT && exit</DIV>
<DIV> </DIV>
<DIV># convert mono to stereo, adjust balance to -1/1<BR># left channel<BR>$SOX
-c 1 $LEFT $LEFT-tmp.wav pan -1<BR># right channel<BR>$SOX -c 1 $RIGHT
$RIGHT-tmp.wav pan 1</DIV>
<DIV> </DIV>
<DIV># combine and compress<BR># this requires sox to be built with
mp3-support.<BR># To see if there is support for
Mp3 run sox -h and <BR># look for it under the list of supported file
formats as "mp3".<BR># $SOXMIX -v 1 $LEFT-tmp.wav -v 1 $RIGHT-tmp.wav -v 1
$OUT.mp3</DIV>
<DIV> </DIV>
<DIV># in case and old version of sox is used, the lame-encoding<BR># can be
done afterwards<BR>$SOXMIX -v 0.5 $LEFT-tmp.wav $RIGHT-tmp.wav $OUT</DIV>
<DIV> </DIV>
<DIV>echo $OUT > final.dat<BR>FINAL=`cat final.dat | sed 's/wav/mp3/g'`</DIV>
<DIV> </DIV>
<DIV>$LAME --silent -V7 -B24 --tt $OUT --add-id3v2 $OUT $FINAL</DIV>
<DIV> </DIV>
<DIV>#remove temporary files<BR>test -w $LEFT-tmp.wav && rm
$LEFT-tmp.wav<BR>test -w $RIGHT-tmp.wav && rm $RIGHT-tmp.wav<BR>test -w
$OUT && rm $OUT</DIV>
<DIV> </DIV>
<DIV>#remove input files if successfull<BR>#test -r $OUT.mp3 && rm $LEFT
$RIGHT<BR>test -r $FINAL && rm $LEFT $RIGHT<BR>rm -f final.dat</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV>
<DIV><FONT size=2></FONT><BR><FONT face="Arial, Helvetica, sans-serif" size=2>
<P><B>Darlon Ferreira Bortolini</B><BR>Rede/Desenvolvimento<BR>Betha
Sistemas<BR>Fone (48) 3431-0750/Ramal 1000<BR><BR></FONT>----- Original Message
----- </P></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=g.delduca@webster.it
href="mailto:g.delduca@webster.it">g.delduca@webster.it</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=asterisk-users@lists.digium.com
href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, February 10, 2006 7:13
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Asterisk-Users] 2wav2mp3,
monitor, mixmonitor, mpg123, queues</DIV>
<DIV><FONT size=2></FONT><BR></DIV>Hello!<BR>I'm using Asterisk for our office
telephony, but we have some problems<BR>that still we can't resolve about it.
Here they are:<BR><BR>1) merge in/out call recording files<BR><BR>I also tried
to use a script I found on the internet, called 2wav2mp3<BR>In extensions.conf
I added the following lines<BR><BR>; script to be executed when monitoring has
been finished<BR>MONITOR_EXEC=/usr/local/bin/2wav2mp3<BR><BR>exten =>
102,1,SetVar(CALLFILENAME=${TIMESTAMP}-${EXTEN}-${CALLERID})<BR>exten =>
102,2,Monitor(wav,${CALLFILENAME},m)<BR>;exten =>
102,2,MixMonitor(${CALLFILENAME}.gsm)<BR>;exten =>
102,2,MixMonitor(test.wav,W(-3))<BR>exten => 102,3,Ringing<BR>exten =>
102,4,Dial(Sip/giuseppedd,20,rtwW)<BR><BR>...but I always get two separate
files.<BR><BR>As you can see I also tried the MixMonitor application but the
resulting <BR>files<BR>contain one channel that is clearly audible and the
other seems to be noise.<BR><BR>2) an alternative to mpg123 becouse it
generates a lot of errors like this:<BR><BR>Feb 3 19:50:08
WARNING[9568]: res_musiconhold.c:488 monmp3thread: <BR>Unable to spawn
mp3player<BR>Feb 3 19:58:28 NOTICE[9568]: res_musiconhold.c:507
monmp3thread: <BR>Request to schedule in the past?!?!<BR>Feb 3 19:58:28
WARNING[9568]: res_musiconhold.c:421 spawn_mp3: Found no <BR>files in
'/usr/share/asterisk/mohagents'<BR><BR><BR>3) how to play different files to
an agent before he picks up a call <BR>depending on which queue the call comes
from<BR><BR>[qlu500]<BR>musiconhold = qlu500<BR>announce =
vm-from-phonenumber ; <<<---- here is the problem<BR>context =
qlu500out<BR>wrapuptime=15<BR>announce-frequency =
60<BR>...<BR><BR><BR>Comments or suggestions are greatly
appreciated.<BR><BR>Thanks a
lot.<BR><BR>Giuseppe<BR><BR>_______________________________________________<BR>--Bandwidth
and Colocation provided by Easynews.com --<BR><BR>Asterisk-Users mailing
list<BR>To UNSUBSCRIBE or update options visit:<BR> <A
href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</A><BR><BR><BR></BLOCKQUOTE></BODY></HTML>