[svn-commits] jrose: trunk r398064 - in /trunk: ./ main/features_config.c main/udptl.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 30 13:04:46 CDT 2013


Author: jrose
Date: Fri Aug 30 13:04:41 2013
New Revision: 398064

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398064
Log:
features_config: Don't require features.conf to be present for Asterisk to load

(closes issue ASTERISK-22426)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2806/
........

Merged revisions 398020 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/main/features_config.c
    trunk/main/udptl.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Aug 30 13:04:41 2013
@@ -1,1 +1,1 @@
-/branches/12:1-397989,398002,398016,398023,398025,398062
+/branches/12:1-397989,398002,398016,398020,398023,398025,398062

Modified: trunk/main/features_config.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features_config.c?view=diff&rev=398064&r1=398063&r2=398064
==============================================================================
--- trunk/main/features_config.c (original)
+++ trunk/main/features_config.c Fri Aug 30 13:04:41 2013
@@ -1709,10 +1709,16 @@
 			"", featuregroup_handler, 0);
 
 	if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
-		ast_log(LOG_ERROR, "Failed to process features.conf configuration!\n");
-		aco_info_destroy(&cfg_info);
-		ao2_global_obj_release(globals);
-		return -1;
+		RAII_VAR(struct features_config *, features_cfg, __features_config_alloc(0), ao2_cleanup);
+
+		if (aco_set_defaults(&global_option, "general", features_cfg->global) ||
+			aco_set_defaults(&featuremap_option, "featuremap", features_cfg->featuremap)) {
+			ast_log(LOG_ERROR, "Failed to load features.conf and failed to initialize defaults.\n");
+			return -1;
+		}
+
+		ast_log(LOG_NOTICE, "Could not load features config; using defaults\n");
+		ao2_global_obj_replace(globals, features_cfg);
 	}
 
 	return 0;

Modified: trunk/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/udptl.c?view=diff&rev=398064&r1=398063&r2=398064
==============================================================================
--- trunk/main/udptl.c (original)
+++ trunk/main/udptl.c Fri Aug 30 13:04:41 2013
@@ -1458,14 +1458,17 @@
 
 static void __ast_udptl_reload(int reload)
 {
-	RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
-
 	if (aco_process_config(&cfg_info, reload) == ACO_PROCESS_ERROR) {
 		if (!reload) {
-			if (!aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
-				ast_log(LOG_WARNING, "Could not load udptl config; using defaults\n");
-				ao2_global_obj_replace(globals, udptl_cfg);
+			RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
+
+			if (aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
+				ast_log(LOG_ERROR, "Failed to load udptl.conf and failed to initialize defaults.\n");
+				return;
 			}
+
+			ast_log(LOG_NOTICE, "Could not load udptl config; using defaults\n");
+			ao2_global_obj_replace(globals, udptl_cfg);
 		}
 	}
 }




More information about the svn-commits mailing list