From: Jeff Peeler Date: Wed, 1 Dec 2010 00:23:19 +0000 (+0000) Subject: Properly restore backup information file when hanging up during message prepending. X-Git-Tag: 1.4.39-rc1~3^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25c2ccaac32eac5a872d8df835b9e89d41a5c699;p=thirdparty%2Fasterisk.git Properly restore backup information file when hanging up during message prepending. ABE-2654 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296868 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 58186b2815..7ae1e44d75 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 */