diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-06 14:11:34 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-06 14:11:34 +0000 |
commit | 73fdba4c4df4c2daadf1d1b041b5b8db8a4beccb (patch) | |
tree | 1c5a907fe31a0e14d27f216ca6c9985dad536401 /channels/chan_unistim.c | |
parent | f36c90c199831bf4240be5fffe13ed53df311cb6 (diff) |
Add jitterbuffer support to chan_unistim.
(closes issue #11168)
Reported by: IgorG
Patches:
unistimjb-88863-1.patch uploaded by IgorG (license 20)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88935 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_unistim.c')
-rw-r--r-- | channels/chan_unistim.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index b3d5ca446..039da45df 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -202,6 +202,17 @@ static void dummy(char *dummy, ...) return; } +/*! \brief 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; + + /* #define DUMP_PACKET 1 */ /* #define DEBUG_TIMER ast_verbose */ @@ -697,7 +708,7 @@ static const struct ast_channel_tech unistim_tech = { .type = type, .description = tdesc, .capabilities = CAPABILITY, - .properties = AST_CHAN_TP_WANTSJITTER, + .properties = AST_CHAN_TP_WANTSJITTER | AST_CHAN_TP_CREATESJITTER, .requester = unistim_request, .call = unistim_call, .hangup = unistim_hangup, @@ -4509,6 +4520,9 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state tmp->fds[0] = ast_rtp_fd(sub->rtp); tmp->fds[1] = ast_rtcp_fd(sub->rtp); } + if (sub->rtp) + ast_jb_configure(tmp, &global_jbconf); + /* tmp->type = type; */ ast_setstate(tmp, state); if (state == AST_STATE_RING) @@ -5353,11 +5367,18 @@ static int reload_config(void) ast_log(LOG_ERROR, "Unable to load config %s\n", config); return -1; } + + /* Copy the default jb config over global_jbconf */ + memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); unistim_keepalive = 120; unistim_port = 0; v = ast_variable_browse(cfg, "general"); while (v) { + /* handle jb conf */ + if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) + continue; + if (!strcasecmp(v->name, "keepalive")) unistim_keepalive = atoi(v->value); else if (!strcasecmp(v->name, "port")) |