diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-31 16:56:50 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-31 16:56:50 +0000 |
commit | 1264d306ef99444c139d5467f47ae6bc50a296b2 (patch) | |
tree | 24a5e287490aa56d6fad0961d8832f1ba7eea1fd /channels/chan_zap.c | |
parent | e625fbb2b0a0a5c31c3c18cf4ee225d54b73c2ba (diff) |
Add support for using a jitterbuffer for RTP on bridged calls. This includes
a new implementation of a fixed size jitterbuffer, as well as support for the
existing adaptive jitterbuffer implementation. (issue #3854, Slav Klenov)
Thank you very much to Slav Klenov of Securax and all of the people involved
in the testing of this feature for all of your hard work!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31052 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r-- | channels/chan_zap.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 60b24e791..016bd1a39 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -109,6 +109,17 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */ #endif +#include "asterisk/abstract_jb.h" +/* 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; + #if !defined(ZT_SIG_EM_E1) || (defined(HAVE_LIBPRI) && !defined(ZT_SIG_HARDHDLC)) #error "Your zaptel is too old. please update" #endif @@ -684,6 +695,7 @@ static struct zt_pvt { #endif int polarity; int dsp_features; + struct ast_jb_conf jbconf; } *iflist = NULL, *ifend = NULL; @@ -5195,6 +5207,9 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int } } else ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); + /* Configure the new channel jb */ + if (tmp && i) + ast_jb_configure(tmp, &i->jbconf); return tmp; } @@ -6988,6 +7003,8 @@ static struct zt_pvt *mkintf(int channel, int signalling, int outsignalling, int for (x=0;x<3;x++) tmp->subs[x].zfd = -1; tmp->channel = channel; + /* Assign default jb conf to the new zt_pvt */ + memcpy(&tmp->jbconf, &global_jbconf, sizeof(struct ast_jb_conf)); } if (tmp) { @@ -10200,6 +10217,7 @@ static int setup_zap(int reload) { struct ast_config *cfg; struct ast_variable *v; + struct ast_variable *vjb; struct zt_pvt *tmp; char *chan; char *c; @@ -10289,6 +10307,11 @@ static int setup_zap(int reload) } #endif v = ast_variable_browse(cfg, "channels"); + /* Copy the default jb config over global_jbconf */ + memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); + /* Traverse all variables to handle jb conf */ + for (vjb = v; vjb; vjb = vjb->next) + ast_jb_read_conf(&global_jbconf, vjb->name, vjb->value); while(v) { /* Create the interface list */ if (!strcasecmp(v->name, "channel") |