AMD/WaitforSilence errors on EC2

I have two asterisk systems both on 1.6.2.6. One is on a server at my home, the other is on Amazon EC2. They both have the same code, same SIP provider, they both use the same account on the SIP provider.

AMD and WaitforSilence on the server work fine. AMD detects machine/human in a second or two. WaitForSilence waits as long as I ask.

AMD and WaitForSIlence don’t work on EC2. AMD always returns NOTSURE and takes less than a half second. WaitForSIlence waits less than half a second no matter what input I give it and no matter what sound is on the other end.

Looking through the source code, it seems to me that on EC2 I get:

f->frametype == AST_FRAME_NULL

or something like that. I’m not too familiar with the internals, but clearly, something is wrong.

Anyway, here’s what I see from the console on EC2:

-- AMD: SIP/xxxxxxx 5555555555 (null) (Fmt: 64)
-- AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [3] silenceThreshold [0] maximumWordLength [5000]
-- AMD: Channel [SIP/xxxxxxx]. Changed state to STATE_IN_SILENCE
-- AMD: Channel [SIP/xxxxxxx]. Too long...
-- AMD: Channel [SIP/xxxxxxx]. Too long...

Can anyone help?