Added setting to turn adjacent routes Allowed on first regular MSU received.
This allows interoperating with broken implementations that don't send TRA. git-svn-id: http://voip.null.ro/svn/yate@3643 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
559fe54330
commit
4ed0a17cc9
|
@ -550,6 +550,10 @@
|
||||||
; According to the standard the restart is performed on first link activation
|
; According to the standard the restart is performed on first link activation
|
||||||
;autostart=no
|
;autostart=no
|
||||||
|
|
||||||
|
; autoallow: boolean: Turn adjacent routes Allowed on first received regular MSU
|
||||||
|
; Should be used only to interoperate with broken implementations
|
||||||
|
;autoallow=no
|
||||||
|
|
||||||
; sendupu: boolean: Send User Part Unavailable (UPU) SNM messages
|
; sendupu: boolean: Send User Part Unavailable (UPU) SNM messages
|
||||||
;sendupu=yes
|
;sendupu=yes
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,8 @@ SS7Router::SS7Router(const NamedList& params)
|
||||||
Mutex(true,"SS7Router"),
|
Mutex(true,"SS7Router"),
|
||||||
m_changes(0), m_transfer(false), m_phase2(false), m_started(false),
|
m_changes(0), m_transfer(false), m_phase2(false), m_started(false),
|
||||||
m_restart(0), m_isolate(0), m_routeTest(0), m_testRestricted(false),
|
m_restart(0), m_isolate(0), m_routeTest(0), m_testRestricted(false),
|
||||||
m_checkRoutes(false), m_sendUnavail(true), m_sendProhibited(true),
|
m_checkRoutes(false), m_autoAllowed(false),
|
||||||
|
m_sendUnavail(true), m_sendProhibited(true),
|
||||||
m_rxMsu(0), m_txMsu(0), m_fwdMsu(0), m_congestions(0),
|
m_rxMsu(0), m_txMsu(0), m_fwdMsu(0), m_congestions(0),
|
||||||
m_mngmt(0)
|
m_mngmt(0)
|
||||||
{
|
{
|
||||||
|
@ -257,6 +258,7 @@ SS7Router::SS7Router(const NamedList& params)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
m_transfer = params.getBoolValue("transfer");
|
m_transfer = params.getBoolValue("transfer");
|
||||||
|
m_autoAllowed = params.getBoolValue("autoallow",m_autoAllowed);
|
||||||
m_sendUnavail = params.getBoolValue("sendupu",m_sendUnavail);
|
m_sendUnavail = params.getBoolValue("sendupu",m_sendUnavail);
|
||||||
m_sendProhibited = params.getBoolValue("sendtfp",m_sendProhibited);
|
m_sendProhibited = params.getBoolValue("sendtfp",m_sendProhibited);
|
||||||
m_restart.interval(params,"starttime",5000,(m_transfer ? 60000 : 10000),false);
|
m_restart.interval(params,"starttime",5000,(m_transfer ? 60000 : 10000),false);
|
||||||
|
@ -284,6 +286,7 @@ bool SS7Router::initialize(const NamedList* config)
|
||||||
debugLevel(config->getIntValue("debuglevel_router",
|
debugLevel(config->getIntValue("debuglevel_router",
|
||||||
config->getIntValue("debuglevel",-1)));
|
config->getIntValue("debuglevel",-1)));
|
||||||
m_transfer = config->getBoolValue("transfer",m_transfer);
|
m_transfer = config->getBoolValue("transfer",m_transfer);
|
||||||
|
m_autoAllowed = config->getBoolValue("autoallow",m_autoAllowed);
|
||||||
m_sendUnavail = config->getBoolValue("sendupu",m_sendUnavail);
|
m_sendUnavail = config->getBoolValue("sendupu",m_sendUnavail);
|
||||||
m_sendProhibited = config->getBoolValue("sendtfp",m_sendProhibited);
|
m_sendProhibited = config->getBoolValue("sendtfp",m_sendProhibited);
|
||||||
const String* param = config->getParam("management");
|
const String* param = config->getParam("management");
|
||||||
|
@ -683,6 +686,18 @@ int SS7Router::transmitMSU(const SS7MSU& msu, const SS7Label& label, int sls)
|
||||||
|
|
||||||
HandledMSU SS7Router::receivedMSU(const SS7MSU& msu, const SS7Label& label, SS7Layer3* network, int sls)
|
HandledMSU SS7Router::receivedMSU(const SS7MSU& msu, const SS7Label& label, SS7Layer3* network, int sls)
|
||||||
{
|
{
|
||||||
|
if (m_autoAllowed && (msu.getSIF() > SS7MSU::MTNS)) {
|
||||||
|
unsigned int src = label.opc().pack(label.type());
|
||||||
|
Lock mylock(m_routeMutex);
|
||||||
|
SS7Route* route = findRoute(label.type(),src);
|
||||||
|
if (route && !route->priority() && (route->state() & (SS7Route::Unknown|SS7Route::Prohibited))) {
|
||||||
|
Debug(this,DebugNote,"Auto activating adjacent route %u on '%s' [%p]",
|
||||||
|
src,(network ? network->toString().c_str() : (const char*)0),this);
|
||||||
|
setRouteSpecificState(label.type(),src,src,SS7Route::Allowed,network);
|
||||||
|
if (m_transfer && m_started)
|
||||||
|
notifyRoutes(SS7Route::KnownState,src);
|
||||||
|
}
|
||||||
|
}
|
||||||
lock();
|
lock();
|
||||||
m_rxMsu++;
|
m_rxMsu++;
|
||||||
ObjList* l;
|
ObjList* l;
|
||||||
|
@ -1432,6 +1447,7 @@ bool SS7Router::control(NamedList& params)
|
||||||
if (!(cmp && toString() == cmp))
|
if (!(cmp && toString() == cmp))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
m_autoAllowed = params.getBoolValue("autoallow",m_autoAllowed);
|
||||||
m_sendUnavail = params.getBoolValue("sendupu",m_sendUnavail);
|
m_sendUnavail = params.getBoolValue("sendupu",m_sendUnavail);
|
||||||
m_sendProhibited = params.getBoolValue("sendtfp",m_sendProhibited);
|
m_sendProhibited = params.getBoolValue("sendtfp",m_sendProhibited);
|
||||||
String err;
|
String err;
|
||||||
|
|
|
@ -6290,6 +6290,7 @@ private:
|
||||||
SignallingTimer m_routeTest;
|
SignallingTimer m_routeTest;
|
||||||
bool m_testRestricted;
|
bool m_testRestricted;
|
||||||
bool m_checkRoutes;
|
bool m_checkRoutes;
|
||||||
|
bool m_autoAllowed;
|
||||||
bool m_sendUnavail;
|
bool m_sendUnavail;
|
||||||
bool m_sendProhibited;
|
bool m_sendProhibited;
|
||||||
unsigned long m_rxMsu;
|
unsigned long m_rxMsu;
|
||||||
|
|
Loading…
Reference in New Issue