extern char ast_config_AST_SYSTEM_NAME[20];
int ast_set_priority(int); /*!< Provided by asterisk.c */
-int load_modules(void); /*!< Provided by loader.c */
+int load_modules(unsigned int); /*!< Provided by loader.c */
int load_pbx(void); /*!< Provided by pbx.c */
int init_logger(void); /*!< Provided by logger.c */
void close_logger(void); /*!< Provided by logger.c */
return order;
}
-int load_modules(void)
+int load_modules(unsigned int preload_only)
{
struct ast_config *cfg;
struct ast_module *mod;
AST_LIST_HEAD_INIT_NOLOCK(&load_order);
- /* first, find all the modules we have been explicitly requested to load */
- for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
- if (!strcasecmp(v->name, "load"))
- add_to_load_order(v->value, &load_order);
+ if (preload_only) {
+ /* first, find all the modules we have been explicitly requested to load */
+ for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
+ if (!strcasecmp(v->name, "preload"))
+ add_to_load_order(v->value, &load_order);
+ }
+ } else {
+ /* first, find all the modules we have been explicitly requested to load */
+ for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
+ if (!strcasecmp(v->name, "load"))
+ add_to_load_order(v->value, &load_order);
+ }
}
/* check if 'autoload' is on */
- if (ast_true(ast_variable_retrieve(cfg, "modules", "autoload"))) {
+ if (!preload_only && ast_true(ast_variable_retrieve(cfg, "modules", "autoload"))) {
/* if so, first add all the embedded modules to the load order */
AST_LIST_TRAVERSE(&module_list, mod, entry) {
order = add_to_load_order(mod->resource, &load_order);