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 {
/* 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);
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);