|
Answer for the question number 1:
Use it:
exten=XXXX,1,Macro(ramais-gravados,SIP/${EXTEN})
[macro-ramais-gravados]
exten=s,1,SetVar(CALLFILENAME=i${CALLERIDNUM}-${TIMESTAMP}) exten=s,2,Monitor(wav,${CALLFILENAME},m) exten=s,3,Dial(${ARG1},20,Ttr) exten=s,4,Hangup This script was changed
2wav2mp3
#!/bin/sh
# create stereo mp3 out of two mono wav-files # source files will be deleted # # 2005 05 23 dietmar zlabinger http://www.zlabinger.at/asterisk # # usage: 2wav2mp3 <wave1> <wave2> <mp3> # designed for Asterisk Monitor(file,format,option) where option is "e" and # the variable # MONITOR_EXEC/usr/bin/2wav2mp3 # location of SOX and SOXMIX # (set according to your system settings, eg. /usr/bin) SOX=/usr/bin/sox SOXMIX=/usr/bin/soxmix #lame is only required when sox does not support liblame LAME=/usr/bin/lame # command line variables LEFT="$1" RIGHT="$2" OUT="$3" #test if input files exist
test ! -r $LEFT && exit test ! -r $RIGHT && exit # convert mono to stereo, adjust balance to -1/1
# left channel $SOX -c 1 $LEFT $LEFT-tmp.wav pan -1 # right channel $SOX -c 1 $RIGHT $RIGHT-tmp.wav pan 1 # combine and compress
# this requires sox to be built with mp3-support. # To see if there is support for Mp3 run sox -h and # look for it under the list of supported file formats as "mp3". # $SOXMIX -v 1 $LEFT-tmp.wav -v 1 $RIGHT-tmp.wav -v 1 $OUT.mp3 # in case and old version of sox is used, the lame-encoding
# can be done afterwards $SOXMIX -v 0.5 $LEFT-tmp.wav $RIGHT-tmp.wav $OUT echo $OUT > final.dat
FINAL=`cat final.dat | sed 's/wav/mp3/g'` $LAME --silent -V7 -B24 --tt $OUT --add-id3v2 $OUT $FINAL
#remove temporary files
test -w $LEFT-tmp.wav && rm $LEFT-tmp.wav test -w $RIGHT-tmp.wav && rm $RIGHT-tmp.wav test -w $OUT && rm $OUT #remove input files if successfull
#test -r $OUT.mp3 && rm $LEFT $RIGHT test -r $FINAL && rm $LEFT $RIGHT rm -f final.dat Darlon Ferreira Bortolini
|
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
