mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
rtp_engine: Allow more than 32 dynamic payload types.
Since adding all remaining rates of Signed Linear (ASTERISK-24274), SILK (Gerrit 3136) and Codec 2 (ASTERISK-26217), no RTP Payload Type is left in the dynamic range (96-127). RFC 3551 section 3 allows to reassign other ranges. Consequently, when the dynamic range is exhausted, this change utilizes payload types in the range between 35 and 63 giving room for another 29 payload types. ASTERISK-26311 #close Change-Id: I7bc96ab764bc30098a178b841cbf7146f9d64964
This commit is contained in:
committed by
George Joseph
parent
a380bba1e3
commit
9ac53877f6
@@ -248,6 +248,7 @@ int daemon(int, int); /* defined in libresolv of all places */
|
||||
#include "asterisk/format_cache.h"
|
||||
#include "asterisk/media_cache.h"
|
||||
#include "asterisk/astdb.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
#include "../defaults.h"
|
||||
|
||||
@@ -336,6 +337,7 @@ unsigned int option_dtmfminduration; /*!< Minimum duration of DTMF. */
|
||||
#if defined(HAVE_SYSINFO)
|
||||
long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
|
||||
#endif
|
||||
unsigned int ast_option_rtpptdynamic;
|
||||
|
||||
/*! @} */
|
||||
|
||||
@@ -599,6 +601,19 @@ static char *handle_show_settings(struct ast_cli_entry *e, int cmd, struct ast_c
|
||||
ast_cli(a->fd, " Generic PLC: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC) ? "Enabled" : "Disabled");
|
||||
ast_cli(a->fd, " Min DTMF duration:: %u\n", option_dtmfminduration);
|
||||
|
||||
if (ast_option_rtpptdynamic == AST_RTP_PT_LAST_REASSIGN) {
|
||||
ast_cli(a->fd, " RTP dynamic payload types: %u,%u-%u\n",
|
||||
ast_option_rtpptdynamic,
|
||||
AST_RTP_PT_FIRST_DYNAMIC, AST_RTP_MAX_PT - 1);
|
||||
} else if (ast_option_rtpptdynamic < AST_RTP_PT_LAST_REASSIGN) {
|
||||
ast_cli(a->fd, " RTP dynamic payload types: %u-%u,%u-%u\n",
|
||||
ast_option_rtpptdynamic, AST_RTP_PT_LAST_REASSIGN,
|
||||
AST_RTP_PT_FIRST_DYNAMIC, AST_RTP_MAX_PT - 1);
|
||||
} else {
|
||||
ast_cli(a->fd, " RTP dynamic payload types: %u-%u\n",
|
||||
AST_RTP_PT_FIRST_DYNAMIC, AST_RTP_MAX_PT - 1);
|
||||
}
|
||||
|
||||
ast_cli(a->fd, "\n* Subsystems\n");
|
||||
ast_cli(a->fd, " -------------\n");
|
||||
ast_cli(a->fd, " Manager (AMI): %s\n", check_manager_enabled() ? "Enabled" : "Disabled");
|
||||
@@ -3464,6 +3479,7 @@ static void ast_readconfig(void)
|
||||
|
||||
/* Set default value */
|
||||
option_dtmfminduration = AST_MIN_DTMF_DURATION;
|
||||
ast_option_rtpptdynamic = 35;
|
||||
|
||||
/* init with buildtime config */
|
||||
ast_copy_string(cfg_paths.config_dir, DEFAULT_CONFIG_DIR, sizeof(cfg_paths.config_dir));
|
||||
@@ -3619,6 +3635,11 @@ static void ast_readconfig(void)
|
||||
if (sscanf(v->value, "%30u", &option_dtmfminduration) != 1) {
|
||||
option_dtmfminduration = AST_MIN_DTMF_DURATION;
|
||||
}
|
||||
/* http://www.iana.org/assignments/rtp-parameters
|
||||
* RTP dynamic payload types start at 96 normally; extend down to 0 */
|
||||
} else if (!strcasecmp(v->name, "rtp_pt_dynamic")) {
|
||||
ast_parse_arg(v->value, PARSE_UINT32|PARSE_IN_RANGE,
|
||||
&ast_option_rtpptdynamic, 0, AST_RTP_PT_FIRST_DYNAMIC);
|
||||
} else if (!strcasecmp(v->name, "maxcalls")) {
|
||||
if ((sscanf(v->value, "%30d", &ast_option_maxcalls) != 1) || (ast_option_maxcalls < 0)) {
|
||||
ast_option_maxcalls = 0;
|
||||
|
Reference in New Issue
Block a user