From: Richard Mudgett Date: Fri, 10 Feb 2012 18:03:30 +0000 (+0000) Subject: Fix AMI Redirect ExtraChannel not redirecting to the same exten and context. X-Git-Tag: 1.8.11.0-rc1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ce7947aa69ac730119b2cfaaff33d508b54cf1d;p=thirdparty%2Fasterisk.git Fix AMI Redirect ExtraChannel not redirecting to the same exten and context. The astman_get_header() never returns NULL so the check by the code for NULL would never fail. (closes issue ASTERISK-16974) Reported by: Nuno Borges Patches: 0018325.patch (license #6116) patch uploaded by Nuno Borges (modified) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354835 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/manager.c b/main/manager.c index 249c6565af..77ed06f1fa 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3472,7 +3472,7 @@ static int action_redirect(struct mansession *s, const struct message *m) ast_set_flag(chan2, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */ ast_channel_unlock(chan2); } - if (context2) { + if (!ast_strlen_zero(context2)) { res = ast_async_goto(chan2, context2, exten2, pi2); } else { res = ast_async_goto(chan2, context, exten, pi); @@ -3492,10 +3492,7 @@ static int action_redirect(struct mansession *s, const struct message *m) astman_send_error(s, m, "Redirect failed"); } - if (chan) { - chan = ast_channel_unref(chan); - } - + chan = ast_channel_unref(chan); if (chan2) { chan2 = ast_channel_unref(chan2); }