aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-25 21:53:36 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-25 21:53:36 +0000
commit878a5b11832eeeeda4cdb7a0e43c5f2dc53f9cf2 (patch)
tree4cb6e7989b83d8b1fc69dd42dc9bb22789a6c871 /apps/app_voicemail.c
parentd9f030a4b0532e4a4b48d4c4728dcdfe69fa0530 (diff)
Merged revisions 104094 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104094 | tilghman | 2008-02-25 15:31:47 -0600 (Mon, 25 Feb 2008) | 5 lines 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/trunk@104097 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 76b280539..9bcb8f159 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -222,6 +222,7 @@ static AST_LIST_HEAD_STATIC(vmstates, vmstate);
#define VM_TEMPGREETWARN (1 << 15) /*!< Remind user tempgreeting is set */
#define VM_MOVEHEARD (1 << 16) /*!< Move a "heard" message to Old after listening to it */
#define ERROR_LOCK_PATH -100
+#define ERROR_MAILBOX_FULL -200
enum {
@@ -3522,7 +3523,7 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
} else {
if (x >= vmu->maxmsg) {
ast_unlock_path(ddir);
- return -1;
+ return ERROR_MAILBOX_FULL;
}
}
make_file(sfn, sizeof(sfn), dir, msg);
@@ -5336,8 +5337,9 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
} else if (!strcasecmp(vms->curbox, "INBOX") && vms->heard[x] && ast_test_flag(vmu, VM_MOVEHEARD) && !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;