AMD Detects Machine (Too Long) on Every Call

I’m running Asterisk and trying to get my AMD working correctly. The problem I’m having is that every time I place a call, it detects as ‘Too Long’ regardless if Voicemail or Human (short hello) picks up (in fact, the Too Long is reported the moment the phone is answered).

– Executing [s@connected:2] AMD(“Local/outCall@dialer-6fa6,1”, “”) in new stack
– AMD: Local/outCall@dialer-6fa6,1 (null) (Fmt: 64)
– AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [300] totalAnalysisTime [4000] minimumWordLength [120] betweenWordsSilence [50] maximumNumberOfWords [5] silenceThreshold [256]
– AMD: Changed state to STATE_IN_SILENCE
– AMD: Channel [Local/outCall@dialer-6fa6,1]. Too long…
– AMD: Channel [Local/outCall@dialer-6fa6,1]. Too long…

I applied a patch which I thought would correct the issue as detailed here: - the patch applies with no problem, but the issue of not detecting a human voice continues.

Any thoughts would be greatly appreciated.

To start, lets verify your server is getting audio to/from your provider. Can you make and receive calls with two-way audio to/from your provider?

Wow, very interesting. This system has been working fine (before I upgraded to the 1.4.21 version yesterday which is when I started testing the AMD). If I call in, I have two way audio, but if I place a call to the outside I have no audio.

So, there’s my problem. Now I just have to figure out why it’s doing this.

Any thoughts?

What version of asterisk did you upgrade from?

It could either be nat issues or firewall issues. Was the server rebooted and possibly lost the firewall rules you set initially at a time when it worked?

I upgraded from 1.4.13. I figured out that my linux box did drop the open ports (don’t know why, they’ve been been set for months, including reboots). I now have full two way audio on both incoming and outgoing calls.

Unfortunately, AMD still detects as ‘Too Long’ on every call. My scripts run as expected if I REM out the AMD line.

Try adding a Playback(silence/1) right before the AMD() command to see if that helps.

Thanks, davevg. The Playback suggestion has stopped every call from being detected as Machine or Too Long but some of my test calls that are human are still being detected as machine. Hopefully I can tweak the amd.conf settings to get a better detection rate.

Thanks again!

Before adding the playback, did you answer the call prior to calling AMD?

No, I did not. AMD doesn’t run until the called party answers.

Replace Playback with Answer() and see if that helps. Playback will answer a channel if it is already not answered.

I replaced playback with answer and now it’s going straight back to ‘Too Long’…my ‘hello’ is echoed back to my called phone (I probably should have mentioned this earlier). The Playback silence command alleviated the echo.

The Playback is allowing AMD to function most of the time now. Almost every call to my cell phone is properly detected as either human/machine. Calls to my home home (VoIP through my cable provider) is detected as machine if I say hello once. It detects as human if I say hello twice.

Is there a way to set the Playback silence to only 1/2 second? I tried .5 vs 1 and that didn’t work at all.

You’d just need to record a file with that duration. Using something like audacity you could make a copy of the file and truncate it down to the duration you want. Or you could truncate it using sox with the trim option.

Thanks for your suggestion…I’ll give it a try.

If you can’t figure it out, send me a PM with your email address and I’ll send one over to you.

I created a blank sound file with 1/2 second of silence, this is giving me a lot better ratio of catching human vs machine when testing calls to my home phone.

Thanks for the help!

Thanks!!! It solved my night today. It is working for me with the playback of 1.gsm before the AMD()

The subject is very old but I am having a similar problem.
I am using Asterisk 16.12.0
AMD has a detection time of at least 4 seconds in almost every call. this time causes the other person to wait too long and hang up the phone. Changing the parameters of AMD does not help. I added a Playback (silence / 1) or Background (silence / 1) before the AMD (). That didn’t work either. What can I do about it. I am waiting for your suggestions. Thank you.