diff options
author | dhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-27 23:18:09 +0000 |
---|---|---|
committer | dhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-27 23:18:09 +0000 |
commit | c2fe27f94a9ff2b308a4a0684685a72300001614 (patch) | |
tree | 93e535ac6b969988cbf179ab054f2990c99b233a /main | |
parent | 40b58d2a336f08fb717af9d16dbfaa9801b04772 (diff) |
Merged revisions 84018 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84018 | dhubbard | 2007-09-27 18:12:25 -0500 (Thu, 27 Sep 2007) | 1 line
if an Agent is redirected, the base channel should actually be redirected. This was causing multiple issues, especially issue 7706 and BE-160
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84019 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/manager.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/main/manager.c b/main/manager.c index 83e9c826d..ff628242d 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1787,7 +1787,7 @@ static int action_redirect(struct mansession *s, const struct message *m) const char *exten = astman_get_header(m, "Exten"); const char *context = astman_get_header(m, "Context"); const char *priority = astman_get_header(m, "Priority"); - struct ast_channel *chan, *chan2 = NULL; + struct ast_channel *base, *chan, *chan2 = NULL; int pi = 0; int res; @@ -1809,6 +1809,14 @@ static int action_redirect(struct mansession *s, const struct message *m) astman_send_error(s, m, buf); return 0; } + if (chan->tech->get_base_channel) { + base = chan->tech->get_base_channel(chan); + if (base) { + ast_mutex_unlock(&chan->lock); + chan = base; + ast_mutex_lock(&chan->lock); + } + } if (ast_check_hangup(chan)) { astman_send_error(s, m, "Redirect failed, channel not up.\n"); ast_channel_unlock(chan); @@ -1822,6 +1830,14 @@ static int action_redirect(struct mansession *s, const struct message *m) ast_channel_unlock(chan2); return 0; } + if (chan2 && chan2->tech->get_base_channel) { + base = chan2->tech->get_base_channel(chan2); + if (base) { + ast_mutex_unlock(&chan2->lock); + chan2 = base; + ast_mutex_lock(&chan2->lock); + } + } res = ast_async_goto(chan, context, exten, pi); if (!res) { if (!ast_strlen_zero(name2)) { |