Recording calls with Asterisk
March 4th, 2011 | Last modified: November 8th, 2011Here’s how you can record calls to mp3 files with Asterisk.
Insert these to extensions.conf:
1 2 3 4 5 6 7 8 9 | [globals] MONITOR_EXEC=/usr/local/bin/asterisk-wav2mp3 [macro-record] exten => s,1,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${MACRO_CONTEXT}-${DIALEDPEERNUMBER}) exten => s,n,Set(POSTFIX=$["${CALLFILENAME}" =~ "\/([0-9a-zA-Z#_\-]+)$"]) exten => s,n,Set(CALLFILENAME=$["${CALLFILENAME}" : "([0-9a-zA-Z#_\-]+)"]${IF($[${LEN(${POSTFIX})}=0]?: _${POSTFIX})}) exten => s,n,Monitor(wav,${CALLFILENAME},m) |
Recording start example:
exten => 555,1,Dial(SIP/1234,,M(record))
The script asterisk-wav2mp3 can be downloaded here. Make sure it’s runnable (chmod +x asterisk-wav2mp3). This script creates a stereo mp3 out of two mono wav files. You’ll need SOX and Lame encoder for this to work.
RSS feed for comments
Trackback URL
Trackback URL
4 Comments »
Trackback responses to this post
About me
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with.
... »
Hey Nonoo!
Thanks for the description! But my upgraded SOX not include mp3 codec and I can’t start converting wav record. How can I fix this issue?
Thx, Victor
Koszi a leirasert! A SOX nekem nem tartalmaz mp3 codecet es nem kezdi el atkonvertalni. Jelenleg van ket feloldalas wav fileom. Hogy tudnam kijavitani a SOX codecet? Mar a legfrisseb van fent.
Koszi, Victor
You have to recompile SOX from sources.
Still not working.
I figured out, Thanks!