From f796193575703618e2b05e84545e3354543a8276 Mon Sep 17 00:00:00 2001 From: russell Date: Thu, 1 Jun 2006 16:47:28 +0000 Subject: - add the ability to configure forced jitterbuffers on h323, jingle, and mgcp channels - remove the jitterbuffer configuration from the pvt structures in the sip, zap, and skinny channel drivers, as copying the same global configuration into each pvt structure has no benefit. - update and fix some typos in jitterbuffer related documentation (issue #7257, north, with additional updates and modifications) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31413 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_jingle.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'channels/chan_jingle.c') diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index f335d4b26..3caa2dfe5 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -69,11 +69,22 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/utils.h" #include "asterisk/causes.h" #include "asterisk/astobj.h" +#include "asterisk/abstract_jb.h" #include "asterisk/jabber.h" #include "asterisk/jingle.h" #define JINGLE_CONFIG "jingle.conf" +/*! 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 jingle_protocol { AJI_PROTOCOL_UDP = 1, AJI_PROTOCOL_SSLTCP = 2, @@ -773,6 +784,11 @@ static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt * ast_hangup(tmp); tmp = NULL; } + + /* Configure the new channel jb */ + if (tmp && i && i->rtp) + ast_jb_configure(tmp, &global_jbconf); + return tmp; } @@ -1453,8 +1469,15 @@ static int jingle_load_config(void) return 0; } + /* Copy the default jb config over global_jbconf */ + memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); + cat = ast_category_browse(cfg, NULL); for (var = ast_variable_browse(cfg, "general"); var; var = var->next) { + /* handle jb conf */ + if (!ast_jb_read_conf(&global_jbconf, var->name, var->value)) + continue; + if (!strcasecmp(var->name, "allowguest")) allowguest = (ast_true(ast_variable_retrieve(cfg, "general", "allowguest"))) ? 1 : 0; -- cgit v1.2.3