summaryrefslogtreecommitdiff
path: root/channels/chan_alsa.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-05-31 16:56:50 +0000
committerRussell Bryant <russell@russellbryant.com>2006-05-31 16:56:50 +0000
commitbb7dd96cfeebec49a6adbed0c44ef92896fca2c1 (patch)
tree24a5e287490aa56d6fad0961d8832f1ba7eea1fd /channels/chan_alsa.c
parent503486e99d5bd1eb6ace4f62b3d6f4488b97b323 (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: https://origsvn.digium.com/svn/asterisk/trunk@31052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_alsa.c')
-rw-r--r--channels/chan_alsa.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index e85b051ee..a3cbfa2bc 100644
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -70,6 +70,17 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "alsa-monitor.h"
#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;
+
#define DEBUG 0
/* Which device to use */
#define ALSA_INDEV "hw:0,0"
@@ -812,6 +823,8 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state)
tmp = NULL;
}
}
+ if (tmp)
+ ast_jb_configure(tmp, &global_jbconf);
}
return tmp;
}
@@ -1051,9 +1064,18 @@ static int load_module(void *mod)
int x;
struct ast_config *cfg;
struct ast_variable *v;
+
+ /* Copy the default jb config over global_jbconf */
+ memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+
if ((cfg = ast_config_load(config))) {
v = ast_variable_browse(cfg, "general");
while(v) {
+ /* handle jb conf */
+ if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) {
+ v = v->next;
+ continue;
+ }
if (!strcasecmp(v->name, "autoanswer"))
autoanswer = ast_true(v->value);
else if (!strcasecmp(v->name, "silencesuppression"))