[asterisk-commits] russell: trunk r88935 - in /trunk: channels/ configs/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 6 08:11:34 CST 2007
Author: russell
Date: Tue Nov 6 08:11:34 2007
New Revision: 88935
URL: http://svn.digium.com/view/asterisk?view=rev&rev=88935
Log:
Add jitterbuffer support to chan_unistim.
(closes issue #11168)
Reported by: IgorG
Patches:
unistimjb-88863-1.patch uploaded by IgorG (license 20)
Modified:
trunk/channels/chan_unistim.c
trunk/configs/unistim.conf.sample
Modified: trunk/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=88935&r1=88934&r2=88935
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Tue Nov 6 08:11:34 2007
@@ -201,6 +201,17 @@
{
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 @@
.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 @@
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 @@
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"))
Modified: trunk/configs/unistim.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/unistim.conf.sample?view=diff&rev=88935&r1=88934&r2=88935
==============================================================================
--- trunk/configs/unistim.conf.sample (original)
+++ trunk/configs/unistim.conf.sample Tue Nov 6 08:11:34 2007
@@ -8,6 +8,32 @@
;public_ip= ; if asterisk is behind a nat, specify your public IP
;autoprovisioning=no ; Allow undeclared phones to register an extension. See README for important
; informations. no (default), yes, tn.
+;------------------------------ 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".
+;-----------------------------------------------------------------------------------
+
;[black] ; name of the device
;device=000ae4012345 ; mac address of the phone
More information about the asterisk-commits
mailing list