[svn-commits] file: trunk r414976 - in /trunk: ./ bridges/bridge_native_rtp.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jun 1 10:32:37 CDT 2014


Author: file
Date: Sun Jun  1 10:32:34 2014
New Revision: 414976

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=414976
Log:
bridge_native_rtp: Take the bridge type choice of both channels into account.

The bridge_native_rtp module currently uses the bridge result of the first
channel that joins a bridge as the ultimate result. This means that if the
first channel has direct media enabled but the second does not a direct
media bridge will still occur.

This change makes it so that both sides are taken into account. If either
side forbids the bridge or responds with a local bridge result then
either a generic or local bridge occurs.

ASTERISK-23541 #close
Reported by: Justin E

Review: https://reviewboard.asterisk.org/r/3577/
........

Merged revisions 414975 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/bridges/bridge_native_rtp.c

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

Modified: trunk/bridges/bridge_native_rtp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/bridges/bridge_native_rtp.c?view=diff&rev=414976&r1=414975&r2=414976
==============================================================================
--- trunk/bridges/bridge_native_rtp.c (original)
+++ trunk/bridges/bridge_native_rtp.c Sun Jun  1 10:32:34 2014
@@ -103,13 +103,17 @@
 		audio_glue1_res = AST_RTP_GLUE_RESULT_FORBID;
 	}
 
-	/* If any sort of bridge is forbidden just completely bail out and go back to generic bridging */
-	if (audio_glue0_res == AST_RTP_GLUE_RESULT_FORBID
-		|| audio_glue1_res == AST_RTP_GLUE_RESULT_FORBID) {
+	/* The order of preference is: forbid, local, and remote. */
+	if (audio_glue0_res == AST_RTP_GLUE_RESULT_FORBID ||
+		audio_glue1_res == AST_RTP_GLUE_RESULT_FORBID) {
+		/* If any sort of bridge is forbidden just completely bail out and go back to generic bridging */
 		return AST_RTP_GLUE_RESULT_FORBID;
-	}
-
-	return audio_glue0_res;
+	} else if (audio_glue0_res == AST_RTP_GLUE_RESULT_LOCAL ||
+		audio_glue1_res == AST_RTP_GLUE_RESULT_LOCAL) {
+		return AST_RTP_GLUE_RESULT_LOCAL;
+	} else {
+		return AST_RTP_GLUE_RESULT_REMOTE;
+	}
 }
 
 /*!




More information about the svn-commits mailing list