aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-01 19:32:47 +0000
committerbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-01 19:32:47 +0000
commit9520d1f304d2046cf984ee2432c901e3f4328c43 (patch)
tree44e31e3721ec43cf3f525d9a1d94a6d080ebb03b /apps
parent6decaec170394db15865f9fc0911d76349cfc3e8 (diff)
Merged revisions 23985 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r23985 | bweschke | 2006-05-01 14:26:43 -0500 (Mon, 01 May 2006) | 3 lines Make sure that when someone 0's out while recording a msg and then chooses to DELETE the recorded file, the .txt file isn't left around by itself to cause problems later. #7061 (dimitripietro reporting, blitzrage confirmed) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23987 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ec9ded790..724ba5d16 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2565,9 +2565,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 (!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;
}