[asterisk-commits] mjordan: trunk r408859 - in /trunk: ./ main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Feb 22 17:31:15 CST 2014


Author: mjordan
Date: Sat Feb 22 17:31:10 2014
New Revision: 408859

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408859
Log:
main: Initialize dialplan providing core components prior to module pre-load

It is possible to pre-load pbx_config. As a result, pbx_config - which will
load and parse the dialplan - will attempt to use various dialplan components,
such as device state providers and presence state providers, prior to them
being initialized by the core. This would lead to a crash, as the components
had not created their Stasis cache entries.

This patch moves a number of core component initializations before the module
pre-load. This guarantees that if someone does pre-load pbx_config - or other
pbx modules - that the Stasis caches for the various core components are
created.

(closes issue ASTERISK-23320)
Reported by: xrobau

(closes issue ASTERISK-23265)
Reported by: Andrew Nagy
Tested by: Andrew Nagy, Rusty Newton
........

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

Modified:
    trunk/   (props changed)
    trunk/main/asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/asterisk.c?view=diff&rev=408859&r1=408858&r2=408859
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Sat Feb 22 17:31:10 2014
@@ -4426,6 +4426,36 @@
 		exit(1);
 	}
 
+	if (ast_features_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_pickup_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_bridging_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_parking_stasis_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_device_state_engine_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_presence_state_engine_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
 	if ((moduleresult = load_modules(1))) {		/* Load modules, pre-load only */
 		printf("%s", term_quit());
 		exit(moduleresult == -2 ? 2 : 1);
@@ -4453,37 +4483,7 @@
 		exit(1);
 	}
 
-	if (ast_features_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_pickup_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_bridging_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_parking_stasis_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
 	if (ast_cdr_engine_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_device_state_engine_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_presence_state_engine_init()) {
 		printf("%s", term_quit());
 		exit(1);
 	}




More information about the asterisk-commits mailing list