[asterisk-commits] alecdavis: trunk r312118 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 1 02:43:09 CDT 2011


Author: alecdavis
Date: Fri Apr  1 02:43:00 2011
New Revision: 312118

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=312118
Log:
Merged revisions 312117 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r312117 | alecdavis | 2011-04-01 20:32:12 +1300 (Fri, 01 Apr 2011) | 29 lines
  
  Merged revisions 312103 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r312103 | alecdavis | 2011-04-01 20:25:54 +1300 (Fri, 01 Apr 2011) | 22 lines
    
    Merged revisions 312070 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r312070 | alecdavis | 2011-04-01 19:46:56 +1300 (Fri, 01 Apr 2011) | 16 lines
      
      app_voicemail: close_mailbox needs to respect additional messages while mailbox is open.
      
      close_mailbox leave gaps in message sequence if messages are deleted and new messages
      arrive during this time, this is because the shuffle down to slot 0, only shuffles
      the number of pre-existing messages when mailbox is opened, ignoring new arrivals.
      
      Fix: in close_mailbox re-evaluate number of messages before the shuffle, this then includes new arrivals.
      
      Happens on filebased or ODBC storage.
      
      (issues #19032,#18582,#18692,#18998)
      Reported by: alecdavis,tootai,afosorio
      
      Review: https://reviewboard.asterisk.org/r/1153/
    ........
  ................
................

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=312118&r1=312117&r2=312118
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri Apr  1 02:43:00 2011
@@ -7785,7 +7785,9 @@
 static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
 {
 	int x = 0;
+
 #ifndef IMAP_STORAGE
+	int last_msg_idx;
 	int res = 0, nummsg;
 	char fn2[PATH_MAX];
 #endif
@@ -7801,8 +7803,14 @@
 		return ERROR_LOCK_PATH;
 	}
 
+	/* update count as message may have arrived while we've got mailbox open */
+	last_msg_idx = last_message_index(vmu, vms->curdir);
+	if (last_msg_idx != vms->lastmsg) {
+		ast_log(AST_LOG_WARNING, "%d messages received after mailbox opened.\n", last_msg_idx - vms->lastmsg);
+	}
+
 	/* must check up to last detected message, just in case it is erroneously greater than maxmsg */
-	for (x = 0; x < vms->lastmsg + 1; x++) {
+	for (x = 0; x < last_msg_idx + 1; x++) {
 		if (!vms->deleted[x] && ((strcasecmp(vms->curbox, "INBOX") && strcasecmp(vms->curbox, "Urgent")) || !vms->heard[x] || (vms->heard[x] && !ast_test_flag(vmu, VM_MOVEHEARD)))) {
 			/* Save this message.  It's not in INBOX or hasn't been heard */
 			make_file(vms->fn, sizeof(vms->fn), vms->curdir, x);




More information about the asterisk-commits mailing list