dect
/
asterisk
Archived
13
0
Fork 0

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: http://svn.digium.com/svn/asterisk/trunk@249893 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
dvossel 2010-03-02 19:08:38 +00:00
parent 64020820db
commit 3b12e80473
24 changed files with 91 additions and 13 deletions

View 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;

View 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;

View File

@ -269,7 +269,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;

View File

@ -79,7 +79,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;

View 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;

View 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;

View File

@ -58,6 +58,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, format_t format, const struct ast_channel *requestor, void *data, int *cause);

View File

@ -99,7 +99,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;

View 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;

View File

@ -555,7 +555,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 */

View File

@ -220,7 +220,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;

View 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;

View 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;

View 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;

View File

@ -66,6 +66,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".
;-----------------------------------------------------------------------------------

View File

@ -855,6 +855,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".
;-----------------------------------------------------------------------------------
;

View File

@ -64,6 +64,13 @@
; (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".
;-----------------------------------------------------------------------------------

View File

@ -40,6 +40,13 @@ matchdigittimeout = 5000 ; defaults 3000 = 3s
; (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".
;-----------------------------------------------------------------------------------

View File

@ -132,6 +132,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".
;-----------------------------------------------------------------------------------

View File

@ -66,6 +66,13 @@
; (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".
;-----------------------------------------------------------------------------------

View File

@ -892,6 +892,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".
;-----------------------------------------------------------------------------------

View File

@ -48,6 +48,13 @@
; (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".
;-----------------------------------------------------------------------------------

View File

@ -59,9 +59,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;
};
@ -71,6 +73,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"

View File

@ -592,6 +592,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 {
@ -738,6 +742,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);
}