[asterisk-users] recording in mp3

Dmitiy Serov serov.d.p at gmail.com
Fri Jul 4 00:07:30 CDT 2014


converting wav to mp3

[sub-Monitor-Init]
exten => s,1,NoOp(Monitor Init)
exten => s,n,Set(_X-SRC_CHANNEL=${CHANNEL})
exten => 
s,n,Set(recMonitorFName=${STRFTIME(${EPOCH},,%Y_%m_%d)}/${STRFTIME(${EPOCH},,%Y_%m_%d_%H_%M_%S)}-${FILTER(0-9a-zA-Z,${ARG1})}-${FILTER(0-9a-zA-Z,${ARG2})})
exten => s,n,Set(CDR(record_file)=${recMonitorFName})
exten => s,n(exit),Return

[sub-Monitor]
exten => s,1,NoOp(Start recording)
exten => s,n,NoOp(audioreadformat: ${CHANNEL(audioreadformat)}, 
audionativeformat: ${CHANNEL(audionativeformat)}, audiowriteformat: 
${CHANNEL(audiowriteformat)})
exten => s,n,GotoIf($["${ARG1}" = ""]?exit)
exten => s,n,Set(LOCAL(fName)=/var/www/asterisk_records/${ARG1})
exten => s,n,MixMonitor(${fname}.wav,b,/usr/local/bin/sox -q -r 8000 -c 
1 ${fname}.wav ${fname}.mp3 && ${notifyCallEnded} ${ARG2})
exten => s,n(exit),Return(CONTINUE)

exten => 
s,n,GoSub(sub-Monitor-Init,s,1(${CALLERID(num)},${EXTEN},${agi_call_server}))
exten => 
s,n,Dial(SIP/server/${EXTEN},60,U(sub-Monitor,${recMonitorFName},${CDR(uniqueid)}))


04.07.2014 8:50, tirveni yadav пишет:
> On Tue, Jul 1, 2014 at 9:39 PM, binary <dreamer.binary at gmail.com> wrote:
>> i would go for recording into wav.
>> then at regular intervals eg every night at 01:00 i would start a script to convert the wav to mp3 and then delete the wav files.
>> it is really easy.
>>
>>
> This method works for us too.
>
> We get around 40 GB of recordings (wav) in around nine hours in a day.
> Which is converted to mp3 in night and moved to a NAS through a Perl
> script.
>
> Perl program merges all -in and -out wav files using sox, then convers
>   to MP3 using twolame.
>
>




More information about the asterisk-users mailing list