DECLINE to load confbridge if the config fails to load.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 30 Jul 2012 20:27:39 +0000 (20:27 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 30 Jul 2012 20:27:39 +0000 (20:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370589 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_confbridge.c

index 2ea8d15..90954b8 100644 (file)
@@ -2831,6 +2831,7 @@ static int unload_module(void)
 static int load_module(void)
 {
        int res = 0;
 static int load_module(void)
 {
        int res = 0;
+
        if ((ast_custom_function_register(&confbridge_function))) {
                return AST_MODULE_LOAD_FAILURE;
        }
        if ((ast_custom_function_register(&confbridge_function))) {
                return AST_MODULE_LOAD_FAILURE;
        }
@@ -2865,10 +2866,15 @@ static int load_module(void)
        res |= ast_manager_register_xml("ConfbridgeStartRecord", EVENT_FLAG_CALL, action_confbridgestartrecord);
        res |= ast_manager_register_xml("ConfbridgeStopRecord", EVENT_FLAG_CALL, action_confbridgestoprecord);
        res |= ast_manager_register_xml("ConfbridgeSetSingleVideoSrc", EVENT_FLAG_CALL, action_confbridgesetsinglevideosrc);
        res |= ast_manager_register_xml("ConfbridgeStartRecord", EVENT_FLAG_CALL, action_confbridgestartrecord);
        res |= ast_manager_register_xml("ConfbridgeStopRecord", EVENT_FLAG_CALL, action_confbridgestoprecord);
        res |= ast_manager_register_xml("ConfbridgeSetSingleVideoSrc", EVENT_FLAG_CALL, action_confbridgesetsinglevideosrc);
+       if (res) {
+               return AST_MODULE_LOAD_FAILURE;
+       }
 
 
-       res |= conf_load_config(0);
-
-       return res;
+       if (conf_load_config(0)) {
+               ast_log(LOG_ERROR, "Unable to load config. Not loading module.\n");
+               return AST_MODULE_LOAD_DECLINE;
+       }
+       return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int reload(void)
 }
 
 static int reload(void)