Merged revisions 32605 via svnmerge from
[asterisk/asterisk.git] / apps / app_voicemail.c
index cb28fa8..f472e30 100644 (file)
@@ -2625,7 +2625,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                        if (duration < vmminmessage) {
                                if (option_verbose > 2) 
                                        ast_verbose( VERBOSE_PREFIX_3 "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmminmessage);
-                               DELETE(dir,msgnum,fn);
+                               ast_filedelete(tmptxtfile, NULL);
+                               unlink(tmptxtfile);
                        } else {
                                fprintf(txt, "duration=%d\n", duration);
                                fclose(txt);