[asterisk-commits] crichter: trunk r73298 - in /trunk: channels/ channels/misdn/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 5 02:45:21 CDT 2007


Author: crichter
Date: Thu Jul  5 02:45:21 2007
New Revision: 73298

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73298
Log:
added general Jitterbuffer Implementation. #9960

Modified:
    trunk/channels/chan_misdn.c
    trunk/channels/misdn/chan_misdn_config.h
    trunk/channels/misdn_config.c
    trunk/configs/misdn.conf.sample

Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=73298&r1=73297&r2=73298
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Thu Jul  5 02:45:21 2007
@@ -75,6 +75,7 @@
 #include "asterisk/term.h"
 #include "asterisk/sched.h"
 #include "asterisk/stringfields.h"
+#include "asterisk/abstract_jb.h"
 #include "asterisk/causes.h"
 
 #include "chan_misdn_config.h"
@@ -3228,7 +3229,7 @@
 		else
 			tmp->rings = 0;
 		
-		
+	        ast_jb_configure(tmp, misdn_get_global_jbconf());
 	} else {
 		chan_misdn_log(-1, 0, "Unable to allocate channel structure\n");
 	}

Modified: trunk/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/chan_misdn_config.h?view=diff&rev=73298&r1=73297&r2=73298
==============================================================================
--- trunk/channels/misdn/chan_misdn_config.h (original)
+++ trunk/channels/misdn/chan_misdn_config.h Thu Jul  5 02:45:21 2007
@@ -147,4 +147,6 @@
 int misdn_cfg_get_next_port_in_group(int port, char *group);
 #endif
 
+struct ast_jb_conf *misdn_get_global_jbconf(void);
+
 #endif

Modified: trunk/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn_config.c?view=diff&rev=73298&r1=73297&r2=73298
==============================================================================
--- trunk/channels/misdn_config.c (original)
+++ trunk/channels/misdn_config.c Thu Jul  5 02:45:21 2007
@@ -55,6 +55,17 @@
 #define PORT_CFG 2
 #define NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec))
 #define NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec))
+
+/*! 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 misdn_cfg_type {
 	MISDN_CTYPE_STR,
@@ -910,6 +921,8 @@
 	int pos;
 
 	for (; v; v = v->next) {
+		if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
+			continue;
 		if (((pos = get_cfg_position(v->name, GEN_CFG)) < 0) || 
 			(_parse(&general_cfg[pos], v->value, gen_spec[pos].type, gen_spec[pos].boolint_def) < 0))
 			CLI_ERROR(v->name, v->value, "general");
@@ -1084,6 +1097,9 @@
 
 	ast_mutex_init(&config_mutex);
 
+	/* Copy the default jb config over global_jbconf */
+	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+
 	misdn_cfg_lock();
 
 	if (this_max_ports) {
@@ -1132,4 +1148,6 @@
 	return 0;
 }
 
-
+struct ast_jb_conf *misdn_get_global_jbconf() {
+	return &global_jbconf;
+}

Modified: trunk/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/misdn.conf.sample?view=diff&rev=73298&r1=73297&r2=73298
==============================================================================
--- trunk/configs/misdn.conf.sample (original)
+++ trunk/configs/misdn.conf.sample Thu Jul  5 02:45:21 2007
@@ -129,6 +129,32 @@
 ; which are inherited by group sections.
 ;
 
+;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
+                              ; SIP channel. Defaults to "no". An enabled jitterbuffer will
+                              ; be used only if the sending side can create and the receiving
+                              ; side can not accept jitter. The SIP channel can accept jitter,
+                              ; thus a jitterbuffer on the receive SIP side will be used only
+                              ; if it is forced and enabled.
+
+; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a SIP
+                              ; channel. Defaults to "no".
+
+; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
+
+; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
+                              ; resynchronized. Useful to improve the quality of the voice, with
+                              ; big jumps in/broken timestamps, usually sent from exotic devices
+                              ; and programs. Defaults to 1000.
+
+; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
+                              ; channel. Two implementations are currently available - "fixed"
+                              ; (with size always equals to jbmaxsize) and "adaptive" (with
+                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
+;-----------------------------------------------------------------------------------
+
 [default]
 
 ; define your default context here




More information about the asterisk-commits mailing list