aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-22 20:32:15 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-22 20:32:15 +0000
commit4b1ca40f368a3d414341fdac5cdb4ca869d911dc (patch)
treed9c22ae49490491f68407c240db8a5d4c2a97892 /main/asterisk.c
parent755f0863204f462295fadd360262f9bf7be45aa8 (diff)
Initialize channels prior to loading "preload" modules.
We can have bad results when a module, upon being loaded, attempts to reference the channels container if the container hasn't yet been initialized. I saw this happen by trying to preload pbx_config.so and having a hint defined which referenced a non-existent SIP peer. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253872 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index b94a48c72..3b0c7c962 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3603,6 +3603,8 @@ int main(int argc, char *argv[])
ast_xmldoc_load_documentation();
#endif
+ ast_channels_init();
+
if ((moduleresult = load_modules(1))) { /* Load modules, pre-load only */
printf("%s", term_quit());
exit(moduleresult == -2 ? 2 : 1);
@@ -3615,8 +3617,6 @@ int main(int argc, char *argv[])
ast_http_init(); /* Start the HTTP server, if needed */
- ast_channels_init();
-
if (init_manager()) {
printf("%s", term_quit());
exit(1);