[asterisk-commits] murf: trunk r43506 - /trunk/pbx/pbx_ael.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 22 14:17:07 MST 2006


Author: murf
Date: Fri Sep 22 16:17:07 2006
New Revision: 43506

URL: http://svn.digium.com/view/asterisk?rev=43506&view=rev
Log:
As per bug 8004, we now return AST_MODULE_LOAD_DECLINE when we can't read extensions.ael

Modified:
    trunk/pbx/pbx_ael.c

Modified: trunk/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_ael.c?rev=43506&r1=43505&r2=43506&view=diff
==============================================================================
--- trunk/pbx/pbx_ael.c (original)
+++ trunk/pbx/pbx_ael.c Fri Sep 22 16:17:07 2006
@@ -28,6 +28,7 @@
 
 #include <sys/types.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -3803,6 +3804,11 @@
 		sprintf(rfilename, "%s/%s", ast_config_AST_CONFIG_DIR, config);
 	}
 	ast_log(LOG_NOTICE, "AEL load process: calculated config file name '%s'.\n", rfilename);
+
+	if (access(rfilename,R_OK) != 0) {
+		ast_log(LOG_NOTICE, "File %s not found; AEL declining load\n", rfilename);
+		return AST_MODULE_LOAD_DECLINE;
+	}
 	
 	parse_tree = ael2_parse(rfilename, &errs);
 	ast_log(LOG_NOTICE, "AEL load process: parsed config file name '%s'.\n", rfilename);



More information about the asterisk-commits mailing list