mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
Don't copmile in the no-RTP checksum stuff for non-Linux (bug #2089)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
rtp.c
11
rtp.c
@@ -52,7 +52,9 @@ static int dtmftimeout = 3000; /* 3000 samples */
|
|||||||
|
|
||||||
static int rtpstart = 0;
|
static int rtpstart = 0;
|
||||||
static int rtpend = 0;
|
static int rtpend = 0;
|
||||||
|
#ifdef SO_NO_CHECK
|
||||||
static int checksums = 1;
|
static int checksums = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The value of each payload format mapping: */
|
/* The value of each payload format mapping: */
|
||||||
struct rtpPayloadType {
|
struct rtpPayloadType {
|
||||||
@@ -766,9 +768,11 @@ static int rtp_socket(void)
|
|||||||
if (s > -1) {
|
if (s > -1) {
|
||||||
flags = fcntl(s, F_GETFL);
|
flags = fcntl(s, F_GETFL);
|
||||||
fcntl(s, F_SETFL, flags | O_NONBLOCK);
|
fcntl(s, F_SETFL, flags | O_NONBLOCK);
|
||||||
|
#ifdef SO_NO_CHECK
|
||||||
if (checksums) {
|
if (checksums) {
|
||||||
setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
|
setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
@@ -1494,7 +1498,9 @@ void ast_rtp_reload(void)
|
|||||||
char *s;
|
char *s;
|
||||||
rtpstart = 5000;
|
rtpstart = 5000;
|
||||||
rtpend = 31000;
|
rtpend = 31000;
|
||||||
|
#ifdef SO_NO_CHECK
|
||||||
checksums = 1;
|
checksums = 1;
|
||||||
|
#endif
|
||||||
cfg = ast_load("rtp.conf");
|
cfg = ast_load("rtp.conf");
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
|
if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
|
||||||
@@ -1512,10 +1518,15 @@ void ast_rtp_reload(void)
|
|||||||
rtpend = 65535;
|
rtpend = 65535;
|
||||||
}
|
}
|
||||||
if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
|
if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
|
||||||
|
#ifdef SO_NO_CHECK
|
||||||
if (ast_true(s))
|
if (ast_true(s))
|
||||||
checksums = 1;
|
checksums = 1;
|
||||||
else
|
else
|
||||||
checksums = 0;
|
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);
|
ast_destroy(cfg);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user