Added optional "voicechans" setting to indicate used MGCP voice circuits.
git-svn-id: http://voip.null.ro/svn/yate@3285 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
f3f446044f
commit
dbf8dd45a4
|
@ -132,7 +132,16 @@
|
|||
; explicitely enabled will become default
|
||||
;default=no
|
||||
|
||||
; voicechans: string: The range of channels used for voice (data) transfer
|
||||
; Channel intervals may be specified by separating the margins using the '-' character
|
||||
; Individual channels or channel intervals may be separated by '.'
|
||||
; Duplicate or not strict positive channel numbers are not allowed
|
||||
; If specified the highest circuit number is used as number of PSTN channels
|
||||
; E.g. 1-15.17-31 or 1-23 or 1.2.3-15.17.18-30.31
|
||||
;voicechans=
|
||||
|
||||
; chans: int: Number of PSTN circuits to create in span
|
||||
; Defaults to 1 or highest voicechan declared
|
||||
;chans=1
|
||||
|
||||
; offset: int: Offset of circuit code relative to start in span
|
||||
|
|
|
@ -870,7 +870,11 @@ bool MGCPSpan::init(const NamedList& params)
|
|||
id().safe(),this);
|
||||
return false;
|
||||
}
|
||||
m_count = config->getIntValue("chans",1);
|
||||
SignallingCircuitRange range(config->getValue("voicechans"));
|
||||
m_count = 1;
|
||||
if (range.count())
|
||||
m_count = range[range.count()-1];
|
||||
m_count = config->getIntValue("chans",m_count);
|
||||
cicStart += config->getIntValue("offset");
|
||||
|
||||
if (!m_count)
|
||||
|
@ -896,6 +900,8 @@ bool MGCPSpan::init(const NamedList& params)
|
|||
m_circuits[i] = 0;
|
||||
bool ok = true;
|
||||
for (i = 0; i < m_count; i++) {
|
||||
if (range.count() && !range.find(i+1))
|
||||
continue;
|
||||
String name = epId().id();
|
||||
if (!tailIncrement(name,i)) {
|
||||
Debug(m_group,DebugWarn,"MGCPSpan('%s'). Failed to increment name by %u. Rollback [%p]",
|
||||
|
|
Loading…
Reference in New Issue