[svn-commits] bmd: branch group/newcdr r117662 - /team/group/newcdr/main/channel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 21 17:10:38 CDT 2008


Author: bmd
Date: Wed May 21 17:10:37 2008
New Revision: 117662

URL: http://svn.digium.com/view/asterisk?view=rev&rev=117662
Log:
slight optimization

Modified:
    team/group/newcdr/main/channel.c

Modified: team/group/newcdr/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/main/channel.c?view=diff&rev=117662&r1=117661&r2=117662
==============================================================================
--- team/group/newcdr/main/channel.c (original)
+++ team/group/newcdr/main/channel.c Wed May 21 17:10:37 2008
@@ -3773,13 +3773,17 @@
 	linkedid = OLDEST(linkedid, peer->uniqueid);
 	if (chan->_bridge) {
 		bridged = ast_bridged_channel(chan);
-		linkedid = OLDEST(linkedid, bridged->linkedid);
-		linkedid = OLDEST(linkedid, bridged->uniqueid);
+		if (bridged != peer) {
+			linkedid = OLDEST(linkedid, bridged->linkedid);
+			linkedid = OLDEST(linkedid, bridged->uniqueid);
+		}
 	}
 	if (peer->_bridge) {
 		bridged = ast_bridged_channel(peer);
-		linkedid = OLDEST(linkedid, bridged->linkedid);
-		linkedid = OLDEST(linkedid, bridged->uniqueid);
+		if (bridged != chan) {
+			linkedid = OLDEST(linkedid, bridged->linkedid);
+			linkedid = OLDEST(linkedid, bridged->uniqueid);
+		}
 	}
 
 	/* just in case setting a stringfield to itself causes problems */
@@ -3789,11 +3793,15 @@
 	ast_string_field_set(peer, linkedid, linkedid);
 	if (chan->_bridge) {
 		bridged = ast_bridged_channel(chan);
-		ast_string_field_set(bridged, linkedid, linkedid);
+		if (bridged != peer) {
+			ast_string_field_set(bridged, linkedid, linkedid);
+		}
 	}
 	if (peer->_bridge) {
 		bridged = ast_bridged_channel(peer);
-		ast_string_field_set(bridged, linkedid, linkedid);
+		if (bridged != chan) {
+			ast_string_field_set(bridged, linkedid, linkedid);
+		}
 	}
 }
   




More information about the svn-commits mailing list