diff options
author | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-05 07:45:21 +0000 |
---|---|---|
committer | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-05 07:45:21 +0000 |
commit | 177aff2f30f3dbad216e2f00b44f7f705c70acb3 (patch) | |
tree | 4a2d0823eaa0be190bd5083845b2fde7c49c31ee /channels | |
parent | a828695fa96546aec6eb5c2e448d8ef75bcb690c (diff) |
added general Jitterbuffer Implementation. #9960
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@73298 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_misdn.c | 3 | ||||
-rw-r--r-- | channels/misdn/chan_misdn_config.h | 2 | ||||
-rw-r--r-- | channels/misdn_config.c | 20 |
3 files changed, 23 insertions, 2 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index eaa96a8f3..9fac67d3e 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -75,6 +75,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/term.h" #include "asterisk/sched.h" #include "asterisk/stringfields.h" +#include "asterisk/abstract_jb.h" #include "asterisk/causes.h" #include "chan_misdn_config.h" @@ -3228,7 +3229,7 @@ static struct ast_channel *misdn_new(struct chan_list *chlist, int state, char else tmp->rings = 0; - + ast_jb_configure(tmp, misdn_get_global_jbconf()); } else { chan_misdn_log(-1, 0, "Unable to allocate channel structure\n"); } diff --git a/channels/misdn/chan_misdn_config.h b/channels/misdn/chan_misdn_config.h index eb2b50572..2708da4d3 100644 --- a/channels/misdn/chan_misdn_config.h +++ b/channels/misdn/chan_misdn_config.h @@ -147,4 +147,6 @@ char *misdn_cfg_get_next_group(char *group); int misdn_cfg_get_next_port_in_group(int port, char *group); #endif +struct ast_jb_conf *misdn_get_global_jbconf(void); + #endif diff --git a/channels/misdn_config.c b/channels/misdn_config.c index 0aca65c80..bdd14370c 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -56,6 +56,17 @@ 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 */ +static struct ast_jb_conf default_jbconf = +{ + .flags = 0, + .max_size = -1, + .resync_threshold = -1, + .impl = "", +}; + +static struct ast_jb_conf global_jbconf; + enum misdn_cfg_type { MISDN_CTYPE_STR, MISDN_CTYPE_INT, @@ -910,6 +921,8 @@ static void _build_general_config (struct ast_variable *v) int pos; for (; v; v = v->next) { + if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) + continue; if (((pos = get_cfg_position(v->name, GEN_CFG)) < 0) || (_parse(&general_cfg[pos], v->value, gen_spec[pos].type, gen_spec[pos].boolint_def) < 0)) CLI_ERROR(v->name, v->value, "general"); @@ -1084,6 +1097,9 @@ int misdn_cfg_init (int this_max_ports) ast_mutex_init(&config_mutex); + /* Copy the default jb config over global_jbconf */ + memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); + misdn_cfg_lock(); if (this_max_ports) { @@ -1132,4 +1148,6 @@ int misdn_cfg_init (int this_max_ports) return 0; } - +struct ast_jb_conf *misdn_get_global_jbconf() { + return &global_jbconf; +} |