[asterisk-commits] russell: trunk r371428 - in /trunk: ./ res/res_rtp_asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 17 07:42:37 CDT 2012


Author: russell
Date: Fri Aug 17 07:42:33 2012
New Revision: 371428

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371428
Log:
rtp: Ensure defaults are set without rtp.conf.

While building up a new install to test chan_motif, I ran into a failure
due to icesupport being disabled.  This was due to me not having an
rtp.conf.  It was intended in the code for it to be enabled by default,
but it was only applied if rtp.conf existed.

This patch updates res_rtp_asterisk to be consistent in how it handles
defaults.  A few options didn't have their default values set globally,
including icesupport.  They are now set and icesupport is enabled by
default, even if you do not have an rtp.conf.
........

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

Modified:
    trunk/   (props changed)
    trunk/res/res_rtp_asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Fri Aug 17 07:42:33 2012
@@ -1,1 +1,1 @@
-/branches/11:1-371121,371143,371146,371200,371227,371258,371272,371295,371324,371355,371382,371395,371399,371426
+/branches/11:1-371121,371143,371146,371200,371227,371258,371272,371295,371324,371355,371382,371395,371399,371425-371426

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=371428&r1=371427&r2=371428
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Fri Aug 17 07:42:33 2012
@@ -94,6 +94,15 @@
 
 #define DEFAULT_LEARNING_MIN_SEQUENTIAL 4
 
+enum strict_rtp_state {
+	STRICT_RTP_OPEN = 0, /*! No RTP packets should be dropped, all sources accepted */
+	STRICT_RTP_LEARN,    /*! Accept next packet as source */
+	STRICT_RTP_CLOSED,   /*! Drop all RTP packets not coming from source that was learned */
+};
+
+#define DEFAULT_STRICT_RTP STRICT_RTP_CLOSED
+#define DEFAULT_ICESUPPORT 1
+
 extern struct ast_srtp_res *res_srtp;
 static int dtmftimeout = DEFAULT_DTMF_TIMEOUT;
 
@@ -110,12 +119,12 @@
 #ifdef SO_NO_CHECK
 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 learning_min_sequential;	/*< Number of sequential RTP frames needed from a single source during learning mode to accept new source. */
-static int icesupport;
+static int strictrtp = DEFAULT_STRICT_RTP; /*< Only accept RTP frames from a defined source. If we receive an indication of a changing source, enter learning mode. */
+static int learning_min_sequential = DEFAULT_LEARNING_MIN_SEQUENTIAL; /*< Number of sequential RTP frames needed from a single source during learning mode to accept new source. */
+static int icesupport = DEFAULT_ICESUPPORT;
 static struct sockaddr_in stunaddr;
 static pj_str_t turnaddr;
-static int turnport;
+static int turnport = DEFAULT_TURN_PORT;
 static pj_str_t turnusername;
 static pj_str_t turnpassword;
 
@@ -136,12 +145,6 @@
 
 /*! \brief Notification that the ICE/TURN worker thread should stop */
 static int worker_terminate;
-
-enum strict_rtp_state {
-	STRICT_RTP_OPEN = 0, /*! No RTP packets should be dropped, all sources accepted */
-	STRICT_RTP_LEARN,    /*! Accept next packet as source */
-	STRICT_RTP_CLOSED,   /*! Drop all RTP packets not coming from source that was learned */
-};
 
 #define FLAG_3389_WARNING               (1 << 0)
 #define FLAG_NAT_ACTIVE                 (3 << 1)
@@ -3702,9 +3705,9 @@
 	rtpstart = DEFAULT_RTP_START;
 	rtpend = DEFAULT_RTP_END;
 	dtmftimeout = DEFAULT_DTMF_TIMEOUT;
-	strictrtp = STRICT_RTP_CLOSED;
+	strictrtp = DEFAULT_STRICT_RTP;
 	learning_min_sequential = DEFAULT_LEARNING_MIN_SEQUENTIAL;
-	icesupport = 1;
+	icesupport = DEFAULT_ICESUPPORT;
 	turnport = DEFAULT_TURN_PORT;
 	if (cfg) {
 		if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {




More information about the asterisk-commits mailing list