From 4197d06b725f6236c240b9ac11df41599e3572bb Mon Sep 17 00:00:00 2001 From: marian Date: Wed, 19 Mar 2008 11:49:53 +0000 Subject: [PATCH] Change 'changed' flag when receiving circuit (un)blocking responses. git-svn-id: http://voip.null.ro/svn/yate@1809 acf43c95-373e-0410-b603-e72c3f656dc1 --- libs/ysig/isup.cpp | 19 ++++++++----------- libs/ysig/yatesig.h | 3 ++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libs/ysig/isup.cpp b/libs/ysig/isup.cpp index 2aa23199..b4317942 100644 --- a/libs/ysig/isup.cpp +++ b/libs/ysig/isup.cpp @@ -2628,14 +2628,12 @@ SignallingEvent* SS7ISUP::processCircuitEvent(SignallingCircuitEvent& event, case SignallingCircuitEvent::NoAlarm: if (event.circuit()) { lock(); - // TODO: check if the circuit should be locked now or when received the response -// blockCircuit(event.circuit()->code(), -// event.type()==SignallingCircuitEvent::Alarm,false,true); + // TODO: The circuit should be locked now or when received the response ? event.circuit()->setLock(SignallingCircuit::LockLocalChanged); if (event.type() == SignallingCircuitEvent::Alarm) event.circuit()->setLock(SignallingCircuit::LockLocalHWFailure); else - event.circuit()->setLock(~SignallingCircuit::LockLocalHWFailure); + event.circuit()->resetLock(SignallingCircuit::LockLocalHWFailure); m_lockNeed = true; unlock(); } @@ -2810,13 +2808,10 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s reason = "wrong-state-message"; break; } - if (!blockCircuit(msg->cic(),m_lockFlags,false,false)) { + if (!blockCircuit(msg->cic(),m_lockFlags,false,false,true)) { reason = "unknown-channel"; break; } - SignallingCircuit* cic = circuits() ? circuits()->find(msg->cic()) : 0; - if (cic) - cic->resetLock(SignallingCircuit::LockLocalChanged); sendLocalLock(); } break; @@ -2853,8 +2848,7 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s // TODO: Max bits set to 1 should be 32 for (unsigned int i = 0; i < m_lockMap.length(); i++) if (m_lockMap[i] != '0') - blockCircuit(msg->cic()+i,block,true,hwFail); -// TODO: reset changed flag + blockCircuit(msg->cic()+i,block,true,hwFail,true); sendLocalLock(); } break; @@ -2944,7 +2938,8 @@ bool SS7ISUP::resetCircuit(unsigned int cic, bool checkCall) // Block/unblock a circuit // See Q.764 2.8.2 -bool SS7ISUP::blockCircuit(unsigned int cic, bool block, bool remote, bool hwFail) +bool SS7ISUP::blockCircuit(unsigned int cic, bool block, bool remote, bool hwFail, + bool resetChg) { SignallingCircuit* circuit = circuits() ? circuits()->find(cic) : 0; if (!circuit) @@ -2960,6 +2955,8 @@ bool SS7ISUP::blockCircuit(unsigned int cic, bool block, bool remote, bool hwFai lockFlag = SignallingCircuit::LockLocal; if (hwFail) hwFlag = SignallingCircuit::LockLocalHWFailure; + if (resetChg) + circuit->resetLock(SignallingCircuit::LockLocalChanged); } // Already blocked/unblocked ? if (block == (0 != circuit->locked(lockFlag))) { diff --git a/libs/ysig/yatesig.h b/libs/ysig/yatesig.h index c385f5a7..d06ef4ab 100644 --- a/libs/ysig/yatesig.h +++ b/libs/ysig/yatesig.h @@ -5149,7 +5149,8 @@ private: bool resetCircuit(unsigned int cic, bool checkCall); // Block/unblock a circuit side (local or remote) // Return false if the given circuit doesn't exist - bool blockCircuit(unsigned int cic, bool block, bool remote, bool hwFail); + bool blockCircuit(unsigned int cic, bool block, bool remote, bool hwFail, + bool resetChg = false); // Find a call by its circuit identification code SS7ISUPCall* findCall(unsigned int cic); // Send blocking/unblocking messages