[asterisk-commits] branch 1.2 r31520 - in /branches/1.2: channel.c include/asterisk/channel.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jun 1 13:27:50 MST 2006


Author: kpfleming
Date: Thu Jun  1 15:27:50 2006
New Revision: 31520

URL: http://svn.digium.com/view/asterisk?rev=31520&view=rev
Log:
handle Zap transfers behind chan_agent properly so the agent doesn't get stuck waiting for the call to hang up

Modified:
    branches/1.2/channel.c
    branches/1.2/include/asterisk/channel.h

Modified: branches/1.2/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channel.c?rev=31520&r1=31519&r2=31520&view=diff
==============================================================================
--- branches/1.2/channel.c (original)
+++ branches/1.2/channel.c Thu Jun  1 15:27:50 2006
@@ -2736,6 +2736,14 @@
 	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;

Modified: branches/1.2/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/branches/1.2/include/asterisk/channel.h?rev=31520&r1=31519&r2=31520&view=diff
==============================================================================
--- branches/1.2/include/asterisk/channel.h (original)
+++ branches/1.2/include/asterisk/channel.h Thu Jun  1 15:27:50 2006
@@ -275,8 +275,9 @@
 	/*! 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;		



More information about the asterisk-commits mailing list