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
1.4
Terry Wilson 15 years ago
parent a02ffb0a61
commit a2bf7447e2

@ -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, "");

Loading…
Cancel
Save