[asterisk-commits] tilghman: branch 1.4 r104094 - /branches/1.4/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 25 15:31:48 CST 2008


Author: tilghman
Date: Mon Feb 25 15:31:47 2008
New Revision: 104094

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104094
Log:
If the destination folder is full, don't delete a message when exiting.
(closes issue #12065)
 Reported by: selsky
 Patch by: (myself)

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=104094&r1=104093&r2=104094
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Mon Feb 25 15:31:47 2008
@@ -202,6 +202,7 @@
 #define VM_SEARCH        (1 << 14)
 #define VM_TEMPGREETWARN (1 << 15)  /*!< Remind user tempgreeting is set */
 #define ERROR_LOCK_PATH  -100
+#define ERROR_MAILBOX_FULL	-200
 
 
 enum {
@@ -3282,7 +3283,7 @@
 	}
 	if (x >= vmu->maxmsg) {
 		ast_unlock_path(ddir);
-		return -1;
+		return ERROR_MAILBOX_FULL;
 	}
 	if (strcmp(sfn, dfn)) {
 		COPY(dir, msg, ddir, x, username, context, sfn, dfn);
@@ -4925,8 +4926,9 @@
 		} else if (!strcasecmp(vms->curbox, "INBOX") && vms->heard[x] && !vms->deleted[x]) { 
 			/* Move to old folder before deleting */ 
 			res = save_to_folder(vmu, vms, x, 1);
-			if (res == ERROR_LOCK_PATH) {
+			if (res == ERROR_LOCK_PATH || res == ERROR_MAILBOX_FULL) {
 				/* If save failed do not delete the message */
+				ast_log(LOG_WARNING, "Save failed.  Not moving message: %s.\n", res == ERROR_LOCK_PATH ? "unable to lock path" : "destination folder full");
 				vms->deleted[x] = 0;
 				vms->heard[x] = 0;
 				--x;




More information about the asterisk-commits mailing list