[asterisk-commits] tilghman: branch 1.6.0 r154062 - in /branches/1.6.0: ./ main/rtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 3 16:04:02 CST 2008


Author: tilghman
Date: Mon Nov  3 16:04:01 2008
New Revision: 154062

URL: http://svn.digium.com/view/asterisk?view=rev&rev=154062
Log:
Merged revisions 154060 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r154060 | tilghman | 2008-11-03 15:48:21 -0600 (Mon, 03 Nov 2008) | 3 lines
  
  Remove the potential for a division by zero error.
  (Closes issue #13810)
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/rtp.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/rtp.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/rtp.c?view=diff&rev=154062&r1=154061&r2=154062
==============================================================================
--- branches/1.6.0/main/rtp.c (original)
+++ branches/1.6.0/main/rtp.c Mon Nov  3 16:04:01 2008
@@ -66,8 +66,8 @@
 
 static int dtmftimeout = DEFAULT_DTMF_TIMEOUT;
 
-static int rtpstart;			/*!< First port for RTP sessions (set in rtp.conf) */
-static int rtpend;			/*!< Last port for RTP sessions (set in rtp.conf) */
+static int rtpstart = 5000;     /*!< First port for RTP sessions (set in rtp.conf) */
+static int rtpend = 31000;      /*!< Last port for RTP sessions (set in rtp.conf) */
 static int rtpdebug;			/*!< Are we debugging? */
 static int rtcpdebug;			/*!< Are we debugging RTCP? */
 static int rtcpstats;			/*!< Are we debugging RTCP? */
@@ -2248,7 +2248,7 @@
 	 * next one, cannot be enforced in presence of a NAT box because the
 	 * mapping is not under our control.
 	 */
-	x = (ast_random() % (rtpend-rtpstart)) + rtpstart;
+	x = (rtpend == rtpstart) ? rtpstart : (ast_random() % (rtpend - rtpstart)) + rtpstart;
 	x = x & ~1;		/* make it an even number */
 	startplace = x;		/* remember the starting point */
 	/* this is constant across the loop */




More information about the asterisk-commits mailing list