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: https://origsvn.digium.com/svn/asterisk/branches/1.2@23985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2
BJ Weschke 19 years ago
parent d3d73f3499
commit b7f8ee4a6d

@ -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 (!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;
}

Loading…
Cancel
Save