aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-17 21:08:12 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-17 21:08:12 +0000
commit0a0851e0d9bfd0036acca5098ee6fc394e85315b (patch)
tree6661dfdcda2088d8a2663c68d1ba3dd405c2ca98
parentfc1d3d8122b037d0cee66ef016f9634646b84e6b (diff)
Add option to disable checksums on RTP UDP ports (bug #2068)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3464 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xconfigs/rtp.conf.sample4
-rwxr-xr-xrtp.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/configs/rtp.conf.sample b/configs/rtp.conf.sample
index 01a6dea89..76327cd95 100755
--- a/configs/rtp.conf.sample
+++ b/configs/rtp.conf.sample
@@ -7,3 +7,7 @@
;
rtpstart=10000
rtpend=20000
+;
+; Whether to enable or disable UDP checksums on RTP traffic
+;
+;rtpchecksums=no
diff --git a/rtp.c b/rtp.c
index 9cfb118bd..2b7dec0a3 100755
--- a/rtp.c
+++ b/rtp.c
@@ -52,6 +52,7 @@ static int dtmftimeout = 3000; /* 3000 samples */
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 @@ static int rtp_socket(void)
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 @@ void ast_rtp_reload(void)
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 @@ void ast_rtp_reload(void)
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) {