diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-29 23:20:31 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-29 23:20:31 +0000 |
commit | 8c66623859cbb6c08f1580d93180ffa8490e0914 (patch) | |
tree | d85fd9232d121c0de7e15028e03fb5d8e839bbdc /channels/chan_iax2.c | |
parent | 7fd9ddbc394f5f5b0477a2190d20030b2dae375e (diff) |
Add option to disable checksums on IAX
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5301 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rwxr-xr-x | channels/chan_iax2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index c44dc97f1..25bb7320c 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -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 @@ static struct iax2_trunk_peer *find_tpeer(struct sockaddr_in *sin, int fd) 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 @@ static int set_config(char *config_file, int reload) 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 @@ static int set_config(char *config_file, int reload) 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")) |