Summary:ASTERISK-20597: Cannot forward voice mail due to "Mailbox is full with capacity of 100" even though the folder has less than 100 messages
Reporter:Tim Miller Dyck (timmillerdyck)Labels:
Date Opened:2012-10-23 08:21:45Date Closed:
Versions: 13.18.4 Frequency of
is related toASTERISK-23713 Voicemail on FS overwrites last message when last index = MSGLIMIT
Environment:FreePBX Distro 2.10 (CentOS 5.8)Attachments:
Description:Hello, I ran into this puzzling situation with Asterisk 1.8.17.

The user tries to transfer a voice mail from extension 10 to extension 14. The transfer fails with the voice mail system reporting the target extension 14 mailbox is full.

This is what is in full.log:

[2012-10-19 11:31:01] VERBOSE[32172] file.c: -- Playing 'vm-password.ulaw' (language 'en')
[2012-10-19 11:31:05] VERBOSE[32172] file.c: -- Playing 'vm-youhave.ulaw' (language 'en')
[2012-10-19 11:31:06] VERBOSE[32172] file.c: -- Playing 'digits/1.ulaw' (language 'en')
[2012-10-19 11:31:07] VERBOSE[32172] file.c: -- Playing 'vm-INBOX.ulaw' (language 'en')
[2012-10-19 11:31:07] VERBOSE[32172] file.c: -- Playing 'vm-first.ulaw' (language 'en')
[2012-10-19 11:31:08] VERBOSE[32172] config.c: == Parsing '/var/spool/asterisk/voicemail/default/10/INBOX/msg0000.txt': [2012-10-19 11:31:08] VERBOSE[32172] config.c: == Found
[2012-10-19 11:31:08] VERBOSE[32172] file.c: -- Playing 'vm-message.ulaw' (language 'en')
[2012-10-19 11:31:09] VERBOSE[32172] file.c: -- Playing '/var/spool/asterisk/voicemail/default/10/INBOX/msg0000.slin' (language 'en')
[2012-10-19 11:31:12] VERBOSE[32172] file.c: -- Playing 'vm-advopts.ulaw' (language 'en')
[2012-10-19 11:31:13] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:14] VERBOSE[32172] file.c: -- Playing 'vm-extension.ulaw' (language 'en')
[2012-10-19 11:31:18] NOTICE[32172] app_voicemail.c: Mailbox '14' is full with capacity of 100, prompting for another extension.
[2012-10-19 11:31:18] VERBOSE[32172] file.c: -- Playing 'vm-mailboxfull.ulaw' (language 'en')
[2012-10-19 11:31:22] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:22] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:27] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:28] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:29] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:29] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:30] VERBOSE[32172] file.c: -- Playing 'vm-forward.ulaw' (language 'en')
[2012-10-19 11:31:31] WARNING[32172] file.c: Failed to write frame
[2012-10-19 11:31:31] VERBOSE[32172] file.c: -- Playing 'vm-advopts.ulaw' (language 'en')
[2012-10-19 11:31:31] VERBOSE[32172] pbx.c: == Spawn extension (from-internal, *98, 11) exited non-zero on 'SIP/10-00000140'
[2012-10-19 11:31:31] VERBOSE[32172] pbx.c: -- Executing [h@from-internal:1] Hangup("SIP/10-00000140", "") in new stack
[2012-10-19 11:31:31] VERBOSE[32172] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/10-00000140'

However, when I looked in each voicemail folder in /var/spool/asterisk/voicemail/default/14/... (INBOX, Old, etc.), the highest message count was 80 or so.

I also logged into the web user portal to view message counts there, and these were all under 100 as well, matching the count of files found on the file system.

As a test, I changed the maxmsg voicemail parameter from 100 to a higher value, and that allowed the voice mail forward to work.

Looking at the app_voicemail.c code at http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=markup starting at line 8019:

capacity = receiver->maxmsg - inprocess_count(receiver->mailbox, receiver->context, +1);
if ((newmsgs + oldmsgs) >= capacity) {
ast_log(LOG_NOTICE, "Mailbox '%s' is full with capacity of %d, prompting for another extension.\n", s, capacity);
res = ast_play_and_wait(chan, "vm-mailboxfull");

This code appears to check that that the target mailbox new message count (voicemail folder INBOX) *plus* the count of the old message count (voicemail folder Old) is not >= the folder capacity limit (default of 100 messages).

In the test case, the sum of messages in the these two folders in the destination mailbox was over 100.

If this interpretation of the code is correct, this seems to be breaking the understanding that the maxmsg parameter is the limit for each individual voicemail folder, at least regarding the operation of the voicemail forward message command.

Comments:By: Michael L. Young (elguero) 2012-10-23 09:28:35.008-0500

You are correct.  It would appear that [r287015|http://svnview.digium.com/svn/asterisk?view=revision&revision=287015] changed the documented behavior for app_voicemail.c.  According to the commit message, the author of the patch approached this from a per mailbox setting instead of a per folder setting.

There would appear to be some confusion around the maxmsg setting and some understand it to apply per mailbox (as I noticed in the official book for asterisk).  But, the code and the sample config file both state that the maxmsg applies per folder.  Therefore, I think the patch that changed this behavior needs to be reverted.

There was another issue, ASTERISK-17768, where someone wanted the maxmsg to be per mailbox and the conclusion was that we should leave everything as is and create a new option to apply a limit per mailbox.

I just wanted to put some history in this issue in order to help make a decision on how to correct this regression.

By: Tim Miller Dyck (timmillerdyck) 2012-10-23 10:00:30.726-0500

Thanks for that update and background, Michael.

For now, then, it appears increasing maxmsg to 200 is the appropriate workaround to match user expectations that each voicemail folder can hold at least 100 messages, including when forwarding a voice mail message.

For others, I initially reported this on the FreePBX forums. Linking back to that page here:


Tim Miller Dyck