mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Correct the default udptl port range.
The udptl port range was defined as 4000-4999 in the udptl.conf.sample, as 4500-4599 if you didn't have a config and 4500-4999 if your config was broken. Default is now 4000-4999. (closes issue ASTERISK-16250) Reviewed by: Tilghman Lesher Review: https://reviewboard.asterisk.org/r/1565 ........ Merged revisions 343580 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -116,5 +116,10 @@ chan_sip:
|
|||||||
by default. It can be enabled using the 'storesipcause' option. This feature
|
by default. It can be enabled using the 'storesipcause' option. This feature
|
||||||
has a significant performance penalty.
|
has a significant performance penalty.
|
||||||
|
|
||||||
|
UDPTL:
|
||||||
|
- The default UDPTL port range in udptl.conf.sample differed from the defaults
|
||||||
|
in the source. If you didn't have a config file, you got 4500 to 4599. Now the
|
||||||
|
default is 4000 to 4999.
|
||||||
|
|
||||||
===========================================================
|
===========================================================
|
||||||
===========================================================
|
===========================================================
|
||||||
|
23
main/udptl.c
23
main/udptl.c
@@ -79,8 +79,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
|
|
||||||
#define LOG_TAG(u) S_OR(u->tag, "no tag")
|
#define LOG_TAG(u) S_OR(u->tag, "no tag")
|
||||||
|
|
||||||
static int udptlstart = 4500;
|
#define DEFAULT_UDPTLSTART 4000
|
||||||
static int udptlend = 4599;
|
#define DEFAULT_UDPTLEND 4999
|
||||||
|
|
||||||
|
static int udptlstart = DEFAULT_UDPTLSTART;
|
||||||
|
static int udptlend = DEFAULT_UDPTLEND;
|
||||||
static int udptldebug; /*!< Are we debugging? */
|
static int udptldebug; /*!< Are we debugging? */
|
||||||
static struct ast_sockaddr udptldebugaddr; /*!< Debug packets to/from this host */
|
static struct ast_sockaddr udptldebugaddr; /*!< Debug packets to/from this host */
|
||||||
#ifdef SO_NO_CHECK
|
#ifdef SO_NO_CHECK
|
||||||
@@ -1315,8 +1318,8 @@ static void __ast_udptl_reload(int reload)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
udptlstart = 4500;
|
udptlstart = DEFAULT_UDPTLSTART;
|
||||||
udptlend = 4999;
|
udptlend = DEFAULT_UDPTLEND;
|
||||||
udptlfecentries = 0;
|
udptlfecentries = 0;
|
||||||
udptlfecspan = 0;
|
udptlfecspan = 0;
|
||||||
use_even_ports = 0;
|
use_even_ports = 0;
|
||||||
@@ -1388,18 +1391,18 @@ static void __ast_udptl_reload(int reload)
|
|||||||
}
|
}
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
}
|
}
|
||||||
if (udptlstart >= udptlend) {
|
|
||||||
ast_log(LOG_WARNING, "Unreasonable values for UDPTL start/end ports; defaulting to 4500-4999.\n");
|
|
||||||
udptlstart = 4500;
|
|
||||||
udptlend = 4999;
|
|
||||||
}
|
|
||||||
if (use_even_ports && (udptlstart & 1)) {
|
if (use_even_ports && (udptlstart & 1)) {
|
||||||
++udptlstart;
|
++udptlstart;
|
||||||
ast_log(LOG_NOTICE, "Odd numbered udptlstart specified but use_even_ports enabled. udptlstart is now %d\n", udptlstart);
|
ast_log(LOG_NOTICE, "Odd numbered udptlstart specified but use_even_ports enabled. udptlstart is now %d\n", udptlstart);
|
||||||
}
|
}
|
||||||
|
if (udptlstart > udptlend) {
|
||||||
|
ast_log(LOG_WARNING, "Unreasonable values for UDPTL start/end ports; defaulting to %d-%d.\n", DEFAULT_UDPTLSTART, DEFAULT_UDPTLEND);
|
||||||
|
udptlstart = DEFAULT_UDPTLSTART;
|
||||||
|
udptlend = DEFAULT_UDPTLEND;
|
||||||
|
}
|
||||||
if (use_even_ports && (udptlend & 1)) {
|
if (use_even_ports && (udptlend & 1)) {
|
||||||
--udptlend;
|
--udptlend;
|
||||||
ast_log(LOG_NOTICE, "Odd numbered udptlend specified but use_event_ports enabled. udptlend is now %d\n", udptlend);
|
ast_log(LOG_NOTICE, "Odd numbered udptlend specified but use_even_ports enabled. udptlend is now %d\n", udptlend);
|
||||||
}
|
}
|
||||||
ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
|
ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user