]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Mon, 1 May 2006 20:05:24 +0000 (20:05 +0000)
committerAutomerge script <automerge@asterisk.org>
Mon, 1 May 2006 20:05:24 +0000 (20:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@24018 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 5b2463af5cbc0ae19c2130523a5ab5869c6e8242..d720fb761b1f9c34bdf107be5517d7c63bd99166 100644 (file)
@@ -2596,9 +2596,14 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                                ast_log(LOG_WARNING, "Error opening text file for output\n");
                        res = play_record_review(chan, NULL, fn, vmmaxmessage, fmt, 1, vmu, &duration, dir, options->record_gain);
                        if (res == '0') {
-                               if (txt) {
+                               if (txt && EXISTS(dir,msgnum,fn,chan->language)) {
                                        fclose(txt);
                                        rename(tmptxtfile, txtfile);
+                               } else if (txt && !EXISTS(dir,msgnum,fn,chan->language)) {
+                                       if (option_debug) 
+                                               ast_log(LOG_DEBUG, "The recorded media file is gone, so we should remove the .txt file too!\n");
+                                       fclose(txt);
+                                       unlink(tmptxtfile);     
                                }
                                goto transfer;
                        }