aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-21 20:59:14 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-21 20:59:14 +0000
commit2602d4ce5b98436b6908ac484c182526c4e9d4db (patch)
treeda1fac3c97591ca491e324ec4721a4097dd2b293
parent0e632c0c7d81d357e47485a3dcb06d790bef9403 (diff)
Don't hang up on a queue caller if the file we attempt to play does not exist.
This also fixes a documentation mistake in file.h that made my original attempt to correct this problem not work correctly. (closes issue #17061) Reported by: RoadKill git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@265089 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_queue.c4
-rw-r--r--include/asterisk/file.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 4497e125f..1fc6201f3 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1532,6 +1532,10 @@ static int play_file(struct ast_channel *chan, 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 4b8c8fad9..1518d209d 100644
--- a/include/asterisk/file.h
+++ b/include/asterisk/file.h
@@ -199,7 +199,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.
- * Returns -1 if file does not exist, non-zero positive otherwise.
+ * Returns 0 if file does not exist, non-zero positive otherwise.
*/
int ast_fileexists(const char *filename, const char *fmt, const char *preflang);