Skip to content
Snippets Groups Projects
Commit 2f212287 authored by Mark Spencer's avatar Mark Spencer
Browse files

Add option to disable checksums on RTP UDP ports (bug #2068)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 569b9535
No related branches found
No related tags found
No related merge requests found
...@@ -7,3 +7,7 @@ ...@@ -7,3 +7,7 @@
; ;
rtpstart=10000 rtpstart=10000
rtpend=20000 rtpend=20000
;
; Whether to enable or disable UDP checksums on RTP traffic
;
;rtpchecksums=no
...@@ -52,6 +52,7 @@ static int dtmftimeout = 3000; /* 3000 samples */ ...@@ -52,6 +52,7 @@ static int dtmftimeout = 3000; /* 3000 samples */
static int rtpstart = 0; static int rtpstart = 0;
static int rtpend = 0; static int rtpend = 0;
static int checksums = 1;
/* The value of each payload format mapping: */ /* The value of each payload format mapping: */
struct rtpPayloadType { struct rtpPayloadType {
...@@ -765,6 +766,9 @@ static int rtp_socket(void) ...@@ -765,6 +766,9 @@ 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);
if (checksums) {
setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
}
} }
return s; return s;
} }
...@@ -1490,6 +1494,7 @@ void ast_rtp_reload(void) ...@@ -1490,6 +1494,7 @@ void ast_rtp_reload(void)
char *s; char *s;
rtpstart = 5000; rtpstart = 5000;
rtpend = 31000; rtpend = 31000;
checksums = 1;
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"))) {
...@@ -1506,6 +1511,12 @@ void ast_rtp_reload(void) ...@@ -1506,6 +1511,12 @@ void ast_rtp_reload(void)
if (rtpend > 65535) if (rtpend > 65535)
rtpend = 65535; rtpend = 65535;
} }
if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
if (ast_true(s))
checksums = 1;
else
checksums = 0;
}
ast_destroy(cfg); ast_destroy(cfg);
} }
if (rtpstart >= rtpend) { if (rtpstart >= rtpend) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment