ISUP: Keep track of the Layer 3 network. Don't send MSUs when down.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1811 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
13e7665e75
commit
25262cbc01
|
@ -1969,6 +1969,7 @@ SS7ISUP::SS7ISUP(const NamedList& params)
|
||||||
m_priossf(0),
|
m_priossf(0),
|
||||||
m_sls(255),
|
m_sls(255),
|
||||||
m_inn(false),
|
m_inn(false),
|
||||||
|
m_l3LinkUp(false),
|
||||||
m_rscTimer(0),
|
m_rscTimer(0),
|
||||||
m_rscCic(0),
|
m_rscCic(0),
|
||||||
m_lockTimer(0),
|
m_lockTimer(0),
|
||||||
|
@ -2095,6 +2096,10 @@ SS7MSU* SS7ISUP::createMSU(SS7MsgISUP::Type type, unsigned char ssf,
|
||||||
// Make an outgoing call
|
// Make an outgoing call
|
||||||
SignallingCall* SS7ISUP::call(SignallingMessage* msg, String& reason)
|
SignallingCall* SS7ISUP::call(SignallingMessage* msg, String& reason)
|
||||||
{
|
{
|
||||||
|
if (!m_l3LinkUp) {
|
||||||
|
reason = "net-out-of-order";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
reason = "invalid-parameter";
|
reason = "invalid-parameter";
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2147,6 +2152,10 @@ int SS7ISUP::transmitMessage(SS7MsgISUP* msg, const SS7Label& label, bool recvLb
|
||||||
{
|
{
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return -1;
|
return -1;
|
||||||
|
if (!m_l3LinkUp) {
|
||||||
|
TelEngine::destruct(msg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
const SS7Label* p = &label;
|
const SS7Label* p = &label;
|
||||||
SS7Label tmp;
|
SS7Label tmp;
|
||||||
if (recvLbl) {
|
if (recvLbl) {
|
||||||
|
@ -2168,7 +2177,7 @@ int SS7ISUP::transmitMessage(SS7MsgISUP* msg, const SS7Label& label, bool recvLb
|
||||||
XDebug(this,DebugMild,"Failed to send message (%p): '%s'",msg,msg->name());
|
XDebug(this,DebugMild,"Failed to send message (%p): '%s'",msg,msg->name());
|
||||||
if (m_sls == 255)
|
if (m_sls == 255)
|
||||||
m_sls = (unsigned char)sls;
|
m_sls = (unsigned char)sls;
|
||||||
msg->deref();
|
TelEngine::destruct(msg);
|
||||||
return sls;
|
return sls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2207,7 +2216,7 @@ void SS7ISUP::destruct()
|
||||||
void SS7ISUP::timerTick(const Time& when)
|
void SS7ISUP::timerTick(const Time& when)
|
||||||
{
|
{
|
||||||
Lock lock(this);
|
Lock lock(this);
|
||||||
if (!circuits())
|
if (!(m_l3LinkUp && circuits()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Blocking/unblocking circuits
|
// Blocking/unblocking circuits
|
||||||
|
@ -2251,12 +2260,9 @@ void SS7ISUP::notify(SS7Layer3* link, int sls)
|
||||||
{
|
{
|
||||||
if (!link)
|
if (!link)
|
||||||
return;
|
return;
|
||||||
|
m_l3LinkUp = link->operational(-1);
|
||||||
DDebug(this,DebugInfo,"L3 (%p,'%s') is %soperational",link,
|
DDebug(this,DebugInfo,"L3 (%p,'%s') is %soperational",link,
|
||||||
link->toString().safe(),link->operational()?"":"not ");
|
link->toString().safe(),m_l3LinkUp?"":"not ");
|
||||||
if (!link->operational(sls))
|
|
||||||
return;
|
|
||||||
// TODO: reset local state changed flag when link is not operational
|
|
||||||
// set local state changed flag when link is operational to notify remote party
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio,
|
SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio,
|
||||||
|
|
|
@ -5170,6 +5170,7 @@ private:
|
||||||
String m_numScreening; // Number screening
|
String m_numScreening; // Number screening
|
||||||
String m_callerCat; // Caller party category
|
String m_callerCat; // Caller party category
|
||||||
String m_format; // Default format
|
String m_format; // Default format
|
||||||
|
bool m_l3LinkUp; // Flag indicating the availability of a Layer3 data link
|
||||||
// Circuit reset
|
// Circuit reset
|
||||||
SignallingTimer m_rscTimer; // RSC message or idle timeout
|
SignallingTimer m_rscTimer; // RSC message or idle timeout
|
||||||
SignallingCircuit* m_rscCic; // Circuit currently beeing reset
|
SignallingCircuit* m_rscCic; // Circuit currently beeing reset
|
||||||
|
|
Loading…
Reference in New Issue