From 95871f201d51a55fef15ab8fd78e722c7700e2ca Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Tue, 6 Jun 2006 16:59:13 +0000
Subject: [PATCH] Merged revisions 32605 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r32605 | tilghman | 2006-06-06 11:55:23 -0500 (Tue, 06 Jun 2006) | 2 lines

Bug 7287 - A too short voicemail with ODBC_STORAGE will cause the first voicemail to be deleted erroneously

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_voicemail.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index cb28fa8d0f..f472e30305 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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);
-- 
GitLab