aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-01 20:05:24 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-01 20:05:24 +0000
commit4993d60f477c890e4f4aed217df025ff76254ae8 (patch)
treea09463f333c165b9a69d8e786453eb33a7ad13d5 /apps
parent5139867d4822600726aa0aa49262dc5e851f7005 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@24018 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 5b2463af5..d720fb761 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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;
}