aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-19 18:09:33 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-19 18:09:33 +0000
commit26bb6abc1945b1348777e29f480d1b6fc1773f2a (patch)
tree01626f3a76ff9de1c8a57f0434933d5d2cc3ea47 /rtp.c
parentbe211e93b85bec7ec67581d7138a2fcb2a196d50 (diff)
Don't copmile in the no-RTP checksum stuff for non-Linux (bug #2089)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3480 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/rtp.c b/rtp.c
index 2b7dec0a3..3d0c51388 100755
--- a/rtp.c
+++ b/rtp.c
@@ -52,7 +52,9 @@ static int dtmftimeout = 3000; /* 3000 samples */
static int rtpstart = 0;
static int rtpend = 0;
+#ifdef SO_NO_CHECK
static int checksums = 1;
+#endif
/* The value of each payload format mapping: */
struct rtpPayloadType {
@@ -766,9 +768,11 @@ static int rtp_socket(void)
if (s > -1) {
flags = fcntl(s, F_GETFL);
fcntl(s, F_SETFL, flags | O_NONBLOCK);
+#ifdef SO_NO_CHECK
if (checksums) {
setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
}
+#endif
}
return s;
}
@@ -1494,7 +1498,9 @@ void ast_rtp_reload(void)
char *s;
rtpstart = 5000;
rtpend = 31000;
+#ifdef SO_NO_CHECK
checksums = 1;
+#endif
cfg = ast_load("rtp.conf");
if (cfg) {
if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -1512,10 +1518,15 @@ void ast_rtp_reload(void)
rtpend = 65535;
}
if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
+#ifdef SO_NO_CHECK
if (ast_true(s))
checksums = 1;
else
checksums = 0;
+#else
+ if (ast_true(s))
+ ast_log(LOG_WARNING, "Disabling RTP checksums is not supported on this operating system!\n");
+#endif
}
ast_destroy(cfg);
}