[asterisk-bugs] [Asterisk 0018498]: Resequencing of mailbox not working as expected.

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Dec 18 18:01:43 UTC 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18498 
====================================================================== 
Reported By:                JJCinAZ
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18498
Category:                   Applications/app_voicemail
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.38 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-12-18 11:32 CST
Last Modified:              2010-12-18 12:01 CST
====================================================================== 
Summary:                    Resequencing of mailbox not working as expected.
Description: 
Changes made on 2010-10-26 by jpeeler [2010-10-26 18:33 +0000 [r293118] 
Jeff Peeler <jpeeler at digium.com>] to resequence_mailbox() cause the whole
routine to not be effective.  

The function was changed to go up to the actual number of messages found
in the directory (count_msg parameter) instead of the old limit of
max_msgs+10.  The problem introduced is one where count_msg is 0 because
the msg0000.<fmt> file is not there, yet msg0001.<fmt> does exist.  This
will cause the following errors now in the log:

Dec 17 12:44:10] NOTICE[3723] app_voicemail.c: Resequencing Mailbox:
/var/spool/asterisk/voicemail/xx/7104/INBOX, expected 0 but found 1
message(s) in box with max threshold of 100.
[Dec 17 12:44:17] WARNING[3723] app_voicemail.c: No message attribute
file?!! (/var/spool/asterisk/voicemail/xx/7104/INBOX/msg0000.txt)


====================================================================== 

---------------------------------------------------------------------- 
 (0129762) JJCinAZ (reporter) - 2010-12-18 12:01
 https://issues.asterisk.org/view.php?id=18498#c129762 
---------------------------------------------------------------------- 
I believe the proper fix is to test up to the count_msg+1 (not one less
than) and increment the count_msg variable if we just detected an out of
sequence file.  This has the effect of keeping the resequence going until
we exhaust the out of sequence files even if the max_msgs has changed in
the meantime.  I additionally added a top end limit so we don't go nuts
with files:

for (x = 0, dest = 0; x <= count_msg + 1 && x < 9999; x++) {
	make_file(sfn, sizeof(sfn), dir, x);
	if (EXISTS(dir, x, sfn, NULL)) {
		if (x != dest) {
			make_file(dfn, sizeof(dfn), dir, dest);
			RENAME(dir, x, vmu->mailbox, vmu->context, dir, dest, sfn, dfn);
			count_msg++;  /* we have to keep going because we found one off the end
and out of sequence */
		}
		dest++;
	}
}

We're testing this internally and will update but another set of eyes
would be good. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-18 12:01 JJCinAZ        Note Added: 0129762                          
======================================================================




More information about the asterisk-bugs mailing list