]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 166861 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Mon, 29 Dec 2008 18:15:22 +0000 (18:15 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 29 Dec 2008 18:15:22 +0000 (18:15 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
r166861 | mmichelson | 2008-12-29 12:04:52 -0600 (Mon, 29 Dec 2008) | 14 lines

Update app_queue to deal with the removal of AST_PBX_KEEPALIVE

When placing a call to a queue which ran a gosub on the member's
channel, Asterisk would crash every time, stemming from the fact
that the member's channel was being hung up unexpectedly when the
Gosub completed. The necessary change was pretty much copied and
pasted from app_dial's similar changes made last week.

I also took the opportunity to change a LOG_DEBUG message in
app_dial to use ast_debug. I am guessing this was due to a direct
merge from 1.4 that was not corrected to use trunk's preferred
syntax.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@166862 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
apps/app_queue.c

index d676fb5f51e95e6b155c25065ebfb6c2ecb2652e..c4ba1910304ad04f3141e68a9bf81e9fa4214833 100644 (file)
@@ -1840,8 +1840,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                                                ast_pbx_run_args(peer, &args);
                                        }
                                        ast_free(gosub_args);
-                                       if (option_debug)
-                                               ast_log(LOG_DEBUG, "Gosub exited with status %d\n", res);
+                                       ast_debug(1, "Gosub exited with status %d\n", res);
                                } else {
                                        ast_log(LOG_ERROR, "Could not Allocate string for Gosub arguments -- Gosub Call Aborted!\n");
                                }
index 8870cff1e1c96266f932caeabe3bd17fe4927691..9eb7128c31281fe7367bd1ba236b3839b9eb1cdb 100644 (file)
@@ -3803,9 +3803,12 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                                if (gosub_args) {
                                        res = pbx_exec(peer, app, gosub_args);
                                        if (!res) {
-                                               ast_pbx_run(peer);
+                                               struct ast_pbx_args args;
+                                               memset(&args, 0, sizeof(args));
+                                               args.no_hangup_chan = 1;
+                                               ast_pbx_run_args(peer, &args);
                                        }
-                                       free(gosub_args);
+                                       ast_free(gosub_args);
                                        if (option_debug)
                                                ast_log(LOG_DEBUG, "Gosub exited with status %d\n", res);
                                } else {
@@ -6536,7 +6539,7 @@ static int load_module(void)
        if (!con)
                ast_log(LOG_ERROR, "Queue virtual context 'app_queue_gosub_virtual_context' does not exist and unable to create\n");
        else
-               ast_add_extension2(con, 1, "s", 1, NULL, NULL, "KeepAlive", ast_strdup(""), ast_free_ptr, "app_queue");
+               ast_add_extension2(con, 1, "s", 1, NULL, NULL, "NoOp", ast_strdup(""), ast_free_ptr, "app_queue");
 
        if (queue_persistent_members)
                reload_queue_members();