]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 265090 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Fri, 21 May 2010 21:10:04 +0000 (21:10 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 21 May 2010 21:10:04 +0000 (21:10 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r265090 | mmichelson | 2010-05-21 16:08:51 -0500 (Fri, 21 May 2010) | 15 lines

  Merged revisions 265089 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r265089 | mmichelson | 2010-05-21 15:59:14 -0500 (Fri, 21 May 2010) | 8 lines

    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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@265091 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c
include/asterisk/file.h

index 797b08787fb39fc9319cd4169f3b7b26d470da0c..a60154ceaa5809d7051655e2356aef0c4c8fe9c6 100644 (file)
@@ -2028,6 +2028,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);
index 8def42ae5d41fb169285ad47df4f2abcb487d537..69de811652abc41ccc6ace7b44e7fd8ddc916f29 100644 (file)
@@ -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);