From dbf8dd45a4431b69d19d436d25072d3ddc956965 Mon Sep 17 00:00:00 2001 From: paulc Date: Tue, 4 May 2010 12:02:40 +0000 Subject: [PATCH] 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 --- conf.d/mgcpca.conf.sample | 9 +++++++++ modules/server/mgcpca.cpp | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/conf.d/mgcpca.conf.sample b/conf.d/mgcpca.conf.sample index d6709a5c..2e8f5e11 100644 --- a/conf.d/mgcpca.conf.sample +++ b/conf.d/mgcpca.conf.sample @@ -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 diff --git a/modules/server/mgcpca.cpp b/modules/server/mgcpca.cpp index e966980a..39cd1254 100644 --- a/modules/server/mgcpca.cpp +++ b/modules/server/mgcpca.cpp @@ -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]",