diff --git a/apps/app_queue.c b/apps/app_queue.c index 366edf5c27..5692890ac2 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2346,6 +2346,10 @@ static int play_file(struct ast_channel *chan, const char *filename) return 0; } + if (!ast_fileexists(filename, NULL, chan->language)) { + return 0; + } + ast_stopstream(chan); res = ast_streamfile(chan, filename, chan->language); diff --git a/include/asterisk/file.h b/include/asterisk/file.h index 8def42ae5d..69de811652 100644 --- a/include/asterisk/file.h +++ b/include/asterisk/file.h @@ -90,7 +90,7 @@ int ast_stopstream(struct ast_channel *c); * \param fmt the format you wish to check (the extension) * \param preflang (the preferred language you wisht to find the file in) * See if a given file exists in a given format. If fmt is NULL, any format is accepted. - * \return -1 if file does not exist, non-zero positive otherwise. + * \return 0 if file does not exist, non-zero positive otherwise. */ int ast_fileexists(const char *filename, const char *fmt, const char *preflang);