merge new_loader_completion branch, including (at least):

- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-08-21 02:11:39 +00:00
parent f60ada0be2
commit 0a27d8bfe5
398 changed files with 5967 additions and 7194 deletions

View File

@@ -140,7 +140,6 @@ AST_APP_OPTIONS(spy_opts, {
AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
});
LOCAL_USER_DECL;
struct chanspy_translation_helper {
/* spy data */
@@ -540,7 +539,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
static int chanspy_exec(struct ast_channel *chan, void *data)
{
struct localuser *u;
struct ast_module_user *u;
char *options = NULL;
char *spec = NULL;
char *argv[2];
@@ -555,7 +554,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
data = ast_strdupa(data);
LOCAL_USER_ADD(u);
u = ast_module_user_add(chan);
if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
spec = argv[0];
@@ -593,7 +592,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
oldwf = chan->writeformat;
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
LOCAL_USER_REMOVE(u);
ast_module_user_remove(u);
return -1;
}
@@ -615,14 +614,14 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
if (oldwf && ast_set_write_format(chan, oldwf) < 0)
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
LOCAL_USER_REMOVE(u);
ast_module_user_remove(u);
return res;
}
static int extenspy_exec(struct ast_channel *chan, void *data)
{
struct localuser *u;
struct ast_module_user *u;
char *options = NULL;
char *exten = NULL;
char *context = NULL;
@@ -638,7 +637,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
data = ast_strdupa(data);
LOCAL_USER_ADD(u);
u = ast_module_user_add(chan);
if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
context = argv[0];
@@ -676,7 +675,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
oldwf = chan->writeformat;
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
LOCAL_USER_REMOVE(u);
ast_module_user_remove(u);
return -1;
}
@@ -698,43 +697,31 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
if (oldwf && ast_set_write_format(chan, oldwf) < 0)
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
LOCAL_USER_REMOVE(u);
ast_module_user_remove(u);
return res;
}
static int unload_module(void *mod)
static int unload_module(void)
{
int res = 0;
res |= ast_unregister_application(app_chan);
res |= ast_unregister_application(app_ext);
STANDARD_HANGUP_LOCALUSERS;
ast_module_user_hangup_all();
return res;
}
static int load_module(void *mod)
static int load_module(void)
{
int res = 0;
__mod_desc = mod;
res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan);
res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext);
return res;
}
static const char *description(void)
{
return (char *) tdesc;
}
static const char *key(void)
{
return ASTERISK_GPL_KEY;
}
STD_MOD(MOD_1, NULL, NULL, NULL);
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Listen to the audio of an active channel");