Trying to fix the warning: "app_voicemail.c: maxsilence should be less than minsecs"

Hi,

I’ve been using Freepbx (raspbx) for some time now, with a small home setup.

I’m trying to learn more and I’m using the logs as a tool to find out what I’m doing wrong or right. I also use the logs to correct my errors or improve my configuration.


I recently started trying to understand some warnings and errors. I found this Warning::

WARNING[5506] app_voicemail.c: maxsilence should be less than minsecs or you may get empty messages

Note: I’m using 10 milliseconds for maxsilence and 3 seconds for minsecs.
Asterisk 16.11.1. FreePBX 15.0.16.73.


I know it’s just a warning and there are some comments on it, but I found some strange things in my research that can help to find out what’s going on.

I found these comments:

dicko wrote:

http://asterisk-service.com/downloads/Asterisk-%20The%20Definitive%20Guide,%204th%20Edition.pdf
page 187

and Andrew Nagy wrote:

“maxsilence” is in milliseconds.


Well, it is. But not everywhere.


In /main/app.c, says maxsilence is in milliseconds [comment at line 1537].

In app_voicemail.c [lines 13603 to 13607]: the code retrieves the configured value for maxsilence, convert it to an integer, verify if it’s greater than zero. If it’s greater, multiply it by 1000.

I don’t know what is the expected unit here, but:

Case1 (ms): if I enter maxsilence=10 milliseconds. It will become 10000ms (10s).
Case2 (s): if I enter maxsilence=10 seconds. It will become 10000s.

Later, in the same file [lines 13806 to 13814] maxsilence is divided by 1000. This means:

Case1 (ms): maxsilence/1000 = 10000ms/1000 = 10ms (0.01s)
Case2 (s): maxsilence/1000 = 10000s/1000 = 10s


But the most important: there are no Case1 or Case2, just numbers without units.
The expression on line 13809 is comparing numbers only (there are no units, so the code cannot know which value means second, which means milliseconds).

So:
(maxsilence / 1000 >= vmminsecs) becomes (10000 / 1000 >= 3), and then (10 >= 3).

10 is greater than 3. This returns true and shows the warning, but 10ms is smaller than 3s. This should return false (and no warnings).

Another file, “voicemail.conf.sample” shows:

[57] ; How many seconds of silence before we end the recording`
[58] maxsilence=10


Doubts:

  • minsecs should be read in milliseconds too?
  • maxsilence should be read in seconds?
  • Is there any confusion between app.c, app_voicemail.c and voicemail.conf regarding maxsilence in seconds or milliseconds?
  • Should I use seconds or milliseconds?
1 Like

I suggest you be pragmatic here and ignore that warning , there is a disconnect between that warning and other code in Asterisk (as you have noticed), It works just fine as it is in shown in the GUI

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.