[asterisk-commits] branch north/chan_skinny-fixup r31252 - in /team/north/chan_skinny-fixup: cha...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 31 21:49:39 MST 2006


Author: north
Date: Wed May 31 23:49:39 2006
New Revision: 31252

URL: http://svn.digium.com/view/asterisk?rev=31252&view=rev
Log:
Okay, so the jb config changes for skinny were the same..

The rest, not so much.

Modified:
    team/north/chan_skinny-fixup/channels/chan_skinny.c
    team/north/chan_skinny-fixup/configs/skinny.conf.sample

Modified: team/north/chan_skinny-fixup/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/north/chan_skinny-fixup/channels/chan_skinny.c?rev=31252&r1=31251&r2=31252&view=diff
==============================================================================
--- team/north/chan_skinny-fixup/channels/chan_skinny.c (original)
+++ team/north/chan_skinny-fixup/channels/chan_skinny.c Wed May 31 23:49:39 2006
@@ -70,6 +70,7 @@
 #include "asterisk/utils.h"
 #include "asterisk/dsp.h"
 #include "asterisk/stringfields.h"
+#include "asterisk/abstract_jb.h"
 
 /*************************************
  * Skinny/Asterisk Protocol Settings *
@@ -112,6 +113,15 @@
 #define htoles(x) __bswap_16(x)
 #endif
 
+/*! 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;
 
 /*********************
  * Protocol Messages *
@@ -892,6 +902,7 @@
 	int nat;
 	int outgoing;
 	int alreadygone;
+	struct ast_jb_conf jbconf;
 
 	struct skinny_line *next;
 	struct skinny_device *parent;
@@ -1778,6 +1789,9 @@
 					l->cxmode = SKINNY_CX_INACTIVE;
 					l->nat = nat;
 
+					/* Assign default jb conf to the new skinny_line */
+					memcpy(&l->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
+
 					l->next = d->lines;
 					d->lines = l;
 				} else {
@@ -2420,6 +2434,10 @@
 				tmp = NULL;
 			}
 		}
+
+		/* Configure the new channel jb */
+		if (tmp && l && l->rtp)
+			ast_jb_configure(tmp, &l->jbconf);
 	} else {
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 	}
@@ -3872,10 +3890,21 @@
 		ast_log(LOG_NOTICE, "Unable to load config %s, Skinny disabled\n", config);
 		return 0;
 	}
+	memset(&bindaddr, 0, sizeof(bindaddr));
+
+	/* Copy the default jb config over global_jbconf */
+	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+
 	/* load the general section */
-	memset(&bindaddr, 0, sizeof(bindaddr));
 	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;
+		}
+
 		/* Create the interface list */
 		if (!strcasecmp(v->name, "bindaddr")) {
 			if (!(hp = ast_gethostbyname(v->value, &ahp))) {

Modified: team/north/chan_skinny-fixup/configs/skinny.conf.sample
URL: http://svn.digium.com/view/asterisk/team/north/chan_skinny-fixup/configs/skinny.conf.sample?rev=31252&r1=31251&r2=31252&view=diff
==============================================================================
--- team/north/chan_skinny-fixup/configs/skinny.conf.sample (original)
+++ team/north/chan_skinny-fixup/configs/skinny.conf.sample Wed May 31 23:49:39 2006
@@ -9,6 +9,33 @@
 
 ;allow=all
 ;disallow=
+
+;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+;jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
+                             ; skinny 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 skinny channel can accept
+                             ; jitter, thus a jitterbuffer on the receive skinny 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 skinny
+                             ; 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, usualy sent from exotic devices
+                             ; and programs. Defaults to 1000.
+
+;jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a
+                             ; skinny channel. Two implementation are currently available
+                             ; - "fixed" (with size always equals to jbmaxsize)
+                             ; - "adaptive" (with variable size, actually the new jb of IAX2).
+                             ; Defaults to fixed.
+
+;jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
+;-----------------------------------------------------------------------------------
 
 
 ; Typical config for 12SP+



More information about the asterisk-commits mailing list