Allow to configure (and better defaults) the increment in circuit numbers caused by each span.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2693 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-06-09 15:34:51 +00:00
parent bbf88687c2
commit 61629e34f8
6 changed files with 30 additions and 3 deletions

View File

@ -60,3 +60,9 @@
; offset: int: Offset of circuit code relative to start in span
;offset=0
; increment: integer: How much will increment this span the circuit number in
; the group it belongs to
; Defaults to 32 if chans is 30 or 31 (E1), 24 if chans is 23 (T1), number of
; circuits in all other cases
;increment=

View File

@ -66,6 +66,11 @@
; Defaults to 0 if missing or invalid
;offset=
; increment: integer: How much will increment this span the circuit number in
; the group it belongs to
; Defaults to 32 for E1, 24 for T1
;increment=
; samples: integer: Specify the number of data samples expected to be received
; It is used to create the buffer to read data from span. The total buffer will have the
; number of bytes given by the number of samples multiplied by the number of voice

View File

@ -102,6 +102,11 @@
; If missing, will be computed from type (E1: 1-15.17-31, T1: 1-23, BRI: 1-2, FXO/FXS: 1)
;voicechans=1-15.17-31
; increment: integer: How much will increment this span the circuit number in
; the group it belongs to
; Defaults to 32 for E1, 24 for T1, 3 for BRI
;increment=
; dtmfdetect: boolean: Set/reset DTMF detection on each zaptel channel used by
; a circuit belonging to this span
; If enabled and DTMF detection is not supported by the zaptel driver it will be disabled

View File

@ -785,9 +785,17 @@ bool MGCPSpan::init(const NamedList& params)
if (!m_count)
return false;
m_increment = m_count;
// assume 31 circuits means E1
if (m_increment == 31)
m_increment = 32;
// assume 23 circuits means T1, 30 or 31 circuits means E1
switch (m_increment) {
case 23:
m_increment = 24;
break;
case 30:
case 31:
m_increment = 32;
break;
}
m_increment = config->getIntValue("increment",m_increment);
m_circuits = new MGCPCircuit*[m_count];
unsigned int i;
for (i = 0; i < m_count; i++)

View File

@ -1406,6 +1406,8 @@ bool WpSpan::init(const NamedList& config, const NamedList& defaults, NamedList&
id().safe(),type.safe(),this);
return false;
}
m_increment = config.getIntValue("increment",m_increment);
// Other data
m_swap = defaults.getBoolValue("bitswap",true);
m_noData = defaults.getIntValue("idlevalue",0xff);

View File

@ -1853,6 +1853,7 @@ bool ZapSpan::init(ZapDevice::Type type, unsigned int offset,
if (!digital)
m_increment = chans = count;
m_increment = config.getIntValue("increment",m_increment);
unsigned int start = params.getIntValue("start",0);
// Create and insert circuits