Remove the usage of the KeepAlive app, as it no longer exists.
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 10 Feb 2009 05:39:33 +0000 (05:39 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 10 Feb 2009 05:39:33 +0000 (05:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174470 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_stack.c

index 388f715..0edc6d1 100644 (file)
@@ -596,16 +596,14 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **arg
                int res;
 
                ast_debug(1, "Trying gosub with arguments '%s'\n", gosub_args);
                int res;
 
                ast_debug(1, "Trying gosub with arguments '%s'\n", gosub_args);
-               ast_copy_string(chan->context, "app_stack_gosub_virtual_context", sizeof(chan->context));
-               ast_copy_string(chan->exten, "s", sizeof(chan->exten));
-               chan->priority = 0;
 
                if ((res = pbx_exec(chan, theapp, gosub_args)) == 0) {
                        struct ast_pbx *pbx = chan->pbx;
 
                if ((res = pbx_exec(chan, theapp, gosub_args)) == 0) {
                        struct ast_pbx *pbx = chan->pbx;
+                       struct ast_pbx_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");
                        /* 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);
                        ast_agi_send(agi->fd, chan, "200 result=0 Gosub complete\n");
                        if (chan->pbx) {
                                ast_free(chan->pbx);
@@ -640,11 +638,8 @@ static int unload_module(void)
 {
        struct ast_context *con;
 
 {
        struct ast_context *con;
 
-       if (ast_agi_unregister && ast_agi_unregister(ast_module_info->self, &gosub_agi_command) == 1) {
-               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 */
-               }
+       if (ast_agi_unregister) {
+                ast_agi_unregister(ast_module_info->self, &gosub_agi_command);
        }
 
        ast_unregister_application(app_return);
        }
 
        ast_unregister_application(app_return);
@@ -661,13 +656,8 @@ static int load_module(void)
 {
        struct ast_context *con;
 
 {
        struct ast_context *con;
 
-       if (ast_agi_register && ast_agi_register(ast_module_info->self, &gosub_agi_command) == 1) {
-               if (!(con = ast_context_find_or_create(NULL, NULL, "app_stack_gosub_virtual_context", "app_stack"))) {
-                       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");
-               }
+       if (ast_agi_register) {
+                ast_agi_register(ast_module_info->self, &gosub_agi_command);
        }
 
        ast_register_application_xml(app_pop, pop_exec);
        }
 
        ast_register_application_xml(app_pop, pop_exec);