[svn-commits] mmichelson: trunk r381307 - in /trunk: ./ main/rtp_engine.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 12 14:57:35 CST 2013


Author: mmichelson
Date: Tue Feb 12 14:57:31 2013
New Revision: 381307

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381307
Log:
Do not allow native RTP bridging if packetization of media streams differs.

The RTP engine will no longer allow for local and remote native RTP bridges
if packetization of streams differs. Allowing native bridging in this scenario
has been known to cause FAX failures.

(closes ASTERISK-20650)
Reported by: Maciej Krajewski
Patches:
	ASTERISK-20659.patch uploaded by Mark Michelson (License #5049)

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

Merged revisions 381281 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 381306 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/main/rtp_engine.c

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

Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=381307&r1=381306&r2=381307
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Tue Feb 12 14:57:31 2013
@@ -1460,6 +1460,7 @@
 	struct ast_format_cap *cap0 = ast_format_cap_alloc_nolock();
 	struct ast_format_cap *cap1 = ast_format_cap_alloc_nolock();
 	int unlock_chans = 1;
+	int read_ptime0, read_ptime1, write_ptime0, write_ptime1;
 
 	if (!cap0 || !cap1) {
 		unlock_chans = 0;
@@ -1563,6 +1564,18 @@
 		ast_debug(1, "Channel codec0 = %s is not codec1 = %s, cannot native bridge in RTP.\n",
 			ast_getformatname_multiple(tmp0, sizeof(tmp0), cap0),
 			ast_getformatname_multiple(tmp1, sizeof(tmp1), cap1));
+		res = AST_BRIDGE_FAILED_NOWARN;
+		goto done;
+	}
+
+	read_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, ast_channel_rawreadformat(c0))).cur_ms;
+	read_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, ast_channel_rawreadformat(c1))).cur_ms;
+	write_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, ast_channel_rawwriteformat(c0))).cur_ms;
+	write_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, ast_channel_rawwriteformat(c1))).cur_ms;
+
+	if (read_ptime0 != write_ptime1 || read_ptime1 != write_ptime0) {
+		ast_debug(1, "Packetization differs between RTP streams (%d != %d or %d != %d). Cannot native bridge in RTP\n",
+				read_ptime0, write_ptime1, read_ptime1, write_ptime0);
 		res = AST_BRIDGE_FAILED_NOWARN;
 		goto done;
 	}




More information about the svn-commits mailing list