diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-01 21:05:20 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-01 21:05:20 +0000 |
commit | 753d04597224cca1e69bd4224012c92af62e1504 (patch) | |
tree | e7951e6f2edb34d1feecdb81d1966519bd2af8a0 | |
parent | 5ca5decbf3b74d3a7d21cfd3b32f119de3cc8387 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@31551 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channel.c | 8 | ||||
-rw-r--r-- | include/asterisk/channel.h | 5 |
2 files changed, 11 insertions, 2 deletions
@@ -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; diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 11fb0a7d0..ae2f7a781 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -275,8 +275,9 @@ struct ast_channel { /*! Current active data generator */ struct ast_generator *generator; - /*! Who are we bridged to, if we're bridged Do not access directly, - use ast_bridged_channel(chan) */ + /*! Who are we bridged to, if we're bridged. Who is proxying for us, + if we are proxied (i.e. chan_agent). + Do not access directly, use ast_bridged_channel(chan) */ struct ast_channel *_bridge; /*! Channel that will masquerade as us */ struct ast_channel *masq; |