#include "asterisk/dsp.h"
#include "asterisk/causes.h"
#include "asterisk/stringfields.h"
+#include "asterisk/abstract_jb.h"
#ifdef __cplusplus
}
#endif
/* global debug flag */
int h323debug;
+/*! 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;
+
/** Variables required by Asterisk */
static const char desc[] = "The NuFone Network's Open H.323 Channel Driver";
static const char tdesc[] = "The NuFone Network's Open H.323 Channel Driver";
ch = NULL;
}
}
+
+ /* Configure the new channel jb */
+ if (ch && pvt && pvt->rtp)
+ ast_jb_configure(ch, &global_jbconf);
} else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
}
global_options.dtmfmode = H323_DTMF_RFC2833;
global_options.capability = GLOBAL_CAPABILITY;
global_options.bridge = 1; /* Do native bridging by default */
+
+ /* Copy the default jb config over global_jbconf */
+ memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+
v = ast_variable_browse(cfg, "general");
- while(v) {
+ 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, "port")) {
h323_signalling_port = (int)strtol(v->value, NULL, 10);
#include "asterisk/utils.h"
#include "asterisk/causes.h"
#include "asterisk/astobj.h"
+#include "asterisk/abstract_jb.h"
#include "asterisk/jabber.h"
#include "asterisk/jingle.h"
#define JINGLE_CONFIG "jingle.conf"
+/*! 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 jingle_protocol {
AJI_PROTOCOL_UDP = 1,
AJI_PROTOCOL_SSLTCP = 2,
ast_hangup(tmp);
tmp = NULL;
}
+
+ /* Configure the new channel jb */
+ if (tmp && i && i->rtp)
+ ast_jb_configure(tmp, &global_jbconf);
+
return tmp;
}
return 0;
}
+ /* Copy the default jb config over global_jbconf */
+ memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+
cat = ast_category_browse(cfg, NULL);
for (var = ast_variable_browse(cfg, "general"); var; var = var->next) {
+ /* handle jb conf */
+ if (!ast_jb_read_conf(&global_jbconf, var->name, var->value))
+ continue;
+
if (!strcasecmp(var->name, "allowguest"))
allowguest =
(ast_true(ast_variable_retrieve(cfg, "general", "allowguest"))) ? 1 : 0;
#include "asterisk/dsp.h"
#include "asterisk/devicestate.h"
#include "asterisk/stringfields.h"
+#include "asterisk/abstract_jb.h"
#ifndef IPTOS_MINCOST
#define IPTOS_MINCOST 0x02
#define INADDR_NONE (in_addr_t)(-1)
#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;
+
static const char tdesc[] = "Media Gateway Control Protocol (MGCP)";
static const char config[] = "mgcp.conf";
This should be obsoleted */
char cxident[80];
char callid[80];
-/* SC: obsolete
- time_t lastouttime;
- int lastout;
-*/
int cxmode;
struct mgcp_request *cx_queue; /*!< SC: pending CX commands */
ast_mutex_t cx_queue_lock; /*!< SC: CX queue lock */
int iseq; /* Not used? RTP? */
int outgoing;
int alreadygone;
-/* SC: obsolete
- int messagepending;
- struct mgcp_message *msgs;
-*/
struct mgcp_subchannel *next; /* for out circular linked list */
};
ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_new(%s) created in state: %s\n",
tmp->name, ast_state2str(state));
}
+
+ /* Configure the new channel jb */
+ if (tmp && sub && sub->rtp)
+ ast_jb_configure(tmp, &global_jbconf);
} else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
}
}
memset(&bindaddr, 0, sizeof(bindaddr));
dtmfmode = 0;
+
+ /* Copy the default jb config over global_jbconf */
+ memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+
v = ast_variable_browse(cfg, "general");
- while(v) {
+ 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))) {
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an
; OSS 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 ZAP channel can't accept jitter,
- ; thus an enabled jitterbuffer on the receive ZAP side will always
- ; be used if the sending side can create jitter or if ZAP jb is
- ; forced.
-
- ; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a ZAP
- ; channel. Defaults to "no".
+ ; side can not accept jitter. The OSS channel can't accept jitter,
+ ; thus an enabled jitterbuffer on the receive OSS side will always
+ ; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
; 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 SIP
- ; channel. Two implementation are currenlty available - "fixed"
+ ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of an OSS
+ ; channel. Two implementations are currenlty available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.
struct ast_variable *chanvars; /*!< Channel variables to set for inbound call */
struct sip_pvt *next; /*!< Next dialog in chain */
struct sip_invite_param *options; /*!< Options for INVITE */
- struct ast_jb_conf jbconf;
} *iflist = NULL;
#define FLAG_RESPONSE (1 << 0)
/* Configure the new channel jb */
if (tmp && i && i->rtp)
- ast_jb_configure(tmp, &i->jbconf);
+ ast_jb_configure(tmp, &global_jbconf);
return tmp;
}
p->noncodeccapability |= AST_RTP_DTMF;
ast_string_field_set(p, context, default_context);
- /* Assign default jb conf to the new sip_pvt */
- memcpy(&p->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
-
/* Add to active dialog list */
ast_mutex_lock(&iflock);
p->next = iflist;
int nat;
int outgoing;
int alreadygone;
- struct ast_jb_conf jbconf;
-
struct skinny_subchannel *next;
};
callnums++;
sub->cxmode = SKINNY_CX_INACTIVE;
sub->nat = nat;
-
- /* Assign default jb conf to the new skinny_subchannel */
- memcpy(&sub->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
-
sub->next = l->sub;
l->sub = sub;
} else {
/* Configure the new channel jb */
if (tmp && sub && sub->rtp)
- ast_jb_configure(tmp, &sub->jbconf);
+ ast_jb_configure(tmp, &global_jbconf);
} else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
}
/* load the general section */
v = ast_variable_browse(cfg, "general");
- while(v) {
+ while (v) {
/* handle jb conf */
if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) {
v = v->next;
#endif
int polarity;
int dsp_features;
- struct ast_jb_conf jbconf;
-
} *iflist = NULL, *ifend = NULL;
static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause);
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
/* Configure the new channel jb */
if (tmp && i)
- ast_jb_configure(tmp, &i->jbconf);
+ ast_jb_configure(tmp, &global_jbconf);
return tmp;
}
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) {
; use user authentication at all.
;
;context=default
+;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
+ ; H323 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 H323 channel can accept jitter,
+ ; thus an enabled jitterbuffer on the receive H323 side will only
+ ; be used if the sending side can create jitter and jbforce is
+ ; also set to yes.
+
+; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a H323
+ ; 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 H323
+ ; channel. Two implementations are currenlty available - "fixed"
+ ; (with size always equals to jbmax-size) and "adaptive" (with
+ ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
+;-----------------------------------------------------------------------------------
;
; H.323 Alias definitions
;
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an
; ALSA 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 ZAP channel can't accept jitter,
- ; thus an enabled jitterbuffer on the receive ZAP side will always
- ; be used if the sending side can create jitter or if ZAP jb is
- ; forced.
-
-; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a ZAP
- ; channel. Defaults to "no".
+ ; side can not accept jitter. The ALSA channel can't accept jitter,
+ ; thus an enabled jitterbuffer on the receive ALSA side will always
+ ; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
;port = 2427
;bindaddr = 0.0.0.0
+;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
+ ; MGCP 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 MGCP channel can accept jitter,
+ ; thus an enabled jitterbuffer on the receive MGCP side will only
+ ; be used if the sending side can create jitter and jbforce is
+ ; also set to yes.
+
+; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a MGCP
+ ; 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 MGCP
+ ; channel. Two implementations are currenlty available - "fixed"
+ ; (with size always equals to jbmax-size) and "adaptive" (with
+ ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
+;-----------------------------------------------------------------------------------
+
;[dlinkgw]
;host = 192.168.0.64
;context = default
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an
; OSS 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 ZAP channel can't accept jitter,
- ; thus an enabled jitterbuffer on the receive ZAP side will always
- ; be used if the sending side can create jitter or if ZAP jb is
- ; forced.
-
- ; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a ZAP
- ; channel. Defaults to "no".
+ ; side can not accept jitter. The OSS channel can't accept jitter,
+ ; thus an enabled jitterbuffer on the receive OSS side will always
+ ; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
; 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 SIP
- ; channel. Two implementation are currenlty available - "fixed"
+ ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of an OSS
+ ; channel. Two implementations are currenlty available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.
; and programs. Defaults to 1000.
; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP
- ; channel. Two implementation are currenlty available - "fixed"
+ ; channel. Two implementations are currenlty available - "fixed"
; (with size always equals to jbmaxsize) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.
; and programs. Defaults to 1000.
;jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a
- ; skinny channel. Two implementation are currently available
+ ; skinny channel. Two implementations are currently available
; - "fixed" (with size always equals to jbmaxsize)
; - "adaptive" (with variable size, actually the new jb of IAX2).
; Defaults to fixed.
; be used only if the sending side can create and the receiving
; side can not accept jitter. The ZAP channel can't accept jitter,
; thus an enabled jitterbuffer on the receive ZAP side will always
- ; be used if the sending side can create jitter or if ZAP jb is
- ; forced.
-
-; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a ZAP
- ; channel. Defaults to "no".
+ ; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
; 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 SIP
- ; channel. Two implementation are currenlty available - "fixed"
+; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a ZAP
+ ; channel. Two implementations are currenlty available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.