Fix some consistency issues with jitterbuffer config.

Store the defaults noted in the sample config files in the jitterbuffer config
data structure.  This makes the CLI commands that output these settings show
the right thing.  Also only show the settings that are relevant in the settings
CLI commands, based on which jitterbuffer is selected and whether it's enabled.

(closes issue #19083)
Reported by: rgagnon
Patches:
      issue-19083-trunk-r313139.diff uploaded by rgagnon (license 1202)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2011-05-05 22:53:45 +00:00
parent 08ae269e5c
commit 6446ba738b
11 changed files with 86 additions and 74 deletions

View File

@@ -563,14 +563,15 @@ static int unauth_sessions = 0;
static int authlimit = DEFAULT_AUTHLIMIT;
static int authtimeout = DEFAULT_AUTHTIMEOUT;
/*! \brief Global jitterbuffer configuration - by default, jb is disabled */
/*! \brief Global jitterbuffer configuration - by default, jb is disabled
* \note Values shown here match the defaults shown in sip.conf.sample */
static struct ast_jb_conf default_jbconf =
{
.flags = 0,
.max_size = -1,
.resync_threshold = -1,
.impl = "",
.target_extra = -1,
.max_size = 200,
.resync_threshold = 1000,
.impl = "fixed",
.target_extra = 40,
};
static struct ast_jb_conf global_jbconf; /*!< Global jitterbuffer configuration */
@@ -17286,11 +17287,16 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_
ast_cli(a->fd, " 802.1p CoS RTP video: %d\n", global_cos_video);
ast_cli(a->fd, " 802.1p CoS RTP text: %d\n", global_cos_text);
ast_cli(a->fd, " Jitterbuffer enabled: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_ENABLED)));
ast_cli(a->fd, " Jitterbuffer forced: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_FORCED)));
ast_cli(a->fd, " Jitterbuffer max size: %ld\n", global_jbconf.max_size);
ast_cli(a->fd, " Jitterbuffer resync: %ld\n", global_jbconf.resync_threshold);
ast_cli(a->fd, " Jitterbuffer impl: %s\n", global_jbconf.impl);
ast_cli(a->fd, " Jitterbuffer log: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_LOG)));
if (ast_test_flag(&global_jbconf, AST_JB_ENABLED)) {
ast_cli(a->fd, " Jitterbuffer forced: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_FORCED)));
ast_cli(a->fd, " Jitterbuffer max size: %ld\n", global_jbconf.max_size);
ast_cli(a->fd, " Jitterbuffer resync: %ld\n", global_jbconf.resync_threshold);
ast_cli(a->fd, " Jitterbuffer impl: %s\n", global_jbconf.impl);
if (!strcasecmp(global_jbconf.impl, "adaptive")) {
ast_cli(a->fd, " Jitterbuffer tgt extra: %ld\n", global_jbconf.target_extra);
}
ast_cli(a->fd, " Jitterbuffer log: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_LOG)));
}
ast_cli(a->fd, "\nNetwork Settings:\n");
ast_cli(a->fd, "---------------------------\n");