]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 249893 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Tue, 2 Mar 2010 19:12:26 +0000 (19:12 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 2 Mar 2010 19:12:26 +0000 (19:12 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r249893 | dvossel | 2010-03-02 13:08:38 -0600 (Tue, 02 Mar 2010) | 11 lines

  fixes adaptive jitterbuffer configuration

  When configuring the adaptive jitterbuffer, the target_extra
  value not only could not be set from the configuration, but was
  not even being set to its proper default.  This value is required
  in order for the adaptive jitterbuffer to work correctly.  To resolve
  this a config option has been added to expose this value to the conf
  files, and a default value is provided when no config specific value
  is present.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@249895 65c4cc65-6c06-0410-ace0-fbb531ad65f3

24 files changed:
channels/chan_alsa.c
channels/chan_console.c
channels/chan_dahdi.c
channels/chan_gtalk.c
channels/chan_h323.c
channels/chan_jingle.c
channels/chan_local.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
configs/alsa.conf.sample
configs/chan_dahdi.conf.sample
configs/console.conf.sample
configs/mgcp.conf.sample
configs/misdn.conf.sample
configs/oss.conf.sample
configs/sip.conf.sample
configs/usbradio.conf.sample
include/asterisk/abstract_jb.h
main/abstract_jb.c

index 0765308c9ccd9e26640dfad0547c77bd2eb437fc..75f63aecb35ab6a974d120303fc857d3b8561f00 100644 (file)
@@ -62,7 +62,8 @@ static struct ast_jb_conf default_jbconf = {
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index fccb1e745362eee9db8d2e5c96d19ab864c0cb61..933cca3567bc818e1357073371fc981386e84fb6 100644 (file)
@@ -177,7 +177,8 @@ static struct ast_jb_conf default_jbconf = {
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 1d4c55a8861d99f15377ccdffc527a9f2e656ef7..309876f726e0def61106537437cb41bc34d5485c 100644 (file)
@@ -175,7 +175,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index d608cc05c51401e112f11b50fa3036f54c5834cb..b5bc0ec84dce334aadf14f2561434e5b16f05c3e 100644 (file)
@@ -78,7 +78,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 2346175de65f4401491548504e0ee7797889972e..be8c78d90a820faa5e8ae470e59e2dc0a07f08f5 100644 (file)
@@ -118,7 +118,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index d239fd717fc0354956322a92f4df19989d022b63..717f702b81f1d499a64dfa6ea26018552a27fded 100644 (file)
@@ -77,7 +77,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 37869a8a747545860de811cdad0ff203bb3e42ec..7ccdc8a5aa529ccdc308df0c9a9eff54f211c02f 100644 (file)
@@ -59,6 +59,7 @@ static struct ast_jb_conf g_jb_conf = {
        .max_size = -1,
        .resync_threshold = -1,
        .impl = "",
+       .target_extra = -1,
 };
 
 static struct ast_channel *local_request(const char *type, int format, void *data, int *cause);
index 863aee911e3c046fc15d434a3b5dff5aadd46672..771286da7be767c98da0327bed8fdce5832f4fe7 100644 (file)
@@ -92,7 +92,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 5fa0a50a19b382afd0c2a15b743da1f0de3e4538..cf29b60a05e1af28849e90963a692dcb05c7b70d 100644 (file)
@@ -72,6 +72,7 @@ static struct ast_jb_conf default_jbconf =
        .max_size = -1,
        .resync_threshold = -1,
        .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 3b343850a61371b6169fda2b3fbcfca5136f206b..2f916c610f63be5381a3cbb52534f0b841d95b30 100644 (file)
@@ -558,7 +558,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;               /*!< Global jitterbuffer configuration */
 
index 84bcd4d7513777265a29769c191b1e17cd2f20d8..4753e08e8c1a5524cdf16d82c306db5488a320db 100644 (file)
@@ -163,7 +163,8 @@ static struct ast_jb_conf default_jbconf =
        .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 36805694e3e4e9a018c25869daef356cc6e290d5..ed31a7b3a5d10e1e05457af7c9166f8cde2625d0 100644 (file)
@@ -188,10 +188,11 @@ static void dummy(char *unused, ...)
 /*! \brief Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
 {
-        .flags = 0,
+       .flags = 0,
        .max_size = -1,
        .resync_threshold = -1,
-       .impl = ""
+       .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
                                
index f7b2066ce2b421ea62afe0ffdd49d1edb674012e..7ae9159c31906c45716c29d6b6c23d03f1de3605 100644 (file)
@@ -193,6 +193,7 @@ static struct ast_jb_conf default_jbconf =
        .max_size = -1,
        .resync_threshold = -1,
        .impl = "",
+       .target_extra = -1,
 };
 static struct ast_jb_conf global_jbconf;
 
index 4a90bbec1e2845a2207ae5c53aaea834b5632387..2a330551f2c48ef5bf1af549fc197353084ef90e 100644 (file)
@@ -54,6 +54,7 @@ static struct ast_jb_conf default_jbconf =
        .max_size = -1,
        .resync_threshold = -1,
        .impl = "",
+       .target_extra = -1,
 };
 
 static struct ast_jb_conf global_jbconf;
index f550306185ef3f9a30a030ec2a2598b649343159..fa2ff1d9bbaf3b71fe989fc5ab2422252da7bd84 100644 (file)
@@ -57,6 +57,13 @@ extension=s
                               ; (with size always equals to jbmax-size) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new
+                              ; jitter buffer will pad its size. the default is 40, so without
+                              ; modification, the new jitter buffer will set its size to the jitter
+                              ; value plus 40 milliseconds. increasing this value may help if your
+                              ; network normally has low jitter, but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 
index 9b958c087b943169147d9748f91741ec445d3527..f40af59a2c58d947ff37a1368f4849dcc5198318 100644 (file)
@@ -812,6 +812,13 @@ pickupgroup=1
                               ; (with size always equals to jbmax-size) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new
+                              ; jitter buffer will pad its size. the default is 40, so without
+                              ; modification, the new jitter buffer will set its size to the jitter
+                              ; value plus 40 milliseconds. increasing this value may help if your
+                              ; network normally has low jitter, but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 ;
index ff58605a3810bdcee6a60b7a8b0deb19289b17d6..7a40ed02e16bf5df0b266c7523f0a660909095d6 100644 (file)
                               ; (with size always equals to jbmax-size) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new
+                              ; jitter buffer will pad its size. the default is 40, so without
+                              ; modification, the new jitter buffer will set its size to the jitter
+                              ; value plus 40 milliseconds. increasing this value may help if your
+                              ; network normally has low jitter, but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 
index c20b34a7c1fc70cfb404d53b096baa043358437b..5d42ac17c6976da3f82095fad573e39d0a21a23d 100644 (file)
                               ; (with size always equals to jbmax-size) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new
+                              ; jitter buffer will pad its size. the default is 40, so without
+                              ; modification, the new jitter buffer will set its size to the jitter
+                              ; value plus 40 milliseconds. increasing this value may help if your
+                              ; network normally has low jitter, but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 
index ca7f4549749d5198b9dc9b7b9410df27b80ddee7..5cadfb0dec0d0c447625b71f0c24ca8522e303f6 100644 (file)
@@ -158,6 +158,13 @@ crypt_keys=test,muh
                               ; (with size always equals to jbmaxsize) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new
+                              ; jitter buffer will pad its size. the default is 40, so without
+                              ; modification, the new jitter buffer will set its size to the jitter
+                              ; value plus 40 milliseconds. increasing this value may help if your
+                              ; network normally has low jitter, but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 
index 48f0ced9040fd59c4b77e0c83cce97302b5f0fc7..3b9f5de0a9d450f607514646ca24f07c5dba9a04 100644 (file)
                                   ; (with size always equals to jbmax-size) and "adaptive" (with
                                   ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+    ; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                                  ; The option represents the number of milliseconds by which the new
+                                  ; jitter buffer will pad its size. the default is 40, so without
+                                  ; modification, the new jitter buffer will set its size to the jitter
+                                  ; value plus 40 milliseconds. increasing this value may help if your
+                                  ; network normally has low jitter, but occasionally has spikes.
+
     ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
     ;-----------------------------------------------------------------------------------
 
index 5cc3d8398e406cfdd726886c54fd9b16ab1d9286..e4e62ecb782383666d4c944fbd63237fd1a102dd 100644 (file)
@@ -799,6 +799,13 @@ srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
                               ; (with size always equals to jbmaxsize) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new jitter buffer
+                              ; will pad its size. the default is 40, so without modification, the new
+                              ; jitter buffer will set its size to the jitter value plus 40 milliseconds.
+                              ; increasing this value may help if your network normally has low jitter,
+                              ; but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 
index 5ba9815ca1c0576ab30f07dd8f09954941948242..6af373e6d17721f338a26ec50e0517d202d9d0a1 100644 (file)
                               ; (with size always equals to jbmax-size) and "adaptive" (with
                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
 
+; jbtargetextra = 40          ; This option only affects the jb when 'jbimpl = adaptive' is set.
+                              ; The option represents the number of milliseconds by which the new
+                              ; jitter buffer will pad its size. the default is 40, so without
+                              ; modification, the new jitter buffer will set its size to the jitter
+                              ; value plus 40 milliseconds. increasing this value may help if your
+                              ; network normally has low jitter, but occasionally has spikes.
+
 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
 ;-----------------------------------------------------------------------------------
 
index 2a1b89fd1829f7ce876d8992f6c2956a23ddc86f..a1f3cdd9d8c5f3925b09b6a8dcdddb777547f16c 100644 (file)
@@ -57,9 +57,11 @@ struct ast_jb_conf
        /*! \brief Max size of the jitterbuffer implementation. */
        long max_size;
        /*! \brief Resynchronization threshold of the jitterbuffer implementation. */
-       long resync_threshold;
+       long resync_threshold;
        /*! \brief Name of the jitterbuffer implementation to be used. */
-       char impl[AST_JB_IMPL_NAME_SIZE];
+       char impl[AST_JB_IMPL_NAME_SIZE];
+       /*! \brief amount of additional jitterbuffer adjustment */
+       long target_extra;
 };
 
 
@@ -69,6 +71,7 @@ struct ast_jb_conf
 #define AST_JB_CONF_FORCE "force"
 #define AST_JB_CONF_MAX_SIZE "maxsize"
 #define AST_JB_CONF_RESYNCH_THRESHOLD "resyncthreshold"
+#define AST_JB_CONF_TARGET_EXTRA "targetextra"
 #define AST_JB_CONF_IMPL "impl"
 #define AST_JB_CONF_LOG "log"
 
index c325d3acaca45b6a51ea4d7d615df51d7597973e..90cd7d14e31c846935a95bf39e68ab16aa887aef 100644 (file)
@@ -593,6 +593,10 @@ int ast_jb_read_conf(struct ast_jb_conf *conf, const char *varname, const char *
        } else if (!strcasecmp(name, AST_JB_CONF_IMPL)) {
                if (!ast_strlen_zero(value))
                        snprintf(conf->impl, sizeof(conf->impl), "%s", value);
+       } else if (!strcasecmp(name, AST_JB_CONF_TARGET_EXTRA)) {
+               if (sscanf(value, "%30d", &tmp) == 1) {
+                       conf->target_extra = tmp;
+               }
        } else if (!strcasecmp(name, AST_JB_CONF_LOG)) {
                ast_set2_flag(conf, ast_true(value), AST_JB_LOG);
        } else {
@@ -739,6 +743,7 @@ static void *jb_create_adaptive(struct ast_jb_conf *general_config, long resynch
                jbconf.max_jitterbuf = general_config->max_size;
                jbconf.resync_threshold = general_config->resync_threshold;
                jbconf.max_contig_interp = 10;
+               jbconf.target_extra = general_config->target_extra;
                jb_setconf(adaptivejb, &jbconf);
        }