diff options
author | dhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-01 21:31:16 +0000 |
---|---|---|
committer | dhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-01 21:31:16 +0000 |
commit | ca893376226bccf0bc65ad0234b6271b7c4f1242 (patch) | |
tree | 43e15f9601c5a8f7be3dac725f53b0abc215ab2f /main | |
parent | d2715cdd411ed092e536d567275b6e86f4642c7c (diff) |
Merged revisions 84274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84274 | dhubbard | 2007-10-01 16:25:37 -0500 (Mon, 01 Oct 2007) | 1 line
moved get_base_channel() code from action_redirect to ast_channel_masquerade() for issue 7706 and BE-160
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84275 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 6 | ||||
-rw-r--r-- | main/manager.c | 18 |
2 files changed, 6 insertions, 18 deletions
diff --git a/main/channel.c b/main/channel.c index e11afe9d4..1976e111a 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3333,7 +3333,7 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone) { int res = -1; - struct ast_channel *final_orig, *final_clone; + struct ast_channel *final_orig, *final_clone, *base; retrymasq: final_orig = original; @@ -3353,6 +3353,10 @@ retrymasq: if (clone->_bridge && (clone->_bridge != ast_bridged_channel(clone)) && (clone->_bridge->_bridge != clone)) final_clone = clone->_bridge; + + if (final_clone->tech->get_base_channel && (base = final_clone->tech->get_base_channel(final_clone))) { + final_clone = base; + } if ((final_orig != original) || (final_clone != clone)) { /* Lots and lots of deadlock avoidance. The main one we're competing with diff --git a/main/manager.c b/main/manager.c index ff628242d..83e9c826d 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 *base, *chan, *chan2 = NULL; + struct ast_channel *chan, *chan2 = NULL; int pi = 0; int res; @@ -1809,14 +1809,6 @@ 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); @@ -1830,14 +1822,6 @@ 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)) { |