[asterisk-commits] mmichelson: branch 11 r381306 - in /branches/11: ./ main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 12 14:31:59 CST 2013


Author: mmichelson
Date: Tue Feb 12 14:31:52 2013
New Revision: 381306

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381306
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

Modified:
    branches/11/   (props changed)
    branches/11/main/rtp_engine.c

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

Modified: branches/11/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/rtp_engine.c?view=diff&rev=381306&r1=381305&r2=381306
==============================================================================
--- branches/11/main/rtp_engine.c (original)
+++ branches/11/main/rtp_engine.c Tue Feb 12 14:31:52 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;
@@ -1564,6 +1565,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 asterisk-commits mailing list