Recording stereon in Asterisk 21

Dear all,
I want to record stereo recording for all the calls in the Asterisk, two separate channels, meaning that callee and caller on a separate stereo channel in one stereo file, or two separate files each one channel in the same way, how can I do something like that ? Is it with MixMonitor ? Because whatever I am doing I could not get this done, any helpful suggestions of methods I can try?
Regards.

Yes, you use MixMonitor to do call recording. It has various options[1]. If something isn’t working, then you need to be more specific and show what you’ve attempted and describe what actually happens.

[1] MixMonitor - Asterisk Documentation

I have used this config for example, but it is terrible, and just records both channels in one file. I have placed in extensions_custom.conf:

exten => 101,1,Answer()
same => n,Set(CALLFILENAME=${CALLERID(num)}-${UNIQUEID})
same => n,MixMonitor(/var/spool/asterisk/monitor/${CALLFILENAME}-mix.wav,b,
r(/var/spool/asterisk/monitor/${CALLFILENAME}-in.wav),
t(/var/spool/asterisk/monitor/${CALLFILENAME}-out.wav),
V(2), v(-2))
same => n,Dial(SIP/user,30)
same => n,Hangup()
~

On Tuesday 18 February 2025 at 20:47:59, tasbihmr via Asterisk Community
wrote:

I want to record stereo recording for all the calls in the Asterisk, two
separate channels, meaning that callee and caller on a separate stereo
channel in one stereo file, or two separate files each one channel in the
same way, how can I do something like that ? Is it with MixMonitor ?

Yes.

You can use any (or all) of the following options to the MixMonitor
application:

r(file) - Use the specified file to record the receive audio feed. Like with the
basic filename argument, if an absolute path isn’t given, it will create the
file in the configured monitoring directory.

t(file) - Use the specified file to record the transmit audio feed. Like with the
basic filename argument, if an absolute path isn’t given, it will create the
file in the configured monitoring directory.

D - Interleave the audio coming from the channel and the audio coming to the
channel in the output audio as a dual channel stream, rather than mix it.

https://docs.asterisk.org/Latest_API/API_Documentation/Dialplan_Applications/MixMonitor/

Which version of Asterisk are you using?

Antony.


The words “e pluribus unum” on the Great Seal of the United States are from a
poem by Virgil entitled “Moretum”, which is about cheese and garlic salad
dressing.

I have used actually the r and t option with D, there was little change, I just got two files that voice from both the caller and callee was recorded to in both files, I mean I got two files with r and t, but each file gain both the caller and callee in it.

On Tuesday 18 February 2025 at 21:04:29, tasbihmr via Asterisk Community
wrote:

same =>
n,MixMonitor(/var/spool/asterisk/monitor/${CALLFILENAME}-mix.wav,b,
r(/var/spool/asterisk/monitor/${CALLFILENAME}-in.wav),
t(/var/spool/asterisk/monitor/${CALLFILENAME}-out.wav), V(2), v(-2))

There should not be any commas separating the options.

Antony.


Never automate fully anything that does not have a manual override capability.
Never design anything that cannot work under degraded conditions in emergency.

Original question posted at Recording stere on in Asterisk 21 - FreePBX 17 - FreePBX - FreePBX Community Forums after answered here.