From: Terry Wilson Date: Fri, 3 Sep 2010 16:10:23 +0000 (+0000) Subject: Properly detect when a sound file doesn't exist X-Git-Tag: 1.4.37-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2bf7447e23b0f3cbfaf47ee299d342d5d8d5bef;p=thirdparty%2Fasterisk.git 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 were existed. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@284881 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index b7c915b457..57309e5b5b 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -633,7 +633,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags, ast_channel_unlock(peer); if (!ast_test_flag(flags, OPTION_QUIET)) { - 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, "");