aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-01 20:27:50 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-01 20:27:50 +0000
commit679808ef9fd335fcab98f2a909f2f5c2885caa65 (patch)
treee92101ef020a41ec987cb7bedcd8bc4267e25841 /channel.c
parent2ce67d8f8e0e6128e3c1962d6cf013bd0c0b11b3 (diff)
handle Zap transfers behind chan_agent properly so the agent doesn't get stuck waiting for the call to hang up
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@31520 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index 77ad5f34e..090174b70 100644
--- a/channel.c
+++ b/channel.c
@@ -2736,6 +2736,14 @@ int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clo
struct ast_frame null = { AST_FRAME_NULL, };
int res = -1;
+ /* each of these channels may be sitting behind a channel proxy (i.e. chan_agent)
+ and if so, we don't really want to masquerade it, but its proxy */
+ if (original->_bridge && (original->_bridge != ast_bridged_channel(original)))
+ original = original->_bridge;
+
+ if (clone->_bridge && (clone->_bridge != ast_bridged_channel(clone)))
+ clone = clone->_bridge;
+
if (original == clone) {
ast_log(LOG_WARNING, "Can't masquerade channel '%s' into itself!\n", original->name);
return -1;