--- app_voicemail.c.orig 2006-05-23 14:52:03.000000000 +1200 +++ app_voicemail.c 2006-05-23 14:53:19.000000000 +1200 @@ -2443,11 +2443,13 @@ snprintf(prefile, sizeof(prefile), "%s%s/%s/busy", VM_SPOOL_DIR, vmu->context, ext); else if (ast_test_flag(options, OPT_UNAVAIL_GREETING)) snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, ext); - snprintf(tempfile, sizeof(tempfile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, ext); - RETRIEVE(tempfile, -1); - if (ast_fileexists(tempfile, NULL, NULL) > 0) - ast_copy_string(prefile, tempfile, sizeof(prefile)); - DISPOSE(tempfile, -1); + if (ast_test_flag(options, OPT_BUSY_GREETING) || ast_test_flag(options, OPT_UNAVAIL_GREETING)) { + snprintf(tempfile, sizeof(tempfile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, ext); + RETRIEVE(tempfile, -1); + if (ast_fileexists(tempfile, NULL, NULL) > 0) + ast_copy_string(prefile, tempfile, sizeof(prefile)); + DISPOSE(tempfile, -1); + } /* It's easier just to try to make it than to check for its existence */ create_dirpath(dir, sizeof(dir), vmu->context, ext, "INBOX"); create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, ext, "tmp");