dect
/
asterisk
Archived
13
0
Fork 0

Merged revisions 34875 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r34875 | tilghman | 2006-06-19 13:07:26 -0500 (Mon, 19 Jun 2006) | 2 lines

Issue 7357 - txt file left behind when going to operator.  Also, fix a possible file descriptor leak.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@34876 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
tilghman 2006-06-19 18:11:04 +00:00
parent 0d6876baf2
commit a161b099b0
1 changed files with 6 additions and 1 deletions

View File

@ -2628,6 +2628,7 @@ 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);
fclose(txt);
ast_filedelete(tmptxtfile, NULL);
unlink(tmptxtfile);
} else {
@ -2638,6 +2639,10 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
/* Delete files */
ast_filedelete(tmptxtfile, NULL);
unlink(tmptxtfile);
} else if (ast_fileexists(tmptxtfile, NULL, NULL) <= 0) {
if (option_debug)
ast_log(LOG_DEBUG, "The recorded media file is gone, so we should remove the .txt file too!\n");
unlink(tmptxtfile);
} else {
for (;;) {
make_file(fn, sizeof(fn), dir, msgnum);
@ -2671,7 +2676,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
free_user(recip);
}
}
if (ast_fileexists(fn, NULL, NULL)) {
if (ast_fileexists(fn, NULL, NULL) > 0) {
STORE(dir, vmu->mailbox, vmu->context, msgnum);
notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
DISPOSE(dir, msgnum);