Added silent MSU transfer mode (STP without route advertising).

git-svn-id: http://voip.null.ro/svn/yate@3908 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-12-06 09:37:37 +00:00
parent 458b21019e
commit 7102b79539
3 changed files with 15 additions and 5 deletions

View File

@ -541,6 +541,7 @@
; transfer: boolean: Enable the Transfer function (STP mode)
; Enabling STP allows routing messages between adjacent networks
; By default only the SN and discrimination functions are enabled
; The special "silent" value performs message transfer without advertising
;transfer=no
; local: string: Declare a default local pointcode for the attached SS7 networks

View File

@ -324,7 +324,7 @@ SS7Router::SS7Router(const NamedList& params)
m_changes(0), m_transfer(false), m_phase2(false), m_started(false),
m_restart(0), m_isolate(0),
m_trafficOk(0), m_trafficSent(0), m_routeTest(0), m_testRestricted(false),
m_checkRoutes(false), m_autoAllowed(false),
m_transferSilent(false), 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_mngmt(0)
@ -337,7 +337,11 @@ SS7Router::SS7Router(const NamedList& params)
&params,this,tmp.c_str());
}
#endif
m_transfer = params.getBoolValue("transfer");
const String* tr = params.getParam("transfer");
if (!TelEngine::null(tr)) {
m_transferSilent = (*tr == "silent");
m_transfer = !m_transferSilent && tr->toBoolean();
}
m_autoAllowed = params.getBoolValue("autoallow",m_autoAllowed);
m_sendUnavail = params.getBoolValue("sendupu",m_sendUnavail);
m_sendProhibited = params.getBoolValue("sendtfp",m_sendProhibited);
@ -367,7 +371,11 @@ bool SS7Router::initialize(const NamedList* config)
if (config) {
debugLevel(config->getIntValue("debuglevel_router",
config->getIntValue("debuglevel",-1)));
m_transfer = config->getBoolValue("transfer",m_transfer);
const String* tr = config->getParam("transfer");
if (!TelEngine::null(tr)) {
m_transferSilent = (*tr == "silent");
m_transfer = !m_transferSilent && tr->toBoolean(m_transfer);
}
m_autoAllowed = config->getBoolValue("autoallow",m_autoAllowed);
m_sendUnavail = config->getBoolValue("sendupu",m_sendUnavail);
m_sendProhibited = config->getBoolValue("sendtfp",m_sendProhibited);
@ -863,11 +871,11 @@ HandledMSU SS7Router::receivedMSU(const SS7MSU& msu, const SS7Label& label, SS7L
}
unsigned int dpc = label.dpc().pack(label.type());
bool local = getLocal(label.type()) == dpc;
if (network && !local)
if (network && !local && (ret != HandledMSU::NoCircuit))
local = network->getLocal(label.type()) == dpc;
if (local)
return m_sendUnavail ? HandledMSU::Unequipped : HandledMSU::Failure;
if (m_transfer) {
if (m_transfer || m_transferSilent) {
if (routeMSU(msu,label,network,label.sls(),SS7Route::NotProhibited) >= 0)
return HandledMSU::Accepted;
return m_sendProhibited ? HandledMSU::NoAddress : HandledMSU::Failure;

View File

@ -6384,6 +6384,7 @@ private:
SignallingTimer m_trafficSent;
SignallingTimer m_routeTest;
bool m_testRestricted;
bool m_transferSilent;
bool m_checkRoutes;
bool m_autoAllowed;
bool m_sendUnavail;