Voicemail maxsilence Must Be Less Than minsecs
Voicemail maxsilence Must Be Less Than minsecs
Asterisk can warn during app_voicemail configuration:
maxsilence should be less than minsecs or you may get empty messages
The rule is simple, but satisfying the warning does not automatically produce a caller-friendly recording policy.
On this page
What the settings measure
Both settings belong in the [general] section of voicemail.conf:
minsecsis the minimum total message duration Asterisk will retain. A shorter recording is discarded.maxsilenceis the continuous interval of detected silence that ends a recording. Set it to0to disable silence detection.silencethresholdcontrols which audio level Asterisk considers silence. A lower threshold is more sensitive to quiet audio and background conditions.
A recording stopped by silence can contain speech followed by the silent interval. Its total duration is not necessarily equal to maxsilence.
Why Asterisk warns
When silence detection is enabled, Asterisk requires:
maxsilence < minsecs
The validation protects against configurations that can create or retain effectively empty messages. It is a configuration constraint, not a promise that every value satisfying it will sound natural to callers.
Safest general baseline
For a new system, disable silence detection until you have tested real calls:
[general]
minsecs = 3
maxsilence = 0
silencethreshold = 128
This discards recordings shorter than three seconds but does not stop callers merely because they pause. Asterisk still enforces maxsecs as the maximum recording length.
Enabling silence detection
If abandoned calls or open lines are a meaningful problem, enable silence detection with a value lower than minsecs:
[general]
minsecs = 6
maxsilence = 4
silencethreshold = 128
Treat these as test values, not universal defaults. Four seconds may be appropriate for one caller population and too short for another. Increasing minsecs also discards more legitimate short messages. Test both ordinary messages and callers who pause while speaking.
Avoid an aggressive value such as maxsilence = 2 as a general recommendation. A normal pause, noisy codecA coder-decoder that compresses audio for transmission, such as ulaw, alaw, GSM, or Opus. Endpoints negotiate which codec a call uses. behavior, or threshold mismatch can end the recording unexpectedly.
Runtime defaults and the sample file
An unset maxsilence uses the application's disabled runtime default. The current upstream voicemail.conf.sample, however, actively includes maxsilence = 10. A copied sample is configured behavior, not the same as leaving the option unset.
Review the actual file loaded by your installed Asterisk version. Distribution packages may ship or preserve different values during upgrades.
Tune silencethreshold carefully
silencethreshold determines whether incoming audio counts as silence. The same numeric value can behave differently with microphones, codecs, gain, noise suppression, and background noise.
- If callers are cut off while speaking quietly, the threshold or timeout may be too aggressive.
- If open lines never stop, room noise may remain above the threshold.
- If results vary by endpointIn PJSIP configuration, the SIP entity Asterisk communicates with: a phone, trunk, or other user agent. Defined by an endpoint section in pjsip.conf., test each important phone and codec path.
Change one value at a time and record the tested endpoint, codec, and environment.
Apply and verify
Reload app_voicemail:
asterisk -rx "voicemail reload"
Check the Asterisk log for the warning. Common approaches include:
journalctl -u asterisk --since "5 minutes ago" | grep -F "maxsilence should be less than minsecs"
or:
grep -F "maxsilence should be less than minsecs" /var/log/asterisk/full
Then make at least three test calls:
- Leave a normal message with no long pauses.
- Leave a short but legitimate message near the
minsecsboundary. - Leave a longer message with several natural pauses near the
maxsilencevalue.
Confirm whether each message is retained, whether the full speech is present, and whether the caller hears the expected completion prompts. Repeat with representative phones and codecs before deploying the policy broadly.
Common mistakes
Raising maxsilence above minsecs. This may remove a cutoff symptom but violates Asterisk's required relationship and triggers the warning.
Lowering maxsilence without call testing. The warning disappears, but callers may be cut off during normal pauses.
Changing minsecs only to satisfy the inequality. A larger minimum can silently discard legitimate short messages.
Ignoring silencethreshold. A mathematically valid pair can still behave badly when the audio threshold does not match real calls.
Assuming the upstream sample is the runtime default. An active line in the sample becomes configured behavior when copied, while an unset option follows the application default.
Related content
- Setting Up VoicemailAsterisk's built-in voice messaging system (app_voicemail), configured in voicemail.conf with mailboxes per user. in Asterisk
- voicemail.conf Core Settings and Mailbox Options
- Voicemail with Email Notification
Primary sources
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.