[Asterisk-cvs] asterisk rtp.c,1.79,1.80

markster at lists.digium.com markster at lists.digium.com
Sat Jul 17 17:22:10 CDT 2004


Update of /usr/cvsroot/asterisk
In directory localhost.localdomain:/tmp/cvs-serv20346

Modified Files:
	rtp.c 
Log Message:
Add option to disable checksums on RTP UDP ports (bug #2068)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- rtp.c	8 Jul 2004 11:46:15 -0000	1.79
+++ rtp.c	17 Jul 2004 21:08:12 -0000	1.80
@@ -52,6 +52,7 @@
 
 static int rtpstart = 0;
 static int rtpend = 0;
+static int checksums = 1;
 
 /* The value of each payload format mapping: */
 struct rtpPayloadType {
@@ -765,6 +766,9 @@
 	if (s > -1) {
 		flags = fcntl(s, F_GETFL);
 		fcntl(s, F_SETFL, flags | O_NONBLOCK);
+		if (checksums) {
+			setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
+		}
 	}
 	return s;
 }
@@ -1490,6 +1494,7 @@
 	char *s;
 	rtpstart = 5000;
 	rtpend = 31000;
+	checksums = 1;
 	cfg = ast_load("rtp.conf");
 	if (cfg) {
 		if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -1506,6 +1511,12 @@
 			if (rtpend > 65535)
 				rtpend = 65535;
 		}
+		if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
+			if (ast_true(s))
+				checksums = 1;
+			else
+				checksums = 0;
+		}
 		ast_destroy(cfg);
 	}
 	if (rtpstart >= rtpend) {




More information about the svn-commits mailing list