]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix AMI Redirect ExtraChannel not redirecting to the same exten and context.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 10 Feb 2012 18:05:57 +0000 (18:05 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 10 Feb 2012 18:05:57 +0000 (18:05 +0000)
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)
........

Merged revisions 354835 from http://svn.asterisk.org/svn/asterisk/branches/1.8

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

main/manager.c

index 7b30ec02671b8c328b829765f67505cc23eb8423..bd1c8f0aeb9a64da58397f4a381e620534a38678 100644 (file)
@@ -3515,7 +3515,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);
@@ -3535,10 +3535,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);
        }