Send a link management SNM even on inhibited links if nothing else is available.

git-svn-id: http://yate.null.ro/svn/yate/trunk@3721 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-10-19 04:30:53 +00:00
parent 95f7c9de99
commit 1f5acf67b1
2 changed files with 12 additions and 2 deletions

View File

@ -923,7 +923,9 @@ int SS7MTP3::transmitMSU(const SS7MSU& msu, const SS7Label& label, int sls)
if (!*p)
continue;
SS7Layer2* link = *p;
if (link->operational() && !link->inhibited() && link->transmitMSU(msu)) {
// if we are desperate use even inhibited (but checked) links
bool inh = (mgmt && (sls == -2)) ? link->inhibited(SS7Layer2::Unchecked) : link->inhibited();
if (link->operational() && !inh && link->transmitMSU(msu)) {
sls = link->sls();
DDebug(this,DebugAll,"Sent MSU over link '%s' %p with SLS=%d%s [%p]",
link->toString().c_str(),link,sls,
@ -933,7 +935,8 @@ int SS7MTP3::transmitMSU(const SS7MSU& msu, const SS7Label& label, int sls)
}
}
Debug(this,DebugWarn,"Could not find any link to send MSU [%p]",this);
Debug(this,((sls == -2) ? DebugWarn : DebugMild),
"Could not find any link to send %s MSU [%p]",msu.getServiceName(),this);
return -1;
}

View File

@ -683,6 +683,13 @@ int SS7Router::transmitMSU(const SS7MSU& msu, const SS7Label& label, int sls)
SS7Route::State states = SS7Route::NotProhibited;
switch (msu.getSIF()) {
case SS7MSU::SNM:
if ((msu.at(label.length()+1) & 0x0f) == SS7MsgSNM::MIM) {
int res = routeMSU(msu,label,0,sls,SS7Route::AnyState);
if (res >= 0)
return res;
// now we are desperate to send a link management packet
sls = -2;
}
case SS7MSU::MTN:
case SS7MSU::MTNS:
// Management and Maintenance can be sent even on prohibited routes