maxSilenceSeconds does not work

Hi All,

I use Asterisk for test automation, and I have trouble with recordings. I would like to force Asterisk to record a channel even if it is silence. I use Asterisk ARI from Python for this.

Swagger ARI documentation says there is an option to set maxSilenceSeconds, but it has no any effect. Recording will be stopped after about 3 seconds.

The CLI give a bit of start point why the recording being stopped.

[Feb  4 16:43:30] WARNING[31724]: app.c:1646 __ast_play_and_record: No audio available on SIP/12345678-00000f34??

Could someone help, what am I doing wrong?

What does the request [line] look like? Or what are you setting for maxSilenceSeconds?

I use 30 sec for both maxDurationSeconds and maxSilenceSeconds, see in request:


Specifying any value > 0 for “maxSilenceSeconds” means that after that many seconds of silence the recording will stop. Unless the max duration is met first.

Since you have both 30 seconds for the max silence and duration I wonder if you are hitting the max duration. How long is the typical recording? And what’s the noise duration usually?

Since you don’t want to stop on silence ever then you could set “maxSilenceSeconds” to zero (translates to infinite, or maybe better stated that the record functionality doesn’t attempt to detect silence at all). If you do that does it still stop? If so at what time in seconds from the start does it stop?

I have tried zero also on maxSilenceSeconds, but not working.

My avg recording from 3 sec to 15 sec. Usually I use this to record announcement messages. Some announcement message is 3 second long, some 15. If I have 3 second messages, no more RTP package being sent towards to Asterisk, that is why “No audio available on” message appears on CLI.

When 3 sec announcement being recorded, the recording length usually 6 sec.

Also, if I do an a2b call, and send silence to channel before recording, than maxSilenceSeconds works as expected. But when I am recording announcement, I have no control on leg B to send silence.

Ah, it’s likely that silence detection does not take lack of audio as silence - which is what is causing that behavior. It requires an actual audio stream instead.