aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-01 00:23:19 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-01 00:23:19 +0000
commite729643886ff967ae22a543dee531d0a77c1154e (patch)
treee7d8a911634d01036238df52e558f0c753a496fb
parent4ede17efdd8bf2491247ba04edda4a55853b8e3a (diff)
Properly restore backup information file when hanging up during message prepending.
ABE-2654 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@296868 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 58186b281..7ae1e44d7 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5585,6 +5585,16 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
#endif
}
DISPOSE(dir, curmsg);
+#ifndef IMAP_STORAGE
+ if (cmd) { /* assuming hangup, cleanup backup file */
+ make_file(msgfile, sizeof(msgfile), dir, curmsg);
+ strcpy(textfile, msgfile);
+ strcpy(backup_textfile, msgfile);
+ strncat(textfile, ".txt", sizeof(textfile) - strlen(textfile) - 1);
+ strncat(backup_textfile, "-bak.txt", sizeof(backup_textfile) - strlen(backup_textfile) - 1);
+ rename(backup_textfile, textfile);
+ }
+#endif
}
/* If anything failed above, we still have this list to free */