diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-25 21:31:47 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-25 21:31:47 +0000 |
commit | 37b8201c1402f206c0cc82807d45168b92978ce3 (patch) | |
tree | d351384855b9f0c79669398af38d40806de9ef30 /apps | |
parent | eb775320ab11b7a007c46f5fc3a65254d67c7723 (diff) |
If the destination folder is full, don't delete a message when exiting.
(closes issue #12065)
Reported by: selsky
Patch by: (myself)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104094 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 843f73978..0f3df684a 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -202,6 +202,7 @@ static struct vmstate *vmstates = NULL; #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 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg } 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 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu) } 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; |