aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_jingle.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-01 16:47:28 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-01 16:47:28 +0000
commitf796193575703618e2b05e84545e3354543a8276 (patch)
tree65c18318da656f3d8bdc20876d5774763985c46a /channels/chan_jingle.c
parent9f95248be1f852e3b6d2171eb0d95c715471f881 (diff)
- 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
Diffstat (limited to 'channels/chan_jingle.c')
-rw-r--r--channels/chan_jingle.c23
1 files changed, 23 insertions, 0 deletions
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;