]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Properly restore backup information file when hanging up during message prepending.
authorJeff Peeler <jpeeler@digium.com>
Wed, 1 Dec 2010 00:23:19 +0000 (00:23 +0000)
committerJeff Peeler <jpeeler@digium.com>
Wed, 1 Dec 2010 00:23:19 +0000 (00:23 +0000)
ABE-2654

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296868 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 58186b2815a56a908704baa51cb87024fda3eb09..7ae1e44d75445c608a998cfe31848563669e73ab 100644 (file)
@@ -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 */