Poor quality of asterisk recordings


I’m trying to record the calls on an Asterisk system. A file is created after a call is made, but the quality is very poor. Actually you can’t understand anything. You get only a lot of crackling and noise. Sometimes you understand a couple of words, but nothing more.

I tested this on two versions of Asterisk: 1.2 and 1.4. Also I tested this on a computer with Red Hat and a virtual machine with Debian. I tested it with SIP phones and Skype, I get the same results.

Can anyone tell me what I’m missing?

Please post the relevant parts of your dial plan. This is what I use and what is working fine for me:

exten => s,n, Monitor(gsm,/var/spool/asterisk/monitor/example/${BESTANDSNAAM},b) ; with b recording starts when 2 channels are bridged
exten => s,n, Dial(SIP/3120xxxxxxx/${OUTBOUND},40,t) ; just an example has to be fit for your situation
exten => s,n, Hangup()

exten => h,n,System(soxmix /var/spool/asterisk/monitor/example/${BESTANDSNAAM}-in.gsm /var/spool/asterisk/monitor/example/${BESTANDSNAAM}-out.gsm /var/spool/asterisk/monitor/example/${BESTANDSNAAM}.gsm) ; all on one line
if you want to play back the recording use

exten => s,n,Playback(/var/spool/asterisk/monitor/example/${BESTANDSNAAM})

exten => 123,1,Answer
exten => 123,2,Wait,1
exten => 123,3,Set(MONITOR_EXEC=/usr/src/mt/pbx/soxmixmp3.sh)
exten => 123,4,Set(CALLFILENAME=/usr/src/mt/pbx/a)
exten => 123,5,Monitor(wav|${CALLFILENAME}|mb)
exten => 123,6,Dial(SIP/sly)
exten => 123,7,Hangup

This is the dialplan I’m using.
There is sometthing interesting I’ve noticed today though. I got two files a-in.wav and a-out.wav. a-in.wav has my voice and is ok and a-out.wav has the voice of a friend of mine and it has the cracklings and so on, so it’s bad.
So we exchanged the accounts and my friend called me and we got the same result his voice was crackling.
That would lead me to think his microphone has a problem, but I tested this with another person and it had problems also. I’ll do some more tests…

I think the dialplan is ok, can you confirm?

It looks ok but it depends on what is in the script soxmixmp3.sh. I assume that the script is ok.

just a guess: if your friend has silent surpression enabled on his (soft)phone then that could be the reason for the problem. This is a mechanism to stop dataflow when there is just silent on the line to safe bandwidth. This isn’t suported by asterisk and the result can be a bad sound quality.

Hi. I’m back again.
I have reinstalled the Linux and put the latest version of Asterisk.
Things have improved a bit but not totally. The recordings are now good when talking between two SIP phones, but I have a problem somewhere else.
I’m trying to record a conference. For example two people talk on the phone and one of them puts the asterisk server in conference with them. The server should only record the conference. I get a crackling recording.

exten => s,1,Set(CALLERID(num) = ${SKYPE_PHONE_HOME})
exten => s,n,Set(CALLERID(name)= ${SKYPE_FULLNAME})
;exten => s,n,Monitor(wav|/usr/src/clrmt/pbx/a|m)
exten => s,n,Record(/usr/src/clrmt/pbx/a.wav)
exten => s,n,Answer
exten => s,n,Echo
exten => s,n,Hangup

exten => s,1,VoiceMail(1@mailboxsly)

I used both the contexts above. If you call from a single phone, for both contexts, the recordings are good. When I try to record a conference things get bad. Any suggestions?

Can anyone tell me if what I’m trying to do is possible with Asterisk?
So what I want is this:

  1. User A talks to user B
  2. User A makes a conference with user B and an Asterisk server on a dialplan which simply records the conversation (Answer,Monitor)

The recordings that I get have only the voice of user A clear, user B is not understandable. I’m using a PIKA board and made tests:
user A -mobile phone <-> user B -Skype
user A -mobile phone <-> user B -mobile phone
The results were the same.

Can anyone tell if it’s configuration error or a bug?
Thanks! :wink: