[asterisk-commits] trunk r33643 - in /trunk: ./ channels/chan_local.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jun 12 09:07:33 MST 2006


Author: kpfleming
Date: Mon Jun 12 11:07:32 2006
New Revision: 33643

URL: http://svn.digium.com/view/asterisk?rev=33643&view=rev
Log:
Merged revisions 33638 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r33638 | kpfleming | 2006-06-12 11:03:29 -0500 (Mon, 12 Jun 2006) | 2 lines

only allow chan_local to masquerade the outbound channel onto its owner, instead of the other way around (this will ensure that group variables on the outbound channel as preserved)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_local.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?rev=33643&r1=33642&r2=33643&view=diff
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Mon Jun 12 11:07:32 2006
@@ -211,7 +211,13 @@
 		return;
 	if (!p->chan || !p->owner)
 		return;
-	if (isoutbound&& p->chan->_bridge /* Not ast_bridged_channel!  Only go one step! */ && !p->owner->readq) {
+
+	/* only do the masquerade if we are being called on the outbound channel,
+	   if it has been bridged to another channel and if there are no pending
+	   frames on the owner channel (because they would be transferred to the
+	   outbound channel during the masquerade)
+	*/
+	if (isoutbound && p->chan->_bridge /* Not ast_bridged_channel!  Only go one step! */ && !p->owner->readq) {
 		/* Masquerade bridged channel into owner */
 		/* Lock everything we need, one by one, and give up if
 		   we can't get everything.  Remember, we'll get another
@@ -228,6 +234,11 @@
 				ast_mutex_unlock(&(p->chan->_bridge)->lock);
 			}
 		}
+	/* We only allow masquerading in one 'direction'... it's important to preserve the state
+	   (group variables, etc.) that live on p->chan->_bridge (and were put there by the dialplan)
+	   when the local channels go away.
+	*/
+#if 0
 	} else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && !p->chan->readq) {
 		/* Masquerade bridged channel into chan */
 		if (!ast_mutex_trylock(&(p->owner->_bridge)->lock)) {
@@ -242,6 +253,7 @@
 			}
 			ast_mutex_unlock(&(p->owner->_bridge)->lock);
 		}
+#endif
 	}
 }
 



More information about the asterisk-commits mailing list