mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-07 15:19:24 -07:00
When optional_api is non-optional, force dependent modules to be loaded.
(closes issue #17707) Reported by: ira Patches: 20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14) Tested by: tilghman Review: https://reviewboard.asterisk.org/r/876/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
+5
-1
@@ -1591,4 +1591,8 @@ static int load_module(void)
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk ADSI Programming Application");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk ADSI Programming Application",
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.nonoptreq = "res_adsi",
|
||||
);
|
||||
|
||||
@@ -51,7 +51,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/cli.h"
|
||||
#include "asterisk/manager.h"
|
||||
#include "asterisk/config.h"
|
||||
#include "asterisk/monitor.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/causes.h"
|
||||
#include "asterisk/astdb.h"
|
||||
|
||||
+5
-1
@@ -132,4 +132,8 @@ static int load_module(void)
|
||||
return ast_register_application_xml(app, cpeid_exec);
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Get ADSI CPE ID");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Get ADSI CPE ID",
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.nonoptreq = "res_adsi",
|
||||
);
|
||||
|
||||
+2
-1
@@ -57,7 +57,7 @@
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_monitor</depend>
|
||||
<use>res_monitor</use>
|
||||
***/
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -8197,5 +8197,6 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "True Call Queueing",
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.load_pri = AST_MODPRI_DEVSTATE_CONSUMER,
|
||||
.nonoptreq = "res_monitor",
|
||||
);
|
||||
|
||||
|
||||
@@ -955,4 +955,8 @@ static int load_module(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Speech Applications");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Dialplan Speech Applications",
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.nonoptreq = "res_speech",
|
||||
);
|
||||
|
||||
+5
-1
@@ -704,4 +704,8 @@ static int load_module(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan subroutines (Gosub, Return, etc)");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Dialplan subroutines (Gosub, Return, etc)",
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.nonoptreq = "res_agi",
|
||||
);
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_smdi</depend>
|
||||
<use>res_adsi</use>
|
||||
<use>res_smdi</use>
|
||||
***/
|
||||
|
||||
/*** MAKEOPTS
|
||||
@@ -13085,4 +13086,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.nonoptreq = "res_adsi,res_smdi",
|
||||
);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
*/
|
||||
/*** MODULEINFO
|
||||
<depend>chan_local</depend>
|
||||
<depend>res_monitor</depend>
|
||||
***/
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -2484,4 +2485,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Agent Proxy Channel",
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
||||
.nonoptreq = "res_monitor,chan_local",
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_smdi</depend>
|
||||
<use>res_smdi</use>
|
||||
<depend>dahdi</depend>
|
||||
<depend>tonezone</depend>
|
||||
<use>pri</use>
|
||||
@@ -17916,4 +17916,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, tdesc,
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
||||
.nonoptreq = "res_smdi",
|
||||
);
|
||||
|
||||
@@ -14620,4 +14620,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Inter Asterisk eXchan
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
||||
.nonoptreq = "res_crypto",
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_pktccops</depend>
|
||||
<use>res_pktccops</use>
|
||||
***/
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -4915,4 +4915,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Media Gateway Control
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
||||
.nonoptreq = "res_pktccops",
|
||||
);
|
||||
|
||||
@@ -162,6 +162,7 @@
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_crypto</depend>
|
||||
<depend>chan_local</depend>
|
||||
***/
|
||||
|
||||
@@ -28589,4 +28590,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Session Initiation Pr
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
||||
.nonoptreq = "res_crypto,chan_local",
|
||||
);
|
||||
|
||||
+5
-1
@@ -163,4 +163,8 @@ static int load_module(void)
|
||||
return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "AES dialplan functions");
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "AES dialplan functions",
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.nonoptreq = "res_crypto",
|
||||
);
|
||||
|
||||
@@ -242,6 +242,11 @@ struct ast_module_info {
|
||||
* this value will never be read and the module will be given the lowest possible priority
|
||||
* on load. */
|
||||
unsigned char load_pri;
|
||||
|
||||
/*! Modules which should be loaded first, in comma-separated string format.
|
||||
* These are only required for loading, when the optional_api header file
|
||||
* detects that the compiler does not support the optional API featureset. */
|
||||
const char *nonoptreq;
|
||||
};
|
||||
|
||||
void ast_module_register(const struct ast_module_info *);
|
||||
|
||||
@@ -414,6 +414,26 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This section is a workaround for a gcc 4.1 bug that has already been
|
||||
* fixed in later versions. Unfortunately, some distributions, such as
|
||||
* RHEL/CentOS 5, distribute gcc 4.1, so we're stuck with having to deal
|
||||
* with this issue. This basically ensures that optional_api modules are
|
||||
* loaded before any module which requires their functionality. */
|
||||
#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref)
|
||||
if (!ast_strlen_zero(mod->info->nonoptreq)) {
|
||||
/* Force any required dependencies to load */
|
||||
char *each, *required_resource = ast_strdupa(mod->info->nonoptreq);
|
||||
while ((each = strsep(&required_resource, ","))) {
|
||||
each = ast_strip(each);
|
||||
|
||||
/* Is it already loaded? */
|
||||
if (!find_resource(each, 0)) {
|
||||
load_dynamic_module(each, global_symbols_only);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
while (!dlclose(lib));
|
||||
resource_being_loaded = NULL;
|
||||
|
||||
|
||||
@@ -4880,5 +4880,6 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Distributed Universal Nu
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
.nonoptreq = "res_crypto",
|
||||
);
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/sched.h"
|
||||
#include "asterisk/io.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/crypto.h"
|
||||
#include "asterisk/astdb.h"
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/sched.h"
|
||||
#include "asterisk/io.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/crypto.h"
|
||||
#include "asterisk/astdb.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/astobj2.h"
|
||||
|
||||
Reference in New Issue
Block a user