]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 284881 via svnmerge from
authorTerry Wilson <twilson@digium.com>
Fri, 3 Sep 2010 16:20:45 +0000 (16:20 +0000)
committerTerry Wilson <twilson@digium.com>
Fri, 3 Sep 2010 16:20:45 +0000 (16:20 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r284881 | twilson | 2010-09-03 11:10:23 -0500 (Fri, 03 Sep 2010) | 5 lines

  Properly detect when a sound file doesn't exist

  ast_fileexists returns -1 for error and 0 for a non-existant file. The existing
  code treated missing files as though they existed.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@284897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanspy.c

index 2ce2e0ae266b3fc6db55fa257da97e5e170baf85..031c82998fe62bd9bf333912194f49ebd6eddf1e 100644 (file)
@@ -962,7 +962,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
                                }
                                if (!ast_test_flag(flags, OPTION_NAME) || res < 0) {
                                        if (!ast_test_flag(flags, OPTION_NOTECH)) {
-                                               if (ast_fileexists(peer_name, NULL, NULL) != -1) {
+                                               if (ast_fileexists(peer_name, NULL, NULL) > 0) {
                                                        res = ast_streamfile(chan, peer_name, chan->language);
                                                        if (!res) {
                                                                res = ast_waitstream(chan, "");