[asterisk-commits] rmudgett: branch rmudgett/native_dahdi r394467 - /team/rmudgett/native_dahdi/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 16 13:14:31 CDT 2013


Author: rmudgett
Date: Tue Jul 16 13:14:29 2013
New Revision: 394467

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394467
Log:
Address the remaining native dahdi bridge BUGBUG notes.

Modified:
    team/rmudgett/native_dahdi/channels/dahdi/bridge_native_dahdi.c

Modified: team/rmudgett/native_dahdi/channels/dahdi/bridge_native_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/native_dahdi/channels/dahdi/bridge_native_dahdi.c?view=diff&rev=394467&r1=394466&r2=394467
==============================================================================
--- team/rmudgett/native_dahdi/channels/dahdi/bridge_native_dahdi.c (original)
+++ team/rmudgett/native_dahdi/channels/dahdi/bridge_native_dahdi.c Tue Jul 16 13:14:29 2013
@@ -256,6 +256,7 @@
 	}
 
 	npc0 = bc0->tech_pvt;
+	ast_assert(npc0 != NULL);
 	npc0->pvt = p0;
 	npc0->owner = p0->owner;
 	npc0->index = dahdi_get_index(c0, p0, 0);
@@ -264,6 +265,7 @@
 	npc0->inthreeway = p0->subs[SUB_REAL].inthreeway;
 
 	npc1 = bc1->tech_pvt;
+	ast_assert(npc1 != NULL);
 	npc1->pvt = p1;
 	npc1->owner = p1->owner;
 	npc1->index = dahdi_get_index(c1, p1, 0);
@@ -564,6 +566,8 @@
 static int native_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
 {
 	struct native_pvt_chan *tech_pvt;
+	struct ast_channel *c0;
+	struct ast_channel *c1;
 
 	ast_assert(!bridge_channel->tech_pvt);
 
@@ -572,14 +576,20 @@
 		return -1;
 	}
 
-/* BUGBUG is the following true about DAHDI channels? */
-	/*
-	 * Since this bridge only serves DAHDI channels, we don't need
-	 * to make them compatible.
-	 */
-
 	bridge_channel->tech_pvt = tech_pvt;
 	native_request_start(bridge);
+
+	c0 = AST_LIST_FIRST(&bridge->channels)->chan;
+	c1 = AST_LIST_LAST(&bridge->channels)->chan;
+	if (c0 != c1) {
+		/*
+		 * Make the channels compatible in case the native bridge did
+		 * not start for some reason and we need to fallback to 1-1
+		 * bridging.
+		 */
+		ast_channel_make_compatible(c0, c1);
+	}
+
 	return 0;
 }
 
@@ -909,12 +919,11 @@
 	if (!native_bridge.format_capabilities) {
 		return -1;
 	}
-/*
- * BUGBUG may not need to specify specific formats supported by DAHDI.
- *
- * This is only used to make channels compatible with the bridge
- * itself in multi-party bridges.
- */
+
+	/*
+	 * This is used to make channels compatible with the bridge
+	 * itself not with each other.
+	 */
 	ast_format_cap_add(native_bridge.format_capabilities, ast_format_set(&format, AST_FORMAT_SLINEAR, 0));
 	ast_format_cap_add(native_bridge.format_capabilities, ast_format_set(&format, AST_FORMAT_ULAW, 0));
 	ast_format_cap_add(native_bridge.format_capabilities, ast_format_set(&format, AST_FORMAT_ALAW, 0));




More information about the asterisk-commits mailing list