[asterisk-commits] oej: branch oej/teapot-1.8 r402275 - in /team/oej/teapot-1.8: configs/ patche...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 31 05:07:24 CDT 2013


Author: oej
Date: Thu Oct 31 05:07:22 2013
New Revision: 402275

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402275
Log:
Adding a small patch from ASTERISK-20098 for testing

Added:
    team/oej/teapot-1.8/patches/p2pbridge.diff   (with props)
Modified:
    team/oej/teapot-1.8/configs/rtp.conf.sample
    team/oej/teapot-1.8/res/res_rtp_asterisk.c

Modified: team/oej/teapot-1.8/configs/rtp.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/configs/rtp.conf.sample?view=diff&rev=402275&r1=402274&r2=402275
==============================================================================
--- team/oej/teapot-1.8/configs/rtp.conf.sample (original)
+++ team/oej/teapot-1.8/configs/rtp.conf.sample Thu Oct 31 05:07:22 2013
@@ -3,6 +3,10 @@
 ;
 [general]
 ;
+; Set to off to always disable p2pbridge
+;
+p2pbridge = TRUE
+
 ; RTP start and RTP end configure start and end addresses
 ;
 ; Defaults are rtpstart=5000 and rtpend=31000

Added: team/oej/teapot-1.8/patches/p2pbridge.diff
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/patches/p2pbridge.diff?view=auto&rev=402275
==============================================================================
--- team/oej/teapot-1.8/patches/p2pbridge.diff (added)
+++ team/oej/teapot-1.8/patches/p2pbridge.diff Thu Oct 31 05:07:22 2013
@@ -1,0 +1,54 @@
+--- res/res_rtp_asterisk.c	2012-07-09 08:28:38.000000000 +0200
++++ res/res_rtp_asterisk.c	2012-07-09 08:50:07.000000000 +0200
+@@ -99,6 +99,7 @@
+ static int nochecksums;
+ #endif
+ static int strictrtp;			/*< Only accept RTP frames from a defined source. If we receive an indication of a changing source, enter learning mode. */
++static int p2pbridge;			/*< Enable/disable P2P briding */
+ static int learning_min_sequential;	/*< Number of sequential RTP frames needed from a single source during learning mode to accept new source. */
+ 
+ enum strict_rtp_state {
+@@ -107,6 +108,8 @@
+ 	STRICT_RTP_CLOSED,   /*! Drop all RTP packets not coming from source that was learned */
+ };
+ 
++#define P2PBRIDGE_OPEN 1
++
+ #define FLAG_3389_WARNING               (1 << 0)
+ #define FLAG_NAT_ACTIVE                 (3 << 1)
+ #define FLAG_NAT_INACTIVE               (0 << 1)
+@@ -2219,10 +2222,12 @@
+ 					  ast_sockaddr_stringify(&remote_address));
+ 		}
+ 	}
+-
+-	/* If we are directly bridged to another instance send the audio directly out */
+-	if (ast_rtp_instance_get_bridged(instance) && !bridge_p2p_rtp_write(instance, rtpheader, res, hdrlen)) {
+-		return &ast_null_frame;
++	
++	if(p2pbridge){
++		/* If we are directly bridged to another instance send the audio directly out */
++		if (ast_rtp_instance_get_bridged(instance) && !bridge_p2p_rtp_write(instance, rtpheader, res, hdrlen)) {
++			return &ast_null_frame;
++		}
+ 	}
+ 
+ 	/* If the version is not what we expected by this point then just drop the packet */
+@@ -2960,6 +2965,7 @@
+ 	rtpend = DEFAULT_RTP_END;
+ 	dtmftimeout = DEFAULT_DTMF_TIMEOUT;
+ 	strictrtp = STRICT_RTP_OPEN;
++	p2pbridge = P2PBRIDGE_OPEN;
+ 	learning_min_sequential = DEFAULT_LEARNING_MIN_SEQUENTIAL;
+ 	if (cfg) {
+ 		if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
+@@ -3004,6 +3010,9 @@
+ 		if ((s = ast_variable_retrieve(cfg, "general", "strictrtp"))) {
+ 			strictrtp = ast_true(s);
+ 		}
++		if ((s = ast_variable_retrieve(cfg, "general", "p2pbridge"))) {
++			p2pbridge = ast_true(s);
++		}
+ 		if ((s = ast_variable_retrieve(cfg, "general", "probation"))) {
+ 			if ((sscanf(s, "%d", &learning_min_sequential) <= 0) || learning_min_sequential <= 0) {
+ 				ast_log(LOG_WARNING, "Value for 'probation' could not be read, using default of '%d' instead\n",

Propchange: team/oej/teapot-1.8/patches/p2pbridge.diff
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/oej/teapot-1.8/patches/p2pbridge.diff
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/teapot-1.8/patches/p2pbridge.diff
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/oej/teapot-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/res/res_rtp_asterisk.c?view=diff&rev=402275&r1=402274&r2=402275
==============================================================================
--- team/oej/teapot-1.8/res/res_rtp_asterisk.c (original)
+++ team/oej/teapot-1.8/res/res_rtp_asterisk.c Thu Oct 31 05:07:22 2013
@@ -100,6 +100,7 @@
 static int nochecksums;
 #endif
 static int strictrtp;			/*< Only accept RTP frames from a defined source. If we receive an indication of a changing source, enter learning mode. */
+static int p2pbridge;			/*< Enable/disable P2P briding */
 static int learning_min_sequential;	/*< Number of sequential RTP frames needed from a single source during learning mode to accept new source. */
 
 enum strict_rtp_state {
@@ -107,6 +108,8 @@
 	STRICT_RTP_LEARN,    /*! Accept next packet as source */
 	STRICT_RTP_CLOSED,   /*! Drop all RTP packets not coming from source that was learned */
 };
+
+#define P2PBRIDGE_OPEN 1
 
 #define FLAG_3389_WARNING               (1 << 0)
 #define FLAG_NAT_ACTIVE                 (3 << 1)
@@ -2253,10 +2256,12 @@
 					  ast_sockaddr_stringify(&remote_address));
 		}
 	}
-
-	/* If we are directly bridged to another instance send the audio directly out */
-	if (ast_rtp_instance_get_bridged(instance) && !bridge_p2p_rtp_write(instance, rtpheader, res, hdrlen)) {
-		return &ast_null_frame;
+	
+	if(p2pbridge){
+		/* If we are directly bridged to another instance send the audio directly out */
+		if (ast_rtp_instance_get_bridged(instance) && !bridge_p2p_rtp_write(instance, rtpheader, res, hdrlen)) {
+			return &ast_null_frame;
+		}
 	}
 
 	/* If the version is not what we expected by this point then just drop the packet */
@@ -3024,6 +3029,7 @@
 	rtpend = DEFAULT_RTP_END;
 	dtmftimeout = DEFAULT_DTMF_TIMEOUT;
 	strictrtp = STRICT_RTP_OPEN;
+	p2pbridge = P2PBRIDGE_OPEN;
 	learning_min_sequential = DEFAULT_LEARNING_MIN_SEQUENTIAL;
 	if (cfg) {
 		if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -3068,6 +3074,9 @@
 		if ((s = ast_variable_retrieve(cfg, "general", "strictrtp"))) {
 			strictrtp = ast_true(s);
 		}
+		if ((s = ast_variable_retrieve(cfg, "general", "p2pbridge"))) {
+			p2pbridge = ast_true(s);
+		}
 		if ((s = ast_variable_retrieve(cfg, "general", "probation"))) {
 			if ((sscanf(s, "%d", &learning_min_sequential) <= 0) || learning_min_sequential <= 0) {
 				ast_log(LOG_WARNING, "Value for 'probation' could not be read, using default of '%d' instead\n",




More information about the asterisk-commits mailing list