[asterisk-commits] twilson: branch 1.4 r284881 - /branches/1.4/apps/app_chanspy.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 3 11:10:27 CDT 2010


Author: twilson
Date: Fri Sep  3 11:10:23 2010
New Revision: 284881

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=284881
Log:
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.

Modified:
    branches/1.4/apps/app_chanspy.c

Modified: branches/1.4/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_chanspy.c?view=diff&rev=284881&r1=284880&r2=284881
==============================================================================
--- branches/1.4/apps/app_chanspy.c (original)
+++ branches/1.4/apps/app_chanspy.c Fri Sep  3 11:10:23 2010
@@ -633,7 +633,7 @@
 			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, "");




More information about the asterisk-commits mailing list