Recording Calls - weird problem - FreePBX 2.7.0.1

Hello community!
I have a strange problem with recording a calls in Asterisk.
I have a FreePBX 2.7.0.1 with newest patches. All extensions are set to record on-demand. And they record a calls, incoming and outgoing (by pressing *1). So what is the problem? The call has for example 10 seconds - the record has 20 :slight_smile:
First 10 seconds are recorded with the voice of calling person.
Second 10 seconds are recorded with the voice of called person.
I dont know that this is the standard work of the asterisk or a mistake during the installation/configuration.
I want to hear all the conversation in one time, as in normal recording.
Is any chance to do this?
Thank you in advance.

Check your version of sox, update it if possible.

I have the latest version:

I have also a newest version of mpg123 installed…

That is not the latest version:
http://sox.sourceforge.net/
SoX 14.3.0 was released on June 21, '09

We have had reports that installing this version solves some problems with lagging and such.

./configure
make
make install

sox -h

Now I have SoX 14.3.0 and exactly this same problem. Still without success…
I dont know that you have fully understand me - my english is very poor. When my call is a 10 seconds long, then the recording is 20 seconds long - first 10 seconds for the voice of person, which i have spoen to and next 10 seconds for my voice. I heare voice from the other person phone, and then from my phone. I can’t hear a full conversation. :frowning:

Bump
Please, someone help?

Edit:
I found something like this:

[quote]always records both sides of the conversation - but stores them
in

separate files in
/var/spool/asterisk/monitor/. You need to combine the “in” and
"out"

parts

using soxmix.

Iain[/quote]

So, this is normal behavior, that recording is stored in two files? Voice Out and voice In?
How can I use soxmix (if use?) to merge those files?
Thank you…

I never tried that, but I think that actually is a good feature to separate calling and called, since you can combine them in the stero channels. One on the left and one on the right, when you play, you get the conversation feeling.

unfortunately I don’t know what is happening on your system. However, it is not normal behavior for most FreePBX installs. They should be mixed.

So how can I fix this?

I am having the same problem. To me it looks like it is a problem with the sox version. My version does not support the -m option so sox just concatenates the in the out recordings rather than mixing them (which accounts for the double length recordings)

DEBUG[6228] res_monitor.c: monitor executing ( nice -n 19 sox -m “/var/spool/asterisk/monitor/auto-1271974098-6046813030-96046492744-in.wav” “/var/spool/asterisk/monitor/auto-1271974098-6046813030-96046492744-out.wav” “/var/spool/asterisk/monitor/auto-1271974098-6046813030-96046492744.wav” && rm -f “/var/spool/asterisk/monitor/auto-1271974098-6046813030-96046492744-”* ) &

I too am having the same issue. The CALLED extensions audio is first in the file, and the CALLING ext audio is last! They are not mixed, just concatenated into one file.

I cannot seem to find where sox (and it seems it should NOW be soxmix) is being called, so I can change the command. I am assuming it’s a script somewhere, but if not, it’s in the source and has been compiled somewhere.

Had the problems with sox 12.X, still having it with sox 14.3.0. Anyone?

Try putting the following line in /etc/asterisk/globals_custom.conf:

MONITOR_EXEC=soxmix

I have been having this exact issue. When recording on-demand the ‘in’ and ‘out’ audio streams are concatenated rather than mixed. Clearly this results in an audio file twice as long with one stream followed by the other. This does not occur with the recordings made as a result of the “always record” option.

The workaround Kouri suggests by adding “MONITOR_EXEC=soxmix” to globals_custom.conf fixes the issue with the audio streams now being correctly mixed in to an audio file of the right length.

However… as we’re now overriding the default recording behaviour of the Monitor application the ‘in’ and ‘out’ audio files are not being removed after mixing:

pwd

/var/spool/asterisk/monitor

ls -lt

-rw-rw---- 1 asterisk asterisk 204524 Jul 18 03:21 auto-1279419671-102-101-in.wav
-rw-rw---- 1 asterisk asterisk 201324 Jul 18 03:21 auto-1279419671-102-101-out.wav
-rw-rw---- 1 asterisk asterisk 204524 Jul 18 03:21 auto-1279419671-102-101.wav

I know the suggested way around this is to write your own application to deal with this (or maybe have a cron job running each night which might break recordings in progress), but really doesn’t the whole requirement for this workaround constitute a bug? I am using asterisknow 1.7, mysql for cdr, and all the updates applied to freepbx.

Will post over at asterisknow forum and see what they say too.

Change your globals_custom.conf to point to a simple shell script:
MONITOR_EXEC=/var/lib/asterisk/bin/soxmix.sh

Where soxmix.sh is:

#!/bin/sh
nice -n 19 soxmix $1 $2 $3
if [ -s $3 ]
then
 rm -f $1
 rm -f $2
fi

Thanks Kouri. This works well.

I am facing same problem after the upgradation.
But calls totally not recording. I updated the SOX version.
but still there is no success.
Please help on this, I need this future activate in my office.