[svn-commits] oej: trunk r46409 - /trunk/main/rtp.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Oct 29 13:21:34 MST 2006


Author: oej
Date: Sun Oct 29 14:21:33 2006
New Revision: 46409

URL: http://svn.digium.com/view/asterisk?rev=46409&view=rev
Log:
Bind RTCP to the same IP as RTP. 

I currently don't see this as a bug that needs to be fixed in 1.4/1.2 too,
but feel free to backport if you see it that way. RTCP now binds to
ALL IP addresses on the host, RTP to a specific address.


Modified:
    trunk/main/rtp.c

Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?rev=46409&r1=46408&r2=46409&view=diff
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Sun Oct 29 14:21:33 2006
@@ -1740,6 +1740,7 @@
 	return buf;
 }
 
+/*! \brief Open RTP or RTCP socket for a session */
 static int rtp_socket(void)
 {
 	int s;
@@ -1815,9 +1816,12 @@
 		/* Must be an even port number by RTP spec */
 		rtp->us.sin_port = htons(x);
 		rtp->us.sin_addr = addr;
+
 		/* If there's rtcp, initialize it as well. */
-		if (rtp->rtcp)
+		if (rtp->rtcp) {
 			rtp->rtcp->us.sin_port = htons(x + 1);
+			rtp->rtcp->us.sin_addr = addr;
+		}
 		/* Try to bind it/them. */
 		if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
 			(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))



More information about the svn-commits mailing list