]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix some consistency issues with jitterbuffer config.
authorRussell Bryant <russell@russellbryant.com>
Thu, 5 May 2011 22:53:45 +0000 (22:53 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 5 May 2011 22:53:45 +0000 (22:53 +0000)
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

channels/chan_alsa.c
channels/chan_console.c
channels/chan_dahdi.c
channels/chan_h323.c
channels/chan_mgcp.c
channels/chan_oss.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_unistim.c
channels/chan_usbradio.c
channels/misdn_config.c

index 120987ae4e549f6ff9e1ad4851f659547435f92a..a8b2dbf5a3382e9f0a566ac4917f0a1d24d59e36 100644 (file)
@@ -57,13 +57,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/musiconhold.h"
 #include "asterisk/poll-compat.h"
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in alsa.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;
 
index f1e6d198dedbcc0c0c4af05276a12d437009e295..4e220b1017e5929634f15ce07e3348a9eeefb2ff 100644 (file)
@@ -172,13 +172,14 @@ AST_RWLOCK_DEFINE_STATIC(active_lock);
  * \brief Global jitterbuffer configuration 
  *
  * \note Disabled by default.
+ * \note Values shown here match the defaults shown in console.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;
 
index e901c982ff37238e36a8523f8890614ec703108c..16563f452bbbd98b48191ebbf83ce46515cde7b4 100644 (file)
@@ -267,14 +267,15 @@ static const char * const lbostr[] = {
 "-22.5db (CSU)"
 };
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in chan_dahdi.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;
 
index 89b452dbcf10fb042105b0431995bb5e325c21c6..c630767678cda656c61af9dc9ca7fb58feb86313 100644 (file)
@@ -112,14 +112,15 @@ onhold_cb on_hold;
 
 int h323debug; /*!< global debug flag */
 
-/*! \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 h323.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;
 
index ba159c2376ff0d432d4ff781f23927131ec904b9..88eb0c3cb52f355dd430968531bb6c7653f228fc 100644 (file)
@@ -93,14 +93,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #define INADDR_NONE (in_addr_t)(-1)
 #endif
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in mgcp.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;
 
index 9a60fa8ce96dd90a3ee8dbc60cb7cc1451c37860..51828595d411f5380bd24069e9583171b1dddf4a 100644 (file)
@@ -65,14 +65,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "console_video.h"
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in oss.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;
 
index a36063aff23ecb5364789cfc9241b5fab70a7a41..05705cba6231e51fdb7f83baaa23845f1847e74c 100644 (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");
index d8e399741b4271b9562abc858dd101f7e293906c..bde057fb88b5983e7e394109764a097dc1ac4a1c 100644 (file)
@@ -219,14 +219,15 @@ static char version_id[16] = "P002F202";
 #endif
 #endif
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in skinny.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;
 
@@ -1357,15 +1358,6 @@ static struct skinny_device_options *default_device = &default_device_struct;
        
 static AST_LIST_HEAD_STATIC(devices, skinny_device);
 
-/*static struct ast_jb_conf default_jbconf =
-{
-       .flags = 0,
-       .max_size = -1,
-       .resync_threshold = -1,
-       .impl = ""
-};
-static struct ast_jb_conf global_jbconf;*/
-
 struct skinnysession {
        pthread_t t;
        ast_mutex_t lock;
@@ -3699,12 +3691,17 @@ static char *handle_skinny_show_settings(struct ast_cli_entry *e, int cmd, struc
        ast_cli(a->fd, "  Date Format:            %s\n", date_format);
        ast_cli(a->fd, "  Voice Mail Extension:   %s\n", S_OR(global_vmexten, "(not set)"));
        ast_cli(a->fd, "  Reg. context:           %s\n", S_OR(regcontext, "(not set)"));
-       ast_cli(a->fd, "  Jitterbuffer enabled:   %s\n", (ast_test_flag(&global_jbconf, AST_JB_ENABLED) ? "Yes" : "No"));
-       ast_cli(a->fd, "  Jitterbuffer forced:    %s\n", (ast_test_flag(&global_jbconf, AST_JB_FORCED) ? "Yes" : "No"));
-       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_test_flag(&global_jbconf, AST_JB_LOG) ? "Yes" : "No"));
+       ast_cli(a->fd, "  Jitterbuffer enabled:   %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_ENABLED)));
+        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)));
+       }
 
        return CLI_SUCCESS;
 }
index 509d1de8230c4aa9e87e36d5cd07e1a03767f930..a4e6bbb58d62b2fa5f8f37321b571154df9c162e 100644 (file)
@@ -186,14 +186,15 @@ static void dummy(char *unused, ...)
        return;
 }
 
-/*! \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 unistim.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;
                                
index eca7760ab196e8b5aedf1ab975f1d5d4522e4414..8874bf5baa12cf3b2d126f922307385823344289 100644 (file)
@@ -187,14 +187,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #define        EEPROM_TXCTCSSADJ       15
 #define        EEPROM_RXSQUELCHADJ     16
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in usbradio.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;
 
index e14f2adee44bb915a4b59615925a109046672c8f..23c2c6d80e33b8efaedffaa9a3a15e4e8cecc8c0 100644 (file)
@@ -47,14 +47,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #define NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec))
 #define NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec))
 
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+/*! Global jitterbuffer configuration - by default, jb is disabled
+ *  \note Values shown here match the defaults shown in misdn.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;