[Asterisk-cvs] asterisk/channels chan_iax2.c,1.260,1.261

markster at lists.digium.com markster at lists.digium.com
Tue Mar 29 17:26:50 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv12161/channels

Modified Files:
	chan_iax2.c 
Log Message:
Add option to disable checksums on IAX


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -d -r1.260 -r1.261
--- chan_iax2.c	28 Mar 2005 20:48:24 -0000	1.260
+++ chan_iax2.c	29 Mar 2005 23:20:31 -0000	1.261
@@ -82,6 +82,10 @@
 #define IPTOS_MINCOST 0x02
 #endif
 
+#ifdef SO_NO_CHECK
+static int nochecksums = 0;
+#endif
+
 /*
  * Uncomment to try experimental IAX bridge optimization,
  * designed to reduce latency when IAX calls cannot
@@ -3569,6 +3573,9 @@
 			tpeer->next = tpeers;
 			tpeer->sockfd = fd;
 			tpeers = tpeer;
+#ifdef SO_NO_CHECK
+			setsockopt(tpeer->sockfd, SOL_SOCKET, SO_NO_CHECK, &nochecksums, sizeof(nochecksums));
+#endif
 			ast_log(LOG_DEBUG, "Created trunk peer for '%s:%d'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), tpeer->addr.sin_addr), ntohs(tpeer->addr.sin_port));
 		}
 	}
@@ -8235,6 +8242,7 @@
 	v = ast_variable_browse(cfg, "general");
 	/* Reset Global Flags */
 	memset(&globalflags, 0, sizeof(globalflags));
+	nochecksums = 0;
 
 	while(v) {
 		if (!strcasecmp(v->name, "bindport")){ 
@@ -8244,6 +8252,17 @@
 				portno = atoi(v->value);
 		} else if (!strcasecmp(v->name, "pingtime")) 
 			ping_time = atoi(v->value);
+		else if (!strcasecmp(v->name, "nochecksums")) {
+#ifdef SO_NO_CHECK
+			if (ast_true(v->value))
+				nochecksums = 1;
+			else
+				nochecksums = 0;
+#else
+			if (ast_true(v->value))
+				ast_log(LOG_WARNING, "Disabling RTP checksums is not supported on this operating system!\n");
+#endif
+		}
 		else if (!strcasecmp(v->name, "maxjitterbuffer")) 
 			maxjitterbuffer = atoi(v->value);
 		else if (!strcasecmp(v->name, "jittershrinkrate")) 




More information about the svn-commits mailing list