From 7e33b5d88c746030df9a52ee89ff86e708842a74 Mon Sep 17 00:00:00 2001 From: jpeeler Date: Wed, 1 Dec 2010 00:24:58 +0000 Subject: Merged revisions 296868 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r296868 | jpeeler | 2010-11-30 18:23:19 -0600 (Tue, 30 Nov 2010) | 4 lines Properly restore backup information file when hanging up during message prepending. ABE-2654 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@296869 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_voicemail.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/app_voicemail.c') diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 73c4ee2e5..c2f8f7f2a 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -6950,6 +6950,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 */ -- cgit v1.2.3