[asterisk-users] Asterisk 1.4 Call Recording

Steve Johnson stevej456 at gmail.com
Mon Jan 14 14:20:34 CST 2008


Here's what I would suggest. You should insert some NoOp() statements
and watch the CLI as you dial your 555 extension so that you can see
whether it's working or not.

Your example (which you mentioned you want to run under Asterisk 1.4):
> [test]
> exten => 555,1,SetVar(CALLFILENAME=outgoing/${TIMESTAMP:0:4}/${TIMESTAMP:4:2}/${TIMESTAMP}-${EXTEN})
> exten => 555,2,Monitor(wav,${CALLFILENAME},m)
> exten => 555,3,Dial(IAX2/ics.iax-trunk/${EXTEN})
> exten => 555,4,Hangup()

In Asterisk 1.4 (read the UPGRADE.txt file in the source directory):
- SetVar() has been replaced by Set()
- ${TIMESTAMP} no longer exists.
- (CALLERID usage has changed in 1.4 also).

so you first have to fix that stuff, with something like:


[test]
exten => 555,1,Set(DATETIME=${STRFTIME(${EPOCH},,%C%y-%m%d-%H%M)})
exten => 555,n,NoOp(DATETIME: ${DATETIME})
;
; Tweak the callfilename until you're happy with it...
; Note that the default recording directory is /var/spool/asterisk/monitor
exten => 555,n,Set(CALLFILENAME=${CALLERID(num)}-${DATETIME}-${EXTEN})
exten => 555,n,NoOp(CALLFILENAME: ${CALLFILENAME})
;
exten => s,n,Monitor(wav,${CALLFILENAME},b)
;
; Remove this next line after the determining that you have the filename right
; by checking the console progress...
exten => 555,n,Hangup()
;
exten => 555,n,Dial(IAX2/ics.iax-trunk/${EXTEN})
exten => 555,n,Hangup()


My script assumes that the monitor files are in the default directory,
so adjust it if necessary after you get the above working.  When you
run it, the .mp3 stereo files should be produced.

In a production environment, I'd imagine that you'd want to run the
combine.sh script periodically as a scheduled cron job.

Don't forget to follow the legal standards for call recording in your
jurisdiction (and be nice).

Have fun,
S.


On Jan 14, 2008 12:53 PM, Mike Hammett <asterisk-users at ics-il.net> wrote:
> Does what I have in the dialplan look right or am I way off base with being
> able to use that script?
>
>
> -----
> Mike Hammett
> Intelligent Computing Solutions
> http://www.ics-il.com
>
>
>
> ----- Original Message -----
> From: "Steve Johnson" <stevej456 at gmail.com>
> To: <asterisk-users at ics-il.net>; "Asterisk Users Mailing List -
> Non-Commercial Discussion" <asterisk-users at lists.digium.com>
> Sent: Monday, January 14, 2008 10:51 AM
> Subject: Re: [asterisk-users] Asterisk 1.4 Call Recording
>
>
> > You might take a few ideas from this combine.sh script which works for
> > me.  It uses the combine_wave program from
> > http://panteltje.com/panteltje/dvd/combine_wave-0.3.tgz and the lame
> > program to convert to mp3.
> >
> > It converts the entire directory /var/spool/asterisk/monitor/*-in.wav
> > files to mp3 where the mp3 file doesn't already exist.
> >
> > S.
> >
> >
> > File: combine.sh
> > ---------------------------
> > #!/bin/sh
> >
> > cd /var/spool/asterisk/monitor
> >
> > for f in *-in.wav
> > do
> >        in=$f
> >        out=`echo $f | sed -e 's/-in.wav/-out.wav/'`
> >        tmpwav=`echo $f | sed -e 's/-in.wav/-both.wav/'`
> >        mp3=`echo $f | sed -e 's/-in.wav/.mp3/'`
> >
> >        if [ -e "$mp3" ]
> >        then
> >                continue
> >        fi
> >
> >        # combine the two tracks into one stereo file
> >        /usr/local/bin/combine_wave -l $in -r $out -o $tmpwav 2>/dev/null
> >
> >        /usr/bin/lame --silent -h -b 96 $tmpwav $mp3
> >
> >        # Remove temporary .wav files
> >        test -w $tmpwav && rm $tmpwav
> >
> >        # Remove input files if successful
> >        test -s $mp3 && rm $in $out
> > done
> >
> > exit 0
> >
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list