diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-02 17:58:20 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-02 17:58:20 +0000 |
commit | 6663041f625ad89a4393bb74130c237f4d7d3c24 (patch) | |
tree | e1c5d6b5d71bc324a5821b5b54e258fdf93e1db2 /apps | |
parent | 293aacfd53603c09df08f49c96fb1715044f29e8 (diff) |
KeepAlive application no longer exists, so fix gosub implementation to not use it.
(closes issue #14571)
Reported by: zktech
Patches:
20090302__bug14571.diff.txt uploaded by tilghman (license 14)
Tested by: tilghman
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@179363 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_stack.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/apps/app_stack.c b/apps/app_stack.c index 9fc3fe385..7e4ac691c 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -464,10 +464,13 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **arg if ((res = pbx_exec(chan, theapp, gosub_args)) == 0) { struct ast_pbx *pbx = chan->pbx; + struct ast_pbx_args args; + memset(&args, 0, sizeof(args)); + args.no_hangup_chan = 1; /* Suppress warning about PBX already existing */ chan->pbx = NULL; ast_agi_send(agi->fd, chan, "100 result=0 Trying...\n"); - ast_pbx_run(chan); + ast_pbx_run_args(chan, &args); ast_agi_send(agi->fd, chan, "200 result=0 Gosub complete\n"); if (chan->pbx) { ast_free(chan->pbx); @@ -500,15 +503,8 @@ struct agi_command gosub_agi_command = static int unload_module(void) { - struct ast_context *con; - if (ast_agi_unregister) { ast_agi_unregister(ast_module_info->self, &gosub_agi_command); - - if ((con = ast_context_find("app_stack_gosub_virtual_context"))) { - ast_context_remove_extension2(con, "s", 1, NULL, 0); - ast_context_destroy(con, "app_stack"); /* leave nothing behind */ - } } ast_unregister_application(app_return); @@ -522,20 +518,10 @@ static int unload_module(void) static int load_module(void) { - struct ast_context *con; - /* usage of AGI is optional, so check to see if the ast_agi_register() function is available; if so, use it. */ if (ast_agi_register) { - con = ast_context_find_or_create(NULL, NULL, "app_stack_gosub_virtual_context", "app_stack"); - if (!con) { - ast_log(LOG_ERROR, "Virtual context 'app_stack_gosub_virtual_context' does not exist and unable to create\n"); - return AST_MODULE_LOAD_DECLINE; - } else { - ast_add_extension2(con, 1, "s", 1, NULL, NULL, "KeepAlive", ast_strdup(""), ast_free_ptr, "app_stack"); - } - ast_agi_register(ast_module_info->self, &gosub_agi_command); } |