summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2018-02-16 22:11:42 -0500
committerCorey Farrell <git@cfware.com>2018-03-14 05:20:12 -0400
commit572a508ef2ae7cd86e0ffd8ad6d1c5997e988c26 (patch)
treea0dcfa18f8a4a9d3e87eac3b2a7df33ac2fbcad6 /res
parentfee929c8acd788a77982b537953bf4053242057e (diff)
loader: Convert reload_classes to built-in modules.
* acl (named_acl.c) * cdr * cel * ccss * dnsmgr * dsp * enum * extconfig (config.c) * features * http * indications * logger * manager * plc * sounds * udptl These modules are now loaded at appropriate time by the module loader. Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so the module loader will abort startup on failure of these modules. Some of these modules are still initialized or shutdown from outside the module loader. logger.c is initialized very early and shutdown very late, manager.c is initialized by the module loader but is shutdown by the Asterisk core (too much uses it without holding references). Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
Diffstat (limited to 'res')
-rw-r--r--res/res_ari.c2
-rw-r--r--res/res_config_curl.c2
-rw-r--r--res/res_config_ldap.c1
-rw-r--r--res/res_config_odbc.c1
-rw-r--r--res/res_config_pgsql.c1
-rw-r--r--res/res_config_sqlite.c7
-rw-r--r--res/res_config_sqlite3.c1
-rw-r--r--res/res_http_post.c1
-rw-r--r--res/res_http_websocket.c1
-rw-r--r--res/res_phoneprov.c1
-rw-r--r--res/res_pjsip.c2
-rw-r--r--res/res_pjsip_t38.c2
12 files changed, 18 insertions, 4 deletions
diff --git a/res/res_ari.c b/res/res_ari.c
index 5ffb5833f..354201bf3 100644
--- a/res/res_ari.c
+++ b/res/res_ari.c
@@ -1196,6 +1196,6 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_
.unload = unload_module,
.reload = reload_module,
.optional_modules = "res_http_websocket",
- .requires = "res_stasis",
+ .requires = "http,res_stasis",
.load_pri = AST_MODPRI_APP_DEPEND,
);
diff --git a/res/res_config_curl.c b/res/res_config_curl.c
index 03f0338cc..03ff80c2e 100644
--- a/res/res_config_curl.c
+++ b/res/res_config_curl.c
@@ -650,5 +650,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Realtime Curl configu
.unload = unload_module,
.reload = reload_module,
.load_pri = AST_MODPRI_REALTIME_DRIVER,
- .requires = "res_curl,func_curl",
+ .requires = "extconfig,res_curl,func_curl",
);
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index 15d9ec018..d73f42b11 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -1999,4 +1999,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "LDAP realtime interfa
.unload = unload_module,
.reload = reload,
.load_pri = AST_MODPRI_REALTIME_DRIVER,
+ .requires = "extconfig",
);
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c
index 5d6c2c60a..be920d673 100644
--- a/res/res_config_odbc.c
+++ b/res/res_config_odbc.c
@@ -1238,4 +1238,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Realtime ODBC configu
.unload = unload_module,
.reload = reload_module,
.load_pri = AST_MODPRI_REALTIME_DRIVER,
+ .requires = "extconfig,res_odbc",
);
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c
index c259b30c1..c8660fb3a 100644
--- a/res/res_config_pgsql.c
+++ b/res/res_config_pgsql.c
@@ -1720,4 +1720,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PostgreSQL RealTime C
.unload = unload_module,
.reload = reload,
.load_pri = AST_MODPRI_REALTIME_DRIVER,
+ .requires = "extconfig",
);
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index af3b12449..323d2249b 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -1772,9 +1772,16 @@ static int load_module(void)
return AST_MODULE_LOAD_SUCCESS;
}
+/*
+ * This module should require "cdr" to enforce startup/shutdown ordering but it
+ * loads at REALTIME_DRIVER priority which would cause "cdr" to load too early.
+ *
+ * ast_cdr_register / ast_cdr_unregister is safe for use while "cdr" is not running.
+ */
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Realtime SQLite configuration",
.support_level = AST_MODULE_SUPPORT_DEPRECATED,
.load = load_module,
.unload = unload_module,
.load_pri = AST_MODPRI_REALTIME_DRIVER,
+ .requires = "extconfig",
);
diff --git a/res/res_config_sqlite3.c b/res/res_config_sqlite3.c
index de2de1ce4..854034f38 100644
--- a/res/res_config_sqlite3.c
+++ b/res/res_config_sqlite3.c
@@ -1393,4 +1393,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SQLite 3 realtime con
.unload = unload_module,
.reload = reload,
.load_pri = AST_MODPRI_REALTIME_DRIVER,
+ .requires = "extconfig",
);
diff --git a/res/res_http_post.c b/res/res_http_post.c
index f36b772d4..bf404ced6 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -513,4 +513,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "HTTP POST support",
.load = load_module,
.unload = unload_module,
.reload = reload,
+ .requires = "http",
);
diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index 223bb2dd8..9a32bf37c 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -1478,4 +1478,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_
.load = load_module,
.unload = unload_module,
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
+ .requires = "http",
);
diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c
index 585056b75..70e133328 100644
--- a/res/res_phoneprov.c
+++ b/res/res_phoneprov.c
@@ -1498,6 +1498,7 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_
.unload = unload_module,
.reload = reload,
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
+ .requires = "http",
);
/**** Public API for register/unregister, set defaults, and add extension. ****/
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 9f6b5d115..935a5598e 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -5213,6 +5213,6 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_
.unload = unload_module,
.reload = reload_module,
.load_pri = AST_MODPRI_CHANNEL_DEPEND - 5,
- .requires = "res_pjproject",
+ .requires = "dnsmgr,res_pjproject",
.optional_modules = "res_statsd",
);
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 249472ba9..333295fe6 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -1048,5 +1048,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP T.38 UDPTL Supp
.load = load_module,
.unload = unload_module,
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
- .requires = "res_pjsip,res_pjsip_session",
+ .requires = "res_pjsip,res_pjsip_session,udptl",
);