Allow disabling the automatic SS7 Layer 2 emergency alignment for testing purposes.

git-svn-id: http://yate.null.ro/svn/yate/trunk@3503 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-08-24 10:35:31 +00:00
parent c505635786
commit 9bdf2a32b0
4 changed files with 24 additions and 3 deletions

View File

@ -473,6 +473,9 @@
; emergency: boolean: Emergency align SS7 MTP2 layer at startup
;emergency=yes
; autoemergency: boolean: Emergency align link if owner linkset is down
;autoemergency=yes
; filllink: boolean: Configure MTP2 to request link fill (packet repeat) when
; sending FISU or LSSU packets
;filllink=yes

View File

@ -221,7 +221,7 @@ ObjList* SS7Layer2::recoverMSU()
bool SS7Layer2::getEmergency(NamedList* params, bool emg) const
{
if (!emg) {
if (m_autoEmergency && !emg) {
const SS7MTP3* mtp3 = YOBJECT(SS7MTP3,m_l2user);
if (mtp3 && !mtp3->linksActive())
emg = true;
@ -302,9 +302,11 @@ bool SS7MTP2::initialize(const NamedList* config)
config->dump(tmp,"\r\n ",'\'',true);
Debug(this,DebugInfo,"SS7MTP2::initialize(%p) [%p]%s",config,this,tmp.c_str());
#endif
if (config)
if (config) {
debugLevel(config->getIntValue("debuglevel_mtp2",
config->getIntValue("debuglevel",-1)));
m_autoEmergency = config->getBoolValue("autoemergency",true);
}
bool noStart = true;
if (config && !iface()) {
NamedString* name = config->getParam("sig");
@ -343,6 +345,7 @@ bool SS7MTP2::control(Operation oper, NamedList* params)
if (params) {
lock();
m_fillLink = params->getBoolValue("filllink",m_fillLink);
m_autoEmergency = params->getBoolValue("autoemergency",m_autoEmergency);
// The following are for test purposes
if (params->getBoolValue("toggle-bib"))
m_bib = !m_bib;

View File

@ -847,6 +847,7 @@ bool SS7M2PA::initialize(const NamedList* config)
#endif
m_dumpMsg = config && config->getBoolValue("dumpMsg",false);
m_autostart = !config || config->getBoolValue("autostart",true);
m_autoEmergency = !config || config->getBoolValue("autoemergency",true);
if (config && !transport()) {
NamedString* name = config->getParam("sig");
if (!name)
@ -1108,6 +1109,10 @@ void SS7M2PA::sendAck()
bool SS7M2PA::control(Operation oper, NamedList* params)
{
if (params) {
m_autostart = params->getBoolValue("autostart",m_autostart);
m_autoEmergency = params->getBoolValue("autoemergency",m_autoEmergency);
}
switch (oper) {
case Pause:
m_state = OutOfService;
@ -1446,6 +1451,7 @@ bool SS7M2UA::initialize(const NamedList* config)
Debug(this,DebugInfo,"SS7M2UA::initialize(%p) [%p]%s",config,this,tmp.c_str());
#endif
m_autostart = !config || config->getBoolValue("autostart",true);
m_autoEmergency = !config || config->getBoolValue("autoemergency",true);
if (config && !adaptation()) {
m_iid = config->getIntValue("iid",m_iid);
NamedString* name = config->getParam("client");
@ -1478,6 +1484,10 @@ bool SS7M2UA::initialize(const NamedList* config)
bool SS7M2UA::control(Operation oper, NamedList* params)
{
if (params) {
m_autostart = params->getBoolValue("autostart",m_autostart);
m_autoEmergency = params->getBoolValue("autoemergency",m_autoEmergency);
}
switch (oper) {
case Pause:
m_linkState = LinkDown;

View File

@ -4965,7 +4965,7 @@ protected:
* Constructor
*/
inline SS7Layer2()
: m_lastSeqRx(-1),
: m_autoEmergency(true), m_lastSeqRx(-1),
m_l2userMutex(true,"SS7Layer2::l2user"), m_l2user(0), m_sls(-1),
m_check(0), m_inhibited(false)
{ }
@ -5003,6 +5003,11 @@ protected:
*/
bool getEmergency(NamedList* params = 0, bool emg = false) const;
/**
* Flag to automatically perform emergency alignment when linkset is down
*/
bool m_autoEmergency;
/**
* Last received MSU sequence number, -1 if unknown, bit 24 set if long FSN
*/