diff --git a/libs/ysig/dumper.cpp b/libs/ysig/dumper.cpp index 596a9d34..b605f6e4 100644 --- a/libs/ysig/dumper.cpp +++ b/libs/ysig/dumper.cpp @@ -211,20 +211,20 @@ bool SignallingDumpable::setDumper(const String& name, bool create, bool append) bool SignallingDumpable::control(NamedList& params, SignallingComponent* owner) { - String* tmp = params.getParam("operation"); - if (!(tmp && (*tmp == "sigdump"))) + String* tmp = params.getParam(YSTRING("operation")); + if (!(tmp && (*tmp == YSTRING("sigdump")))) return false; - tmp = params.getParam("component"); + tmp = params.getParam(YSTRING("component")); if (tmp && *tmp && owner && (owner->toString() != *tmp)) return false; - tmp = params.getParam("completion"); + tmp = params.getParam(YSTRING("completion")); if (tmp) { if (!owner) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); return Module::itemComplete(*tmp,owner->toString(),part); } - tmp = params.getParam("file"); + tmp = params.getParam(YSTRING("file")); if (tmp) return setDumper(*tmp); return false; diff --git a/libs/ysig/engine.cpp b/libs/ysig/engine.cpp index e04bff0a..ae2e2cfe 100644 --- a/libs/ysig/engine.cpp +++ b/libs/ysig/engine.cpp @@ -92,21 +92,21 @@ SignallingComponent* SignallingFactory::build(const String& type, const NamedLis lock.drop(); DDebug(DebugInfo,"Factory creating default '%s' named '%s'",type.c_str(),name->c_str()); // now build some objects we know about - if (type == "SS7MTP2") + if (type == YSTRING("SS7MTP2")) return new SS7MTP2(*name); - else if (type == "SS7M2PA") + else if (type == YSTRING("SS7M2PA")) return new SS7M2PA(*name); - else if (type == "SS7MTP3") + else if (type == YSTRING("SS7MTP3")) return new SS7MTP3(*name); - else if (type == "SS7Router") + else if (type == YSTRING("SS7Router")) return new SS7Router(*name); - else if (type == "SS7Management") + else if (type == YSTRING("SS7Management")) return new SS7Management(*name); - else if (type == "ISDNQ921") + else if (type == YSTRING("ISDNQ921")) return new ISDNQ921(*name,*name); - else if (type == "ISDNQ931") + else if (type == YSTRING("ISDNQ931")) return new ISDNQ931(*name,*name); - else if (type == "ISDNQ931Monitor") + else if (type == YSTRING("ISDNQ931Monitor")) return new ISDNQ931Monitor(*name,*name); Debug(DebugMild,"Factory could not create '%s' named '%s'",type.c_str(),name->c_str()); return 0; @@ -132,9 +132,9 @@ SignallingComponent::SignallingComponent(const char* name, const NamedList* para : m_engine(0), m_compType("unknown") { if (params) { - name = params->getValue("debugname",name); - m_compType = params->getValue("type",m_compType); - debugLevel(params->getIntValue("debuglevel",-1)); + name = params->getValue(YSTRING("debugname"),name); + m_compType = params->getValue(YSTRING("type"),m_compType); + debugLevel(params->getIntValue(YSTRING("debuglevel"),-1)); } DDebug(engine(),DebugAll,"Component '%s' created [%p]",name,this); setName(name); diff --git a/libs/ysig/isup.cpp b/libs/ysig/isup.cpp index 70493ead..d0b70697 100644 --- a/libs/ysig/isup.cpp +++ b/libs/ysig/isup.cpp @@ -2062,7 +2062,7 @@ static void getMsgCompat(SS7MsgISUP* msg, bool& release, bool& cnf) { if (!msg) return; - String* msgCompat = msg->params().getParam("MessageCompatInformation"); + String* msgCompat = msg->params().getParam(YSTRING("MessageCompatInformation")); if (msgCompat) { ObjList* l = msgCompat->split(',',false); // Use a while() to make sure the list is destroyed @@ -2209,7 +2209,7 @@ SignallingEvent* SS7ISUPCall::getEvent(const Time& when) } // Process received messages msg = static_cast(dequeue()); - if (msg && validMsgState(false,msg->type(),(msg->params().getParam("BackwardCallIndicators") != 0))) + if (msg && validMsgState(false,msg->type(),(msg->params().getParam(YSTRING("BackwardCallIndicators")) != 0))) switch (msg->type()) { case SS7MsgISUP::IAM: case SS7MsgISUP::CCR: @@ -2237,7 +2237,7 @@ SignallingEvent* SS7ISUPCall::getEvent(const Time& when) break; case SS7MsgISUP::SAM: setOverlapped(isCalledIncomplete(msg->params(),"SubsequentNumber")); - msg->params().addParam("tone",msg->params().getValue("SubsequentNumber")); + msg->params().addParam("tone",msg->params().getValue(YSTRING("SubsequentNumber"))); msg->params().addParam("dialing",String::boolText(true)); m_lastEvent = new SignallingEvent(SignallingEvent::Info,msg,this); break; @@ -2380,7 +2380,7 @@ bool SS7ISUPCall::sendEvent(SignallingEvent* event) setOverlapped(isCalledIncomplete(m_iamMsg->params())); if (m_overlap) { // Check for maximum number of digits allowed - String* called = m_iamMsg->params().getParam("CalledPartyNumber"); + String* called = m_iamMsg->params().getParam(YSTRING("CalledPartyNumber")); if (called && called->length() > isup()->m_maxCalledDigits) { m_samDigits = called->substr(isup()->m_maxCalledDigits); *called = called->substr(0,isup()->m_maxCalledDigits); @@ -2398,7 +2398,7 @@ bool SS7ISUPCall::sendEvent(SignallingEvent* event) if (event->message()) { copyUpper(m->params(),event->message()->params()); m_inbandAvailable = m_inbandAvailable || - event->message()->params().getBoolValue("earlymedia"); + event->message()->params().getBoolValue(YSTRING("earlymedia")); } if (m_inbandAvailable) SignallingUtils::appendFlag(m->params(),"OptionalBackwardCallIndicators","inband"); @@ -2413,7 +2413,7 @@ bool SS7ISUPCall::sendEvent(SignallingEvent* event) if (event->message()) { copyUpper(m->params(),event->message()->params()); m_inbandAvailable = m_inbandAvailable || - event->message()->params().getBoolValue("earlymedia"); + event->message()->params().getBoolValue(YSTRING("earlymedia")); } if (m_inbandAvailable) SignallingUtils::appendFlag(m->params(),"OptionalBackwardCallIndicators","inband"); @@ -2440,7 +2440,7 @@ bool SS7ISUPCall::sendEvent(SignallingEvent* event) break; case SignallingEvent::Generic: if (event->message()) { - const String& oper = event->message()->params()["operation"]; + const String& oper = event->message()->params()[YSTRING("operation")]; if (oper != "transport") break; if (!validMsgState(true,SS7MsgISUP::APM)) @@ -2474,7 +2474,7 @@ bool SS7ISUPCall::sendEvent(SignallingEvent* event) case SignallingEvent::Info: if (validMsgState(true,SS7MsgISUP::SAM)) { mylock.drop(); - transmitSAM(event->message()->params().getValue("tone")); + transmitSAM(event->message()->params().getValue(YSTRING("tone"))); result = true; break; } @@ -2498,9 +2498,9 @@ bool SS7ISUPCall::sendEvent(SignallingEvent* event) // Get reserved circuit or this object void* SS7ISUPCall::getObject(const String& name) const { - if (name == "SignallingCircuit") + if (name == YSTRING("SignallingCircuit")) return m_circuit; - if (name == "SS7ISUPCall") + if (name == YSTRING("SS7ISUPCall")) return (void*)this; return SignallingCall::getObject(name); } @@ -2601,23 +2601,23 @@ bool SS7ISUPCall::copyParamIAM(SS7MsgISUP* msg, bool outgoing, SignallingMessage param(dest,src,"CallingPartyNumber.restrict","callerpres",isup()->m_numPresentation); param(dest,src,"CallingPartyNumber.screened","callerscreening",isup()->m_numScreening); param(dest,src,"CallingPartyNumber.complete","complete","true"); - m_format = src.getValue("format",isup()->format()); + m_format = src.getValue(YSTRING("format"),isup()->format()); dest.addParam("UserServiceInformation",m_format); return true; } // Incoming call - m_format = dest.getValue("UserServiceInformation",isup()->format()); + m_format = dest.getValue(YSTRING("UserServiceInformation"),isup()->format()); dest.setParam("format",m_format); - dest.setParam("caller",dest.getValue("CallingPartyNumber")); + dest.setParam("caller",dest.getValue(YSTRING("CallingPartyNumber"))); //dest.setParam("callername",dest.getValue("")); - dest.setParam("callernumtype",dest.getValue("CallingPartyNumber.nature")); - dest.setParam("callernumplan",dest.getValue("CallingPartyNumber.plan")); - dest.setParam("callerpres",dest.getValue("CallingPartyNumber.restrict")); - dest.setParam("callerscreening",dest.getValue("CallingPartyNumber.screened")); - dest.setParam("called",dest.getValue("CalledPartyNumber")); - dest.setParam("callednumtype",dest.getValue("CalledPartyNumber.nature")); - dest.setParam("callednumplan",dest.getValue("CalledPartyNumber.plan")); - dest.setParam("inn",dest.getValue("CalledPartyNumber.inn")); + dest.setParam("callernumtype",dest.getValue(YSTRING("CallingPartyNumber.nature"))); + dest.setParam("callernumplan",dest.getValue(YSTRING("CallingPartyNumber.plan"))); + dest.setParam("callerpres",dest.getValue(YSTRING("CallingPartyNumber.restrict"))); + dest.setParam("callerscreening",dest.getValue(YSTRING("CallingPartyNumber.screened"))); + dest.setParam("called",dest.getValue(YSTRING("CalledPartyNumber"))); + dest.setParam("callednumtype",dest.getValue(YSTRING("CalledPartyNumber.nature"))); + dest.setParam("callednumplan",dest.getValue(YSTRING("CalledPartyNumber.plan"))); + dest.setParam("inn",dest.getValue(YSTRING("CalledPartyNumber.inn"))); if (m_label.sls() != 0xff) dest.setParam("sls",String((unsigned int)m_label.sls())); return true; @@ -2670,9 +2670,9 @@ void SS7ISUPCall::setReason(const char* reason, SignallingMessage* msg, m_location = location; } else if (msg) { - m_reason = msg->params().getValue("CauseIndicators",msg->params().getValue("reason")); - m_diagnostic = msg->params().getValue("CauseIndicators.diagnostic",diagnostic); - m_location = msg->params().getValue("CauseIndicators.location",location); + m_reason = msg->params().getValue(YSTRING("CauseIndicators"),msg->params().getValue(YSTRING("reason"))); + m_diagnostic = msg->params().getValue(YSTRING("CauseIndicators.diagnostic"),diagnostic); + m_location = msg->params().getValue(YSTRING("CauseIndicators.location"),location); } } @@ -2865,7 +2865,7 @@ bool SS7ISUPCall::needsTesting(const SS7MsgISUP* msg) { if ((m_state >= Testing) || !msg) return false; - const String* naci = msg->params().getParam("NatureOfConnectionIndicators"); + const String* naci = msg->params().getParam(YSTRING("NatureOfConnectionIndicators")); if (!naci) return false; ObjList* list = naci->split(',',false); @@ -2887,12 +2887,12 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout) #define COPY_PARAM(param) \ m_sgmMsg->params().copyParam(sgm->params(),param); \ m_sgmMsg->params().copyParam(sgm->params(),param,'.'); - COPY_PARAM("AccessTranport") - COPY_PARAM("UserToUserInformation") - COPY_PARAM("MessageCompatInformation") - COPY_PARAM("GenericDigits") - COPY_PARAM("GenericNotification") - COPY_PARAM("GenericNumber") + COPY_PARAM(YSTRING("AccessTranport")) + COPY_PARAM(YSTRING("UserToUserInformation")) + COPY_PARAM(YSTRING("MessageCompatInformation")) + COPY_PARAM(YSTRING("GenericDigits")) + COPY_PARAM(YSTRING("GenericNotification")) + COPY_PARAM(YSTRING("GenericNumber")) #undef COPY_PARAM } else @@ -2907,8 +2907,8 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout) switch (m_sgmMsg->type()) { case SS7MsgISUP::COT: { - const String* cont = m_sgmMsg->params().getParam("ContinuityIndicators"); - bool ok = cont && (*cont == "success"); + const String* cont = m_sgmMsg->params().getParam(YSTRING("ContinuityIndicators")); + bool ok = cont && (*cont == YSTRING("success")); if (ok) { Debug(isup(),DebugNote,"Call(%u). Continuity check succeeded [%p]", id(),this); @@ -3141,7 +3141,7 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) ¶ms,this,tmp.c_str()); } #endif - const char* stype = params.getValue("pointcodetype"); + const char* stype = params.getValue(YSTRING("pointcodetype")); m_type = SS7PointCode::lookup(stype); if (m_type == SS7PointCode::Other) { Debug(this,DebugWarn,"Invalid point code type '%s'",c_safe(stype)); @@ -3150,7 +3150,7 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) if (m_type == SS7PointCode::ITU) m_defaultSls = SlsCircuit; - m_format = params.getValue("format"); + m_format = params.getValue(YSTRING("format")); if (-1 == lookup(m_format,SignallingUtils::dict(1,0),-1)) switch (m_type) { case SS7PointCode::ANSI: @@ -3163,29 +3163,29 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) m_format = "alaw"; } - const char* rpc = params.getValue("remotepointcode"); + const char* rpc = params.getValue(YSTRING("remotepointcode")); m_remotePoint = new SS7PointCode(0,0,0); if (!(m_remotePoint->assign(rpc,m_type) && m_remotePoint->pack(m_type))) { Debug(this,DebugMild,"Invalid remotepointcode='%s'",rpc); TelEngine::destruct(m_remotePoint); } - m_lockGroup = params.getBoolValue("lockgroup",m_lockGroup); - m_earlyAcm = params.getBoolValue("earlyacm",m_earlyAcm); - m_inn = params.getBoolValue("inn",m_inn); - m_numPlan = params.getValue("numplan"); + m_lockGroup = params.getBoolValue(YSTRING("lockgroup"),m_lockGroup); + m_earlyAcm = params.getBoolValue(YSTRING("earlyacm"),m_earlyAcm); + m_inn = params.getBoolValue(YSTRING("inn"),m_inn); + m_numPlan = params.getValue(YSTRING("numplan")); if (-1 == lookup(m_numPlan,s_dict_numPlan,-1)) m_numPlan = "unknown"; - m_numType = params.getValue("numtype"); + m_numType = params.getValue(YSTRING("numtype")); if (-1 == lookup(m_numType,s_dict_nai,-1)) m_numType = "unknown"; - m_numPresentation = params.getValue("presentation"); + m_numPresentation = params.getValue(YSTRING("presentation")); if (-1 == lookup(m_numPresentation,s_dict_presentation,-1)) m_numPresentation = "allowed"; - m_numScreening = params.getValue("screening"); + m_numScreening = params.getValue(YSTRING("screening")); if (-1 == lookup(m_numScreening,s_dict_screening,-1)) m_numScreening = "user-provided"; - m_callerCat = params.getValue("callercategory"); + m_callerCat = params.getValue(YSTRING("callercategory")); if (-1 == lookup(m_callerCat,s_dict_callerCat,-1)) m_callerCat = "ordinary"; @@ -3202,15 +3202,15 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) // Timers m_t9Interval = SignallingTimer::getInterval(params,"t9",ISUP_T9_MINVAL,0,ISUP_T9_MAXVAL,true); - m_continuity = params.getValue("continuity"); - m_confirmCCR = params.getBoolValue("confirm_ccr",true); - m_dropOnUnknown = params.getBoolValue("drop_unknown",true); - m_ignoreGRSSingle = params.getBoolValue("ignore-grs-single"); - m_ignoreCGBSingle = params.getBoolValue("ignore-cgb-single"); - m_ignoreCGUSingle = params.getBoolValue("ignore-cgu-single"); - m_duplicateCGB = params.getBoolValue("duplicate-cgb", + m_continuity = params.getValue(YSTRING("continuity")); + m_confirmCCR = params.getBoolValue(YSTRING("confirm_ccr"),true); + m_dropOnUnknown = params.getBoolValue(YSTRING("drop_unknown"),true); + m_ignoreGRSSingle = params.getBoolValue(YSTRING("ignore-grs-single")); + m_ignoreCGBSingle = params.getBoolValue(YSTRING("ignore-cgb-single")); + m_ignoreCGUSingle = params.getBoolValue(YSTRING("ignore-cgu-single")); + m_duplicateCGB = params.getBoolValue(YSTRING("duplicate-cgb"), (SS7PointCode::ANSI == m_type || SS7PointCode::ANSI8 == m_type)); - int testMsg = params.getIntValue("parttestmsg",s_names,SS7MsgISUP::UPT); + int testMsg = params.getIntValue(YSTRING("parttestmsg"),s_names,SS7MsgISUP::UPT); switch (testMsg) { case SS7MsgISUP::CVT: if (SS7PointCode::ANSI != m_type && SS7PointCode::ANSI8 != m_type) @@ -3221,14 +3221,14 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) case SS7MsgISUP::UPT: m_uptMessage = (SS7MsgISUP::Type)testMsg; } - m_ignoreUnkDigits = params.getBoolValue("ignore-unknown-digits",true); - m_defaultSls = params.getIntValue("sls",s_dict_callSls,m_defaultSls); - m_maxCalledDigits = params.getIntValue("maxcalleddigits",m_maxCalledDigits); + m_ignoreUnkDigits = params.getBoolValue(YSTRING("ignore-unknown-digits"),true); + m_defaultSls = params.getIntValue(YSTRING("sls"),s_dict_callSls,m_defaultSls); + m_maxCalledDigits = params.getIntValue(YSTRING("maxcalleddigits"),m_maxCalledDigits); if (m_maxCalledDigits < 1) m_maxCalledDigits = 16; - setDebug(params.getBoolValue("print-messages",false), - params.getBoolValue("extended-debug",false)); + setDebug(params.getBoolValue(YSTRING("print-messages"),false), + params.getBoolValue(YSTRING("extended-debug"),false)); if (debugAt(DebugInfo)) { String s; @@ -3243,7 +3243,7 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) else s << "missing"; s << " SIF/SSF=" << (unsigned int)sif() << "/" << (unsigned int)ssf(); - s << " lockcircuits=" << params.getValue("lockcircuits"); + s << " lockcircuits=" << params.getValue(YSTRING("lockcircuits")); s << " userpartavail=" << String::boolText(m_userPartAvail); s << " lockgroup=" << String::boolText(m_lockGroup); s << " mediareq=" << lookup(m_mediaRequired,s_mediaRequired); @@ -3276,21 +3276,21 @@ bool SS7ISUP::initialize(const NamedList* config) Debug(this,DebugInfo,"SS7ISUP::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_isup", - config->getIntValue("debuglevel",-1))); - setDebug(config->getBoolValue("print-messages",false), - config->getBoolValue("extended-debug",false)); - m_lockGroup = config->getBoolValue("lockgroup",m_lockGroup); - m_earlyAcm = config->getBoolValue("earlyacm",m_earlyAcm); - m_continuity = config->getValue("continuity",m_continuity); - m_confirmCCR = config->getBoolValue("confirm_ccr",true); - m_dropOnUnknown = config->getBoolValue("drop_unknown",true); - m_ignoreGRSSingle = config->getBoolValue("ignore-grs-single"); - m_ignoreCGBSingle = config->getBoolValue("ignore-cgb-single"); - m_ignoreCGUSingle = config->getBoolValue("ignore-cgu-single"); - m_duplicateCGB = config->getBoolValue("duplicate-cgb", + debugLevel(config->getIntValue(YSTRING("debuglevel_isup"), + config->getIntValue(YSTRING("debuglevel"),-1))); + setDebug(config->getBoolValue(YSTRING("print-messages"),false), + config->getBoolValue(YSTRING("extended-debug"),false)); + m_lockGroup = config->getBoolValue(YSTRING("lockgroup"),m_lockGroup); + m_earlyAcm = config->getBoolValue(YSTRING("earlyacm"),m_earlyAcm); + m_continuity = config->getValue(YSTRING("continuity"),m_continuity); + m_confirmCCR = config->getBoolValue(YSTRING("confirm_ccr"),true); + m_dropOnUnknown = config->getBoolValue(YSTRING("drop_unknown"),true); + m_ignoreGRSSingle = config->getBoolValue(YSTRING("ignore-grs-single")); + m_ignoreCGBSingle = config->getBoolValue(YSTRING("ignore-cgb-single")); + m_ignoreCGUSingle = config->getBoolValue(YSTRING("ignore-cgu-single")); + m_duplicateCGB = config->getBoolValue(YSTRING("duplicate-cgb"), (SS7PointCode::ANSI == m_type || SS7PointCode::ANSI8 == m_type)); - int testMsg = config->getIntValue("parttestmsg",s_names,SS7MsgISUP::UPT); + int testMsg = config->getIntValue(YSTRING("parttestmsg"),s_names,SS7MsgISUP::UPT); switch (testMsg) { case SS7MsgISUP::CVT: if (SS7PointCode::ANSI != m_type && SS7PointCode::ANSI8 != m_type) @@ -3301,9 +3301,9 @@ bool SS7ISUP::initialize(const NamedList* config) case SS7MsgISUP::UPT: m_uptMessage = (SS7MsgISUP::Type)testMsg; } - m_ignoreUnkDigits = config->getBoolValue("ignore-unknown-digits",true); - m_defaultSls = config->getIntValue("sls",s_dict_callSls,m_defaultSls); - m_mediaRequired = (MediaRequired)config->getIntValue("needmedia", + m_ignoreUnkDigits = config->getBoolValue(YSTRING("ignore-unknown-digits"),true); + m_defaultSls = config->getIntValue(YSTRING("sls"),s_dict_callSls,m_defaultSls); + m_mediaRequired = (MediaRequired)config->getIntValue(YSTRING("needmedia"), s_mediaRequired,m_mediaRequired); // Timers m_t9Interval = SignallingTimer::getInterval(*config,"t9",ISUP_T9_MINVAL,0,ISUP_T9_MAXVAL,true); @@ -3373,9 +3373,9 @@ unsigned int SS7ISUP::setPointCode(const NamedList& params) if (!ns) continue; bool defPc = false; - if (ns->name() == "defaultpointcode") + if (ns->name() == YSTRING("defaultpointcode")) defPc = true; - else if (ns->name() != "pointcode") + else if (ns->name() != YSTRING("pointcode")) continue; SS7PointCode* pc = new SS7PointCode(0,0,0); if (pc->assign(*ns,m_type) && setPointCode(pc,defPc && !hadDef)) { @@ -3436,7 +3436,7 @@ SignallingCall* SS7ISUP::call(SignallingMessage* msg, String& reason) } SS7PointCode dest; SignallingCircuit* cic = 0; - const char* range = msg->params().getValue("circuits"); + const char* range = msg->params().getValue(YSTRING("circuits")); reason.clear(); Lock mylock(this); // Check @@ -3446,7 +3446,7 @@ SignallingCall* SS7ISUP::call(SignallingMessage* msg, String& reason) reason = "noconn"; break; } - String pc = msg->params().getValue("calledpointcode"); + String pc = msg->params().getValue(YSTRING("calledpointcode")); if (!(dest.assign(pc,m_type) && dest.pack(m_type))) { if (!m_remotePoint) { Debug(this,DebugNote, @@ -3474,13 +3474,13 @@ SignallingCall* SS7ISUP::call(SignallingMessage* msg, String& reason) } SS7ISUPCall* call = 0; if (reason.null()) { - String* cicParams = msg->params().getParam("circuit_parameters"); + String* cicParams = msg->params().getParam(YSTRING("circuit_parameters")); if (cicParams) { NamedList* p = YOBJECT(NamedList,cicParams); if (p) cic->setParams(*p); } - int sls = msg->params().getIntValue("sls",s_dict_callSls,m_defaultSls); + int sls = msg->params().getIntValue(YSTRING("sls"),s_dict_callSls,m_defaultSls); switch (sls) { case SlsCircuit: if (cic) { @@ -3674,8 +3674,8 @@ void SS7ISUP::timerTick(const Time& when) continue; } } - bool alert = msg->params().getBoolValue("isup_alert_maint"); - const char* reason = msg->params().getValue("isup_pending_reason",""); + bool alert = msg->params().getBoolValue(YSTRING("isup_alert_maint")); + const char* reason = msg->params().getValue(YSTRING("isup_pending_reason"),""); Debug(this,!alert ? DebugAll : DebugMild, "Pending operation '%s' cic=%u reason='%s' timed out", msg->name(),msg->cic(),reason); @@ -3742,15 +3742,15 @@ void SS7ISUP::timerTick(const Time& when) // Process a component control request bool SS7ISUP::control(NamedList& params) { - String* ret = params.getParam("completion"); - const String* oper = params.getParam("operation"); - const char* cmp = params.getValue("component"); + String* ret = params.getParam(YSTRING("completion")); + const String* oper = params.getParam(YSTRING("operation")); + const char* cmp = params.getValue(YSTRING("component")); int cmd = oper ? oper->toInteger(s_dict_control,-1) : -1; if (ret) { if (oper && (cmd < 0)) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); if (cmp) { if (toString() != cmp) return false; @@ -3773,7 +3773,7 @@ bool SS7ISUP::control(NamedList& params) case SS7MsgISUP::UPT: case SS7MsgISUP::CVT: { - unsigned int code = params.getIntValue("circuit",code1); + unsigned int code = params.getIntValue(YSTRING("circuit"),code1); SS7MsgISUP* msg = new SS7MsgISUP((SS7MsgISUP::Type)cmd,code); SS7Label label(m_type,*m_remotePoint,*m_defPoint,m_sls); mylock.drop(); @@ -3782,8 +3782,8 @@ bool SS7ISUP::control(NamedList& params) return true; case SS7MsgISUP::CQM: { - unsigned int code = params.getIntValue("circuit",code1); - unsigned int range = params.getIntValue("range",1); + unsigned int code = params.getIntValue(YSTRING("circuit"),code1); + unsigned int range = params.getIntValue(YSTRING("range"),1); SS7MsgISUP* msg = new SS7MsgISUP(SS7MsgISUP::CQM,code); msg->params().addParam("RangeAndStatus",String(range)); SS7Label label(m_type,*m_remotePoint,*m_defPoint,m_sls); @@ -3793,7 +3793,7 @@ bool SS7ISUP::control(NamedList& params) return true; case SS7MsgISUP::CCR: { - unsigned int code = params.getIntValue("circuit",code1); + unsigned int code = params.getIntValue(YSTRING("circuit"),code1); // TODO: create a test call, not just send CCR SS7MsgISUP* msg = new SS7MsgISUP(SS7MsgISUP::CCR,code); SS7Label label(m_type,*m_remotePoint,*m_defPoint,m_sls); @@ -3816,7 +3816,7 @@ bool SS7ISUP::control(NamedList& params) return handleCicBlockCommand(params,cmd == SS7MsgISUP::BLK); case SS7MsgISUP::RLC: { - int code = params.getIntValue("circuit"); + int code = params.getIntValue(YSTRING("circuit")); SignallingMessageTimer* pending = 0; if (code > 0) pending = findPendingMessage(SS7MsgISUP::RSC,code,true); @@ -3942,7 +3942,7 @@ SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio, #endif ObjList exclude; plist = msgParams->params; - String prefix = params->getValue("message-prefix"); + String prefix = params->getValue(YSTRING("message-prefix")); // first populate with mandatory fixed parameters while ((ptype = *plist++) != SS7MsgISUP::EndOfParameters) { const IsupParam* param = getParamDesc(ptype); @@ -4066,7 +4066,7 @@ bool SS7ISUP::decodeMessage(NamedList& msg, } // Get parameter prefix - String prefix = msg.getValue("message-prefix"); + String prefix = msg.getValue(YSTRING("message-prefix")); // Add protocol and message type switch (pcType) { @@ -4213,13 +4213,13 @@ bool SS7ISUP::decodeMessage(NamedList& msg, ObjList* l = ns->split(',',false); for (ObjList* ol = l->skipNull(); ol; ol = ol->skipNext()) { String* s = static_cast(ol->get()); - if (*s == "release") { + if (*s == YSTRING("release")) { release.append(ns->name().substr(pCompat.length()),","); break; } - if (*s == "cnf") + if (*s == YSTRING("cnf")) cnf.append(ns->name().substr(pCompat.length()),","); - if (*s == "nopass-release") + if (*s == YSTRING("nopass-release")) npRelease.append(ns->name().substr(pCompat.length()),","); } TelEngine::destruct(l); @@ -4259,7 +4259,7 @@ bool SS7ISUP::processParamCompat(const NamedList& list, unsigned int cic, bool* { if (!cic) return true; - const String& prefix = list["message-prefix"]; + const String& prefix = list[YSTRING("message-prefix")]; // Release call params String relCall = list[prefix + "parameters-unhandled-release"]; relCall.append(list[prefix + "parameters-nopass-release"],","); @@ -4466,10 +4466,10 @@ SignallingEvent* SS7ISUP::processCircuitEvent(SignallingCircuitEvent*& event, } break; case SignallingCircuitEvent::Dtmf: - if (event->getValue("tone")) { + if (event->getValue(YSTRING("tone"))) { SignallingMessage* msg = new SignallingMessage(event->c_str()); - msg->params().addParam("tone",event->getValue("tone")); - msg->params().addParam("inband",event->getValue("inband",String::boolText(true))); + msg->params().addParam("tone",event->getValue(YSTRING("tone"))); + msg->params().addParam("inband",event->getValue(YSTRING("inband"),String::boolText(true))); ev = new SignallingEvent(SignallingEvent::Info,msg,call); TelEngine::destruct(msg); } @@ -4598,7 +4598,7 @@ void SS7ISUP::processCallMsg(SS7MsgISUP* msg, const SS7Label& label, int sls) // Q.764 2.8.2 - accept test calls even if the remote side is blocked // Q.764 2.8.2.3 (xiv) - unblock remote side of the circuit for non-test calls if ((msg->type() == SS7MsgISUP::CCR) || - (String(msg->params().getValue("CallingPartyCategory")) == "test")) { + (msg->params()[YSTRING("CallingPartyCategory")] == YSTRING("test"))) { Debug(this,DebugInfo,"Received test call on circuit %u",msg->cic()); flags = 0; } @@ -4641,12 +4641,12 @@ void SS7ISUP::processCallMsg(SS7MsgISUP* msg, const SS7Label& label, int sls) unsigned int getRangeAndStatus(NamedList& nl, unsigned int minRange, unsigned int maxRange, unsigned int maxMap = 0, String** map = 0, unsigned int nCicsMax = 0) { - unsigned int range = nl.getIntValue("RangeAndStatus"); + unsigned int range = nl.getIntValue(YSTRING("RangeAndStatus")); if (range < minRange || range > maxRange) return 0; if (!maxMap) return range; - NamedString* ns = nl.getParam("RangeAndStatus.map"); + NamedString* ns = nl.getParam(YSTRING("RangeAndStatus.map")); if (!ns || ns->length() > maxMap || ns->length() < range) return 0; if (map) { @@ -4671,9 +4671,9 @@ static bool getGrpTypeInd(SS7ISUP* isup, SS7MsgISUP* msg, bool& hwFail) { if (!msg) return false; - const String& s = msg->params()["GroupSupervisionTypeIndicator"]; - hwFail = (s == "hw-failure"); - if (hwFail || (s == "maintenance")) + const String& s = msg->params()[YSTRING("GroupSupervisionTypeIndicator")]; + hwFail = (s == YSTRING("hw-failure")); + if (hwFail || (s == YSTRING("maintenance"))) return true; Debug(isup,DebugNote,"%s with unknown GroupSupervisionTypeIndicator=%s [%p]", msg->name(),s.c_str(),isup); @@ -4703,8 +4703,8 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s // TODO: check if this message was received in response to RSC, UBL, UBK, CGB, CGU Debug(this,DebugNote,"%s with cic=%u cause='%s' diagnostic='%s'", msg->name(),msg->cic(), - msg->params().getValue("CauseIndicators"), - msg->params().getValue("CauseIndicators.diagnostic")); + msg->params().getValue(YSTRING("CauseIndicators")), + msg->params().getValue(YSTRING("CauseIndicators.diagnostic"))); stopSGM = true; break; case SS7MsgISUP::RLC: // Release Complete @@ -4736,7 +4736,7 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s unsigned int n = getRangeAndStatus(msg->params(),1,31); if (!n) { Debug(this,DebugNote,"%s with invalid range %s",msg->name(), - msg->params().getValue("RangeAndStatus")); + msg->params().getValue(YSTRING("RangeAndStatus"))); break; } else if (n == 1 && m_ignoreGRSSingle) { @@ -4777,7 +4777,7 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s SignallingMessageTimer* t = findPendingMessage(type,msg->cic(),true); if (t) { SS7MsgISUP* m = static_cast(t->message()); - bool hw = m && m->params().getBoolValue("isup_pending_block_hwfail"); + bool hw = m && m->params().getBoolValue(YSTRING("isup_pending_block_hwfail")); DDebug(this,m ? DebugAll : DebugNote,"%s confirmed for pending cic=%u", block ? "BLK" : "UBL",msg->cic()); TelEngine::destruct(t); @@ -4800,8 +4800,8 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s unsigned int nCics = getRangeAndStatus(msg->params(),1,256,256,&srcMap,32); if (!nCics) { Debug(this,DebugNote,"%s with invalid range %s or map=%s",msg->name(), - msg->params().getValue("RangeAndStatus"), - msg->params().getValue("RangeAndStatus.map")); + msg->params().getValue(YSTRING("RangeAndStatus")), + msg->params().getValue(YSTRING("RangeAndStatus.map"))); break; } bool block = (msg->type() == SS7MsgISUP::CGA); @@ -4813,11 +4813,11 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s String map; while (m) { // Check type indicator - bool hw = (m->params()["GroupSupervisionTypeIndicator"] == "hw-failure"); + bool hw = (m->params()[YSTRING("GroupSupervisionTypeIndicator")] == YSTRING("hw-failure")); if (hw != hwFail) break; // Check map - map = m->params()["RangeAndStatus.map"]; + map = m->params()[YSTRING("RangeAndStatus.map")]; if (!map) break; if (map.length() != nCics) { @@ -4838,8 +4838,8 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s unlock(); if (!map) { Debug(this,DebugNote,"%s with unnacceptable range %s or map=%s",msg->name(), - msg->params().getValue("RangeAndStatus"), - msg->params().getValue("RangeAndStatus.map")); + msg->params().getValue(YSTRING("RangeAndStatus")), + msg->params().getValue(YSTRING("RangeAndStatus.map"))); break; } for (unsigned int i = 0; i < map.length(); i++) @@ -4861,8 +4861,8 @@ void SS7ISUP::processControllerMsg(SS7MsgISUP* msg, const SS7Label& label, int s unsigned int nCics = getRangeAndStatus(msg->params(),1,256,256,&srcMap,32); if (!nCics) { Debug(this,DebugNote,"%s with invalid range %s or map=%s",msg->name(), - msg->params().getValue("RangeAndStatus"), - msg->params().getValue("RangeAndStatus.map")); + msg->params().getValue(YSTRING("RangeAndStatus")), + msg->params().getValue(YSTRING("RangeAndStatus.map"))); break; } else if (nCics == 1 && ((block && m_ignoreCGBSingle) || (!block && m_ignoreCGUSingle))) { @@ -5336,8 +5336,8 @@ bool SS7ISUP::handleCicBlockCommand(const NamedList& p, bool block) return false; SS7MsgISUP* msg = 0; SS7MsgISUP::Type remove = SS7MsgISUP::Unknown; - bool force = p.getBoolValue("force"); - String* param = p.getParam("circuit"); + bool force = p.getBoolValue(YSTRING("force")); + String* param = p.getParam(YSTRING("circuit")); Lock mylock(this); if (param) { SignallingCircuit* cic = circuits()->find(param->toInteger()); @@ -5349,10 +5349,10 @@ bool SS7ISUP::handleCicBlockCommand(const NamedList& p, bool block) } else { // NOTE: we assume the circuits belongs to the same span - param = p.getParam("circuits"); + param = p.getParam(YSTRING("circuits")); if (TelEngine::null(param)) { Debug(this,DebugNote,"Circuit '%s' missing circuit(s)", - p.getValue("operation")); + p.getValue(YSTRING("operation"))); return false; } // Parse the range @@ -5362,7 +5362,7 @@ bool SS7ISUP::handleCicBlockCommand(const NamedList& p, bool block) SignallingCircuitRange* range = circuits()->findRange(*param); if (!(range && (count = range->count()))) { Debug(this,DebugNote,"Circuit group '%s': invalid circuits=%s", - p.getValue("operation"),param->c_str()); + p.getValue(YSTRING("operation")),param->c_str()); return false; } cics = new unsigned int[count]; @@ -5371,19 +5371,19 @@ bool SS7ISUP::handleCicBlockCommand(const NamedList& p, bool block) } if (count > 32) { Debug(this,DebugNote,"Circuit group '%s': too many circuits %u (max=32)", - p.getValue("operation"),count); + p.getValue(YSTRING("operation")),count); delete[] cics; return false; } // Check if all circuits can be (un)blocked ObjList list; - bool maint = !p.getBoolValue("hwfail"); + bool maint = !p.getBoolValue(YSTRING("hwfail")); for (unsigned int i = 0; i < count; i++) { SignallingCircuit* c = circuits()->find(cics[i]); const char* reason = checkBlockCic(c,block,maint,force); if (reason) { Debug(this,DebugNote,"Circuit group '%s' range=%s failed for cic=%u: %s", - p.getValue("operation"),param->c_str(),cics[i],reason); + p.getValue(YSTRING("operation")),param->c_str(),cics[i],reason); delete[] cics; return false; } @@ -5413,7 +5413,7 @@ bool SS7ISUP::handleCicBlockCommand(const NamedList& p, bool block) delete[] cics; if (nCics != count) { Debug(this,DebugNote,"Circuit group '%s': invalid circuit map=%s", - p.getValue("operation"),param->c_str()); + p.getValue(YSTRING("operation")),param->c_str()); return false; } // Ok: block circuits and send the request diff --git a/libs/ysig/layer2.cpp b/libs/ysig/layer2.cpp index 6340193f..a60c19d0 100644 --- a/libs/ysig/layer2.cpp +++ b/libs/ysig/layer2.cpp @@ -205,14 +205,14 @@ bool SS7Layer2::control(Operation oper, NamedList* params) bool SS7Layer2::control(NamedList& params) { - String* ret = params.getParam("completion"); - const String* oper = params.getParam("operation"); - const char* cmp = params.getValue("component"); + String* ret = params.getParam(YSTRING("completion")); + const String* oper = params.getParam(YSTRING("operation")); + const char* cmp = params.getValue(YSTRING("component")); int cmd = oper ? oper->toInteger(s_dict_control,-1) : -1; if (ret) { if (oper && (cmd < 0)) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); if (cmp) { if (toString() != cmp) return false; @@ -235,7 +235,7 @@ bool SS7Layer2::getEmergency(NamedList* params, bool emg) const emg = true; } if (params) - emg = params->getBoolValue("emergency",emg); + emg = params->getBoolValue(YSTRING("emergency"),emg); return emg; } @@ -277,13 +277,13 @@ SS7MTP2::SS7MTP2(const NamedList& params, unsigned int status) ¶ms,statusName(true),this,tmp.c_str()); } #endif - m_fillLink = params.getBoolValue("filllink",m_fillLink); - m_maxErrors = params.getIntValue("maxerrors",64); + m_fillLink = params.getBoolValue(YSTRING("filllink"),m_fillLink); + m_maxErrors = params.getIntValue(YSTRING("maxerrors"),64); if (m_maxErrors < 8) m_maxErrors = 8; else if (m_maxErrors > 256) m_maxErrors = 256; - setDumper(params.getValue("layer2dump")); + setDumper(params.getValue(YSTRING("layer2dump"))); } SS7MTP2::~SS7MTP2() @@ -335,10 +335,10 @@ bool SS7MTP2::initialize(const NamedList* config) Debug(this,DebugInfo,"SS7MTP2::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_mtp2", - config->getIntValue("debuglevel",-1))); - m_autoEmergency = config->getBoolValue("autoemergency",true); - unsigned int maxErrors = config->getIntValue("maxerrors",m_maxErrors); + debugLevel(config->getIntValue(YSTRING("debuglevel_mtp2"), + config->getIntValue(YSTRING("debuglevel"),-1))); + m_autoEmergency = config->getBoolValue(YSTRING("autoemergency"),true); + unsigned int maxErrors = config->getIntValue(YSTRING("maxerrors"),m_maxErrors); if (maxErrors < 8) m_maxErrors = 8; else if (maxErrors > 256) @@ -346,12 +346,12 @@ bool SS7MTP2::initialize(const NamedList* config) else m_maxErrors = maxErrors; } - m_autostart = !config || config->getBoolValue("autostart",true); - m_flushMsus = !config || config->getBoolValue("flushmsus",true); + m_autostart = !config || config->getBoolValue(YSTRING("autostart"),true); + m_flushMsus = !config || config->getBoolValue(YSTRING("flushmsus"),true); if (config && !iface()) { - NamedString* name = config->getParam("sig"); + NamedString* name = config->getParam(YSTRING("sig")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { NamedPointer* ptr = YOBJECT(NamedPointer,name); NamedList* ifConfig = ptr ? YOBJECT(NamedList,ptr->userData()) : 0; @@ -360,7 +360,7 @@ bool SS7MTP2::initialize(const NamedList* config) params.addParam("protocol","ss7"); if (ifConfig) { params.copyParams(*ifConfig); - int rx = params.getIntValue("rxunderrun"); + int rx = params.getIntValue(YSTRING("rxunderrun")); if ((rx > 0) && (rx < 25)) params.setParam("rxunderrun","25"); } @@ -383,11 +383,11 @@ bool SS7MTP2::control(Operation oper, NamedList* params) { if (params) { lock(); - m_fillLink = params->getBoolValue("filllink",m_fillLink); - m_autoEmergency = params->getBoolValue("autoemergency",m_autoEmergency); - m_autostart = params->getBoolValue("autostart",m_autostart); - m_flushMsus = params->getBoolValue("flushmsus",m_flushMsus); - unsigned int maxErrors = params->getIntValue("maxerrors",m_maxErrors); + m_fillLink = params->getBoolValue(YSTRING("filllink"),m_fillLink); + m_autoEmergency = params->getBoolValue(YSTRING("autoemergency"),m_autoEmergency); + m_autostart = params->getBoolValue(YSTRING("autostart"),m_autostart); + m_flushMsus = params->getBoolValue(YSTRING("flushmsus"),m_flushMsus); + unsigned int maxErrors = params->getIntValue(YSTRING("maxerrors"),m_maxErrors); if (maxErrors < 8) m_maxErrors = 8; else if (maxErrors > 256) @@ -395,20 +395,20 @@ bool SS7MTP2::control(Operation oper, NamedList* params) else m_maxErrors = maxErrors; // The following are for test purposes - if (params->getBoolValue("toggle-bib")) + if (params->getBoolValue(YSTRING("toggle-bib"))) m_bib = !m_bib; - if (params->getBoolValue("toggle-fib")) + if (params->getBoolValue(YSTRING("toggle-fib"))) m_fib = !m_fib; - int tmp = params->getIntValue("change-fsn"); + int tmp = params->getIntValue(YSTRING("change-fsn")); if (tmp) m_fsn = (m_fsn + tmp) & 0x7f; unlock(); - tmp = params->getIntValue("send-lssu",-1); + tmp = params->getIntValue(YSTRING("send-lssu"),-1); if (tmp >= 0) transmitLSSU(tmp); - if (params->getBoolValue("send-fisu")) + if (params->getBoolValue(YSTRING("send-fisu"))) transmitFISU(); - if (params->getBoolValue("simulate-error")) + if (params->getBoolValue(YSTRING("simulate-error"))) notify(SignallingInterface::HardwareError); } switch (oper) { diff --git a/libs/ysig/layer3.cpp b/libs/ysig/layer3.cpp index fc279707..1b79043c 100644 --- a/libs/ysig/layer3.cpp +++ b/libs/ysig/layer3.cpp @@ -71,11 +71,11 @@ SS7Layer3::SS7Layer3(SS7PointCode::Type type) bool SS7Layer3::initialize(const NamedList* config) { if (config) - setNI(SS7MSU::getNetIndicator(config->getValue("netindicator"),SS7MSU::National)); + setNI(SS7MSU::getNetIndicator(config->getValue(YSTRING("netindicator")),SS7MSU::National)); if (engine() && !user()) { NamedList params("ss7router"); if (config) - static_cast(params) = config->getValue("router",params); + static_cast(params) = config->getValue(YSTRING("router"),params); if (params.toBoolean(true)) SS7Layer3::attach(YOBJECT(SS7Router,engine()->build("SS7Router",params,true))); } @@ -95,7 +95,7 @@ void SS7Layer3::attach(SS7L3User* l3user) const char* name = 0; if (engine() && engine()->find(tmp)) { name = tmp->toString().safe(); - if (tmp->getObject("SS7Router")) + if (tmp->getObject(YSTRING("SS7Router"))) (static_cast(tmp))->detach(this); else tmp->attach(0); @@ -106,7 +106,7 @@ void SS7Layer3::attach(SS7L3User* l3user) return; Debug(this,DebugAll,"Attached L3 user (%p,'%s') [%p]",l3user,l3user->toString().safe(),this); insert(l3user); - if (l3user->getObject("SS7Router")) + if (l3user->getObject(YSTRING("SS7Router"))) (static_cast(l3user))->attach(this); else l3user->attach(this); @@ -182,11 +182,11 @@ bool SS7Layer3::buildRoutes(const NamedList& params) unsigned int prio = 0; unsigned int shift = 0; bool local = false; - if (ns->name() == "local") + if (ns->name() == YSTRING("local")) local = true; - else if (ns->name() == "route") + else if (ns->name() == YSTRING("route")) prio = 100; - else if (ns->name() != "adjacent") + else if (ns->name() != YSTRING("adjacent")) continue; // Get & check the route ObjList* route = ns->split(',',true); @@ -431,7 +431,7 @@ SS7Route* SS7Layer3::findRoute(SS7PointCode::Type type, unsigned int packed) void SS7Layer3::printRoutes() { String s; - bool router = getObject("SS7Router") != 0; + bool router = getObject(YSTRING("SS7Router")) != 0; for (unsigned int i = 0; i < YSS7_PCTYPE_COUNT; i++) { ObjList* o = m_route[i].skipNull(); if (!o) @@ -495,7 +495,7 @@ SS7MTP3::SS7MTP3(const NamedList& params) // Set point code type for each network indicator static const unsigned char ni[4] = { SS7MSU::International, SS7MSU::SpareInternational, SS7MSU::National, SS7MSU::ReservedNational }; - String stype = params.getValue("netind2pctype"); + String stype = params.getValue(YSTRING("netind2pctype")); int level = DebugAll; if (stype.find(',') >= 0) { ObjList* obj = stype.split(',',false); @@ -522,10 +522,10 @@ SS7MTP3::SS7MTP3(const NamedList& params) } Debug(this,level,"Point code types are '%s' [%p]",stype.safe(),this); - m_inhibit = !params.getBoolValue("autostart",true); - m_checklinks = params.getBoolValue("checklinks",m_checklinks); - m_forcealign = params.getBoolValue("forcealign",m_forcealign); - int check = params.getIntValue("checkfails",5000); + m_inhibit = !params.getBoolValue(YSTRING("autostart"),true); + m_checklinks = params.getBoolValue(YSTRING("checklinks"),m_checklinks); + m_forcealign = params.getBoolValue(YSTRING("forcealign"),m_forcealign); + int check = params.getIntValue(YSTRING("checkfails"),5000); if (check > 0) { if (check < 4000) check = 4000; @@ -533,7 +533,7 @@ SS7MTP3::SS7MTP3(const NamedList& params) check = 12000; m_checkT1 = 1000 * check; } - check = params.getIntValue("maintenance",60000); + check = params.getIntValue(YSTRING("maintenance"),60000); if (check > 0) { if (check < 30000) check = 30000; @@ -563,7 +563,7 @@ SS7MTP3::SS7MTP3(const NamedList& params) } TelEngine::destruct(l); } - setDumper(params.getValue("layer3dump")); + setDumper(params.getValue(YSTRING("layer3dump"))); } SS7MTP3::~SS7MTP3() @@ -791,8 +791,8 @@ bool SS7MTP3::control(Operation oper, NamedList* params) { bool ok = operational(); if (params) { - m_checklinks = params->getBoolValue("checklinks",m_checklinks); - m_forcealign = params->getBoolValue("forcealign",m_forcealign); + m_checklinks = params->getBoolValue(YSTRING("checklinks"),m_checklinks); + m_forcealign = params->getBoolValue(YSTRING("forcealign"),m_forcealign); } switch (oper) { case Pause: @@ -816,7 +816,7 @@ bool SS7MTP3::control(Operation oper, NamedList* params) SS7Layer3::notify(-1); } m_warnDown = true; - if (params && params->getBoolValue("emergency")) { + if (params && params->getBoolValue(YSTRING("emergency"))) { unsigned int cnt = 0; const ObjList* l = &m_links; for (; l; l = l->next()) { @@ -838,14 +838,14 @@ bool SS7MTP3::control(Operation oper, NamedList* params) bool SS7MTP3::control(NamedList& params) { - String* ret = params.getParam("completion"); - const String* oper = params.getParam("operation"); - const char* cmp = params.getValue("component"); + String* ret = params.getParam(YSTRING("completion")); + const String* oper = params.getParam(YSTRING("operation")); + const char* cmp = params.getValue(YSTRING("component")); int cmd = oper ? oper->toInteger(s_dict_control,-1) : -1; if (ret) { if (oper && (cmd < 0)) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); if (cmp) { if (toString() != cmp) return false; @@ -872,17 +872,17 @@ bool SS7MTP3::initialize(const NamedList* config) Debug(this,DebugInfo,"SS7MTP3::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) - debugLevel(config->getIntValue("debuglevel_mtp3", - config->getIntValue("debuglevel",-1))); + debugLevel(config->getIntValue(YSTRING("debuglevel_mtp3"), + config->getIntValue(YSTRING("debuglevel"),-1))); countLinks(); m_warnDown = true; if (config && (0 == m_total)) { - m_checklinks = config->getBoolValue("checklinks",m_checklinks); - m_forcealign = config->getBoolValue("forcealign",m_forcealign); + m_checklinks = config->getBoolValue(YSTRING("checklinks"),m_checklinks); + m_forcealign = config->getBoolValue(YSTRING("forcealign"),m_forcealign); unsigned int n = config->length(); for (unsigned int i = 0; i < n; i++) { NamedString* param = config->getParam(i); - if (!(param && param->name() == "link")) + if (!(param && param->name() == YSTRING("link"))) continue; NamedPointer* ptr = YOBJECT(NamedPointer,param); NamedList* linkConfig = ptr ? YOBJECT(NamedList,ptr->userData()) : 0; @@ -913,7 +913,7 @@ bool SS7MTP3::initialize(const NamedList* config) detach(link); TelEngine::destruct(link); } - m_inhibit = !config->getBoolValue("autostart",true); + m_inhibit = !config->getBoolValue(YSTRING("autostart"),true); } SS7Layer3::initialize(config); return 0 != m_total; diff --git a/libs/ysig/layer4.cpp b/libs/ysig/layer4.cpp index d82df0a9..177200e8 100644 --- a/libs/ysig/layer4.cpp +++ b/libs/ysig/layer4.cpp @@ -43,11 +43,11 @@ unsigned char SS7Layer4::getSIO(const NamedList& params, unsigned char sif, unsi prio <<= 4; if ((ni & 0xc0) == 0) ni <<= 6; - sif = params.getIntValue("service",sif & 0x0f); - prio = SS7MSU::getPriority(params.getValue("priority"),prio & 0x30); + sif = params.getIntValue(YSTRING("service"),sif & 0x0f); + prio = SS7MSU::getPriority(params.getValue(YSTRING("priority")),prio & 0x30); if ((prio & 0x30) == 0) prio <<= 4; - ni = SS7MSU::getNetIndicator(params.getValue("netindicator"),ni & 0xc0); + ni = SS7MSU::getNetIndicator(params.getValue(YSTRING("netindicator")),ni & 0xc0); if ((ni & 0xc0) == 0) ni <<= 6; return (sif & 0x0f) | (prio & 0x30) | (ni & 0xc0); @@ -58,14 +58,14 @@ bool SS7Layer4::initialize(const NamedList* config) if (engine() && !network()) { NamedList params("ss7router"); if (config) { - String name = config->getValue("router",params); + String name = config->getValue(YSTRING("router"),params); if (name && !name.toBoolean(false)) static_cast(params) = name; } if (params.toBoolean(true)) attach(YOBJECT(SS7Router,engine()->build("SS7Router",params,true))); else if (config) { - String name = config->getValue("network"); + String name = config->getValue(YSTRING("network")); if (name && name.toBoolean(true)) { static_cast(params) = name; attach(YOBJECT(SS7Layer3,engine()->build("SS7Layer3",params,true))); @@ -87,7 +87,7 @@ void SS7Layer4::attach(SS7Layer3* network) const char* name = 0; if (!engine() || engine()->find(tmp)) { name = tmp->toString().safe(); - if (tmp->getObject("SS7Router")) + if (tmp->getObject(YSTRING("SS7Router"))) (static_cast(tmp))->detach(this); else tmp->attach(0); diff --git a/libs/ysig/management.cpp b/libs/ysig/management.cpp index 7de1e31d..2ea6c592 100644 --- a/libs/ysig/management.cpp +++ b/libs/ysig/management.cpp @@ -312,9 +312,9 @@ SS7Management::SS7Management(const NamedList& params, unsigned char sio) SS7Layer4(sio,¶ms), m_changeMsgs(true), m_changeSets(false), m_neighbours(true) { - m_changeMsgs = params.getBoolValue("changemsgs",m_changeMsgs); - m_changeSets = params.getBoolValue("changesets",m_changeSets); - m_neighbours = params.getBoolValue("neighbours",m_neighbours); + m_changeMsgs = params.getBoolValue(YSTRING("changemsgs"),m_changeMsgs); + m_changeSets = params.getBoolValue(YSTRING("changesets"),m_changeSets); + m_neighbours = params.getBoolValue(YSTRING("neighbours"),m_neighbours); } @@ -387,7 +387,7 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, case SS7MsgSNM::MIM: { // for ANSI the SLC is not stored in SLS but in a separate field - int slc = msg->params().getIntValue("slc",-1); + int slc = msg->params().getIntValue(YSTRING("slc"),-1); if (slc >= 0 && slc <= 255) lbl.setSls((unsigned char)slc); } @@ -405,7 +405,7 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, msg->type() == SS7MsgSNM::TFC || msg->type() == SS7MsgSNM::RST || msg->type() == SS7MsgSNM::RSR) { - String dest = msg->params().getValue("destination"); + String dest = msg->params().getValue(YSTRING("destination")); if (!dest.null()) { const char* oper = lookup(msg->type(),s_dict_control); Debug(this,DebugInfo,"%s (label=%s): Traffic %s to dest=%s [%p]", @@ -451,9 +451,9 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, return true; if (inhibit(lbl,SS7Layer2::Inactive)) { String link; - link << msg->params().getValue("pointcodetype") << "," << lbl; + link << msg->params().getValue(YSTRING("pointcodetype")) << "," << lbl; Debug(this,DebugNote,"Changeover order on %s",link.c_str()); - int seq = msg->params().getIntValue("sequence",-1); + int seq = msg->params().getIntValue(YSTRING("sequence"),-1); if (seq >= 0) recover(lbl,seq); seq = router ? router->getSequence(lbl) : -1; @@ -477,7 +477,7 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, } break; case SS7PointCode::ANSI: - data[1] = (unsigned char)((msg->params().getIntValue("slc",sls) & 0x0f) | (seq << 4)); + data[1] = (unsigned char)((msg->params().getIntValue(YSTRING("slc"),sls) & 0x0f) | (seq << 4)); data[2] = (unsigned char)(seq >> 4); len++; if (len >= 5) { @@ -529,10 +529,10 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, unlock(); if (pend) { String link; - link << msg->params().getValue("pointcodetype") << "," << *pend; + link << msg->params().getValue(YSTRING("pointcodetype")) << "," << *pend; Debug(this,DebugNote,"Changeover acknowledged on %s",link.c_str()); inhibit(*pend,SS7Layer2::Inactive); - int seq = msg->params().getIntValue("sequence",-1); + int seq = msg->params().getIntValue(YSTRING("sequence"),-1); if (seq >= 0) recover(*pend,seq); } @@ -551,7 +551,7 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, return true; if (inhibit(lbl,0,SS7Layer2::Inactive)) { String link; - link << msg->params().getValue("pointcodetype") << "," << lbl; + link << msg->params().getValue(YSTRING("pointcodetype")) << "," << lbl; Debug(this,DebugNote,"Changeback declaration on %s",link.c_str()); SS7MSU answer(msu.getSIO(),lbl,0,len+1); unsigned char* d = answer.getData(lbl.length()+1,len+1); @@ -588,7 +588,7 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, unlock(); if (pend) { String link; - link << msg->params().getValue("pointcodetype") << "," << *pend; + link << msg->params().getValue(YSTRING("pointcodetype")) << "," << *pend; Debug(this,DebugNote,"Changeback acknowledged on %s",link.c_str()); inhibit(*pend,0,SS7Layer2::Inactive); } @@ -714,15 +714,15 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, } else if (msg->type() == SS7MsgSNM::UPU) { Debug(this,DebugNote,"Unavailable part %s at %s, cause %s", - msg->params().getValue("part","?"), - msg->params().getValue("destination","?"), - msg->params().getValue("cause","?")); + msg->params().getValue(YSTRING("part"),"?"), + msg->params().getValue(YSTRING("destination"),"?"), + msg->params().getValue(YSTRING("cause"),"?")); if (router) { - unsigned char part = msg->params().getIntValue("part",-1); - unsigned char cause = msg->params().getIntValue("cause",-1); + unsigned char part = msg->params().getIntValue(YSTRING("part"),-1); + unsigned char cause = msg->params().getIntValue(YSTRING("cause"),-1); SS7PointCode pc; if (part > SS7MSU::MTNS && part <= 0x0f && cause <= 0x0f && - pc.assign(msg->params().getValue("destination"),label.type())) + pc.assign(msg->params().getValue(YSTRING("destination")),label.type())) router->receivedUPU(label.type(),pc,(SS7MSU::Services)part, cause,label,sls); } @@ -750,9 +750,9 @@ HandledMSU SS7Management::receivedMSU(const SS7MSU& msu, const SS7Label& label, bool SS7Management::control(NamedList& params) { - String* ret = params.getParam("completion"); - const String* oper = params.getParam("operation"); - const char* cmp = params.getValue("component"); + String* ret = params.getParam(YSTRING("completion")); + const String* oper = params.getParam(YSTRING("operation")); + const char* cmp = params.getValue(YSTRING("component")); int cmd = -1; if (!TelEngine::null(oper)) { cmd = oper->toInteger(s_dict_control,cmd); @@ -763,7 +763,7 @@ bool SS7Management::control(NamedList& params) if (ret) { if (oper && (cmd < 0)) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); if (cmp) { if (toString() != cmp) return false; @@ -777,10 +777,10 @@ bool SS7Management::control(NamedList& params) if (!(cmp && toString() == cmp)) return false; - m_changeMsgs = params.getBoolValue("changemsgs",m_changeMsgs); - m_changeSets = params.getBoolValue("changesets",m_changeSets); - m_neighbours = params.getBoolValue("neighbours",m_neighbours); - const String* addr = params.getParam("address"); + m_changeMsgs = params.getBoolValue(YSTRING("changemsgs"),m_changeMsgs); + m_changeSets = params.getBoolValue(YSTRING("changesets"),m_changeSets); + m_neighbours = params.getBoolValue(YSTRING("neighbours"),m_neighbours); + const String* addr = params.getParam(YSTRING("address")); if (cmd < 0 || TelEngine::null(addr)) return SignallingComponent::control(params); // TYPE,opc,dpc,sls,spare @@ -818,7 +818,7 @@ bool SS7Management::control(NamedList& params) case SS7MsgSNM::LFU: txSls = (txSls + 1) & 0xff; } - txSls = params.getIntValue("linksel",txSls) & 0xff; + txSls = params.getIntValue(YSTRING("linksel"),txSls) & 0xff; String tmp; tmp << SS7PointCode::lookup(lbl.type()) << "," << lbl; Debug(this,DebugAll,"Sending %s to %s on %d [%p]", @@ -832,7 +832,7 @@ bool SS7Management::control(NamedList& params) case SS7MsgSNM::RST: case SS7MsgSNM::RSR: { - addr = params.getParam("destination"); + addr = params.getParam(YSTRING("destination")); SS7PointCode dest(opc); if (TelEngine::null(addr) || dest.assign(*addr,t)) { unsigned char data[5]; @@ -878,12 +878,12 @@ bool SS7Management::control(NamedList& params) case SS7MsgSNM::COA: case SS7MsgSNM::XCO: case SS7MsgSNM::XCA: - if (params.getBoolValue("emergency",false)) { + if (params.getBoolValue(YSTRING("emergency"),false)) { unsigned char data = (SS7MsgSNM::COO == cmd) ? SS7MsgSNM::ECO : SS7MsgSNM::ECA; return transmitMSU(SS7MSU(txSio,lbl,&data,1),lbl,txSls) >= 0; } else { - int seq = params.getIntValue("sequence",0) & 0x00ffffff; + int seq = params.getIntValue(YSTRING("sequence"),0) & 0x00ffffff; if (SS7MsgSNM::COO == cmd || SS7MsgSNM::COA == cmd) seq &= 0x7f; int len = 2; @@ -899,7 +899,7 @@ bool SS7Management::control(NamedList& params) } break; case SS7PointCode::ANSI: - data[1] = (unsigned char)((params.getIntValue("slc",sls) & 0x0f) | (seq << 4)); + data[1] = (unsigned char)((params.getIntValue(YSTRING("slc"),sls) & 0x0f) | (seq << 4)); data[2] = (unsigned char)(seq >> 4); len = 3; if (SS7MsgSNM::XCO == cmd || SS7MsgSNM::XCA == cmd) { @@ -920,7 +920,7 @@ bool SS7Management::control(NamedList& params) case SS7MsgSNM::CBD: case SS7MsgSNM::CBA: { - int code = params.getIntValue("code",0); + int code = params.getIntValue(YSTRING("code"),0); int len = 2; unsigned char data[3]; data[0] = cmd; @@ -929,7 +929,7 @@ bool SS7Management::control(NamedList& params) data[1] = (unsigned char)code; break; case SS7PointCode::ANSI: - data[1] = (unsigned char)((params.getIntValue("slc",sls) & 0x0f) | (code << 4)); + data[1] = (unsigned char)((params.getIntValue(YSTRING("slc"),sls) & 0x0f) | (code << 4)); data[2] = (unsigned char)(code >> 4); len = 3; break; diff --git a/libs/ysig/q921.cpp b/libs/ysig/q921.cpp index dd206815..0a54720e 100644 --- a/libs/ysig/q921.cpp +++ b/libs/ysig/q921.cpp @@ -54,7 +54,7 @@ static inline const char* linkSide(bool net) static inline void fixParams(NamedList& params, const NamedList& config) { params.copyParams(config); - int rx = params.getIntValue("rxunderrun"); + int rx = params.getIntValue(YSTRING("rxunderrun")); if ((rx > 0) && (rx < 2500)) params.setParam("rxunderrun","2500"); } @@ -143,11 +143,11 @@ ISDNQ921::ISDNQ921(const NamedList& params, const char* name, ISDNQ921Management m_idleTimer.interval(params,"t203",2000,10000,false); // Adjust idle timeout to data link side m_idleTimer.interval(m_idleTimer.interval() + (network() ? -500 : 500)); - m_window.maxVal(params.getIntValue("maxpendingframes",7)); + m_window.maxVal(params.getIntValue(YSTRING("maxpendingframes"),7)); if (!m_window.maxVal()) m_window.maxVal(7); - setDebug(params.getBoolValue("print-frames",false), - params.getBoolValue("extended-debug",false)); + setDebug(params.getBoolValue(YSTRING("print-frames"),false), + params.getBoolValue(YSTRING("extended-debug"),false)); if (debugAt(DebugInfo)) { String tmp; #ifdef DEBUG @@ -168,7 +168,7 @@ ISDNQ921::ISDNQ921(const NamedList& params, const char* name, ISDNQ921Management linkSide(network()),tmp.safe(),this); } if (!mgmt) - setDumper(params.getValue("layer2dump")); + setDumper(params.getValue(YSTRING("layer2dump"))); } // Destructor @@ -195,15 +195,15 @@ bool ISDNQ921::initialize(const NamedList* config) Debug(this,DebugInfo,"ISDNQ921::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_q921", - config->getIntValue("debuglevel",-1))); - setDebug(config->getBoolValue("print-frames",false), - config->getBoolValue("extended-debug",false)); + debugLevel(config->getIntValue(YSTRING("debuglevel_q921"), + config->getIntValue(YSTRING("debuglevel"),-1))); + setDebug(config->getBoolValue(YSTRING("print-frames"),false), + config->getBoolValue(YSTRING("extended-debug"),false)); } if (config && !m_management && !iface()) { - NamedString* name = config->getParam("sig"); + NamedString* name = config->getParam(YSTRING("sig")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { NamedPointer* ptr = YOBJECT(NamedPointer,name); NamedList* ifConfig = ptr ? YOBJECT(NamedList,ptr->userData()) : 0; @@ -1043,7 +1043,7 @@ ISDNQ921Management::ISDNQ921Management(const NamedList& params, const char* name m_network = net; m_teiManTimer.interval(params,"t202",2500,2600,false); m_teiTimer.interval(params,"t201",1000,5000,false); - setDumper(params.getValue("layer2dump")); + setDumper(params.getValue(YSTRING("layer2dump"))); bool set0 = true; if (baseName.endsWith("Management")) { baseName = baseName.substr(0,baseName.length()-10); @@ -1087,12 +1087,12 @@ bool ISDNQ921Management::initialize(const NamedList* config) Debug(this,DebugInfo,"ISDNQ921Management::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) - debugLevel(config->getIntValue("debuglevel_q921mgmt", - config->getIntValue("debuglevel",-1))); + debugLevel(config->getIntValue(YSTRING("debuglevel_q921mgmt"), + config->getIntValue(YSTRING("debuglevel"),-1))); if (config && !iface()) { - NamedString* name = config->getParam("sig"); + NamedString* name = config->getParam(YSTRING("sig")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { NamedPointer* ptr = YOBJECT(NamedPointer,name); NamedList* ifConfig = ptr ? YOBJECT(NamedList,ptr->userData()) : 0; @@ -1512,8 +1512,8 @@ ISDNQ921Passive::ISDNQ921Passive(const NamedList& params, const char* name) #endif m_idleTimer.interval(params,"idletimeout",4000,30000,false); m_checkLinkSide = detectType(); - setDebug(params.getBoolValue("print-frames",false), - params.getBoolValue("extended-debug",false)); + setDebug(params.getBoolValue(YSTRING("print-frames"),false), + params.getBoolValue(YSTRING("extended-debug"),false)); DDebug(this,DebugInfo, "ISDN Passive Data Link type=%s autodetect=%s idle-timeout=%u [%p]", linkSide(network()),String::boolText(detectType()), @@ -1521,7 +1521,7 @@ ISDNQ921Passive::ISDNQ921Passive(const NamedList& params, const char* name) m_idleTimer.start(); // Try to dump from specific parameter, fall back to generic const char* dump = network() ? "layer2dump-net" : "layer2dump-cpe"; - setDumper(params.getValue(dump,params.getValue("layer2dump"))); + setDumper(params.getValue(dump,params.getValue(YSTRING("layer2dump")))); } // Destructor @@ -1546,15 +1546,15 @@ bool ISDNQ921Passive::initialize(const NamedList* config) Debug(this,DebugInfo,"ISDNQ921Passive::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_q921", - config->getIntValue("debuglevel",-1))); - setDebug(config->getBoolValue("print-frames",false), - config->getBoolValue("extended-debug",false)); + debugLevel(config->getIntValue(YSTRING("debuglevel_q921"), + config->getIntValue(YSTRING("debuglevel"),-1))); + setDebug(config->getBoolValue(YSTRING("print-frames"),false), + config->getBoolValue(YSTRING("extended-debug"),false)); } if (config && !iface()) { - NamedString* name = config->getParam("sig"); + NamedString* name = config->getParam(YSTRING("sig")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { NamedPointer* ptr = YOBJECT(NamedPointer,name); NamedList* ifConfig = ptr ? YOBJECT(NamedList,ptr->userData()) : 0; @@ -1759,15 +1759,15 @@ ISDNLayer2::ISDNLayer2(const NamedList& params, const char* name, u_int8_t tei) m_maxUserData(260) { XDebug(this,DebugAll,"ISDNLayer2 '%s' comp=%p [%p]",name,static_cast(this),this); - m_network = params.getBoolValue("network",false); - m_detectType = params.getBoolValue("detect",false); - int tmp = params.getIntValue("sapi",0); + m_network = params.getBoolValue(YSTRING("network"),false); + m_detectType = params.getBoolValue(YSTRING("detect"),false); + int tmp = params.getIntValue(YSTRING("sapi"),0); m_sapi = (tmp >= 0 && tmp <= Q921_SAPI_MANAGEMENT) ? tmp : 0; - tmp = params.getIntValue("tei",tei); + tmp = params.getIntValue(YSTRING("tei"),tei); m_tei = (tmp >= 0 && tmp < Q921_TEI_BROADCAST) ? tmp : 0; teiAssigned(true); - m_autoRestart = params.getBoolValue("auto-restart",true); - m_maxUserData = params.getIntValue("maxuserdata",260); + m_autoRestart = params.getBoolValue(YSTRING("auto-restart"),true); + m_maxUserData = params.getIntValue(YSTRING("maxuserdata"),260); if (!m_maxUserData) m_maxUserData = 260; } diff --git a/libs/ysig/q931.cpp b/libs/ysig/q931.cpp index a9c56b2b..f6bfe32d 100644 --- a/libs/ysig/q931.cpp +++ b/libs/ysig/q931.cpp @@ -341,10 +341,10 @@ bool ISDNQ931IEData::processBearerCaps(ISDNQ931Message* msg, bool add, m_transferRate = ""; return false; } - m_transferCapability = ie->getValue("transfer-cap"); - m_transferMode = ie->getValue("transfer-mode"); - m_transferRate = ie->getValue("transfer-rate"); - m_format = ie->getValue("layer1-protocol"); + m_transferCapability = ie->getValue(YSTRING("transfer-cap")); + m_transferMode = ie->getValue(YSTRING("transfer-mode")); + m_transferRate = ie->getValue(YSTRING("transfer-rate")); + m_format = ie->getValue(YSTRING("layer1-protocol")); return true; } @@ -370,11 +370,11 @@ bool ISDNQ931IEData::processChannelID(ISDNQ931Message* msg, bool add, m_channelMandatory = m_channelByNumber = false; return false; } - m_bri = ie->getBoolValue("interface-bri",m_bri); - m_channelMandatory = ie->getBoolValue("channel-exclusive"); - m_channelByNumber = ie->getBoolValue("channel-by-number"); - m_channelType = ie->getValue("type"); - m_channelSelect = ie->getValue("channel-select"); + m_bri = ie->getBoolValue(YSTRING("interface-bri"),m_bri); + m_channelMandatory = ie->getBoolValue(YSTRING("channel-exclusive")); + m_channelByNumber = ie->getBoolValue(YSTRING("channel-by-number")); + m_channelType = ie->getValue(YSTRING("type")); + m_channelSelect = ie->getValue(YSTRING("channel-select")); if (m_bri && m_channelSelect) { m_channelByNumber = true; if (m_channelSelect == "b1") @@ -389,12 +389,12 @@ bool ISDNQ931IEData::processChannelID(ISDNQ931Message* msg, bool add, unsigned int n = ie->length(); for (unsigned int i = 0; i < n; i++) { NamedString* ns = ie->getParam(i); - if (ns && (ns->name() == "channels")) + if (ns && (ns->name() == YSTRING("channels"))) m_channels.append(*ns,","); } } else - m_channels = ie->getValue("slot-map"); + m_channels = ie->getValue(YSTRING("slot-map")); return true; } @@ -418,7 +418,7 @@ bool ISDNQ931IEData::processProgress(ISDNQ931Message* msg, bool add, // Progress may repeat ISDNQ931IE* ie = msg->getIE(ISDNQ931IE::Progress); for (; ie; ie = msg->getIE(ISDNQ931IE::Progress,ie)) - m_progress.append(ie->getValue("description"),","); + m_progress.append(ie->getValue(YSTRING("description")),","); } return !m_progress.null(); } @@ -474,9 +474,9 @@ bool ISDNQ931IEData::processCalledNo(ISDNQ931Message* msg, bool add, m_calledNo = ""; return false; } - m_calledNo = ie->getValue("number"); - m_calledType = ie->getValue("type"); - m_calledPlan = ie->getValue("plan"); + m_calledNo = ie->getValue(YSTRING("number")); + m_calledType = ie->getValue(YSTRING("type")); + m_calledPlan = ie->getValue(YSTRING("plan")); return true; } @@ -510,11 +510,11 @@ bool ISDNQ931IEData::processCallingNo(ISDNQ931Message* msg, bool add, m_callerNo = ""; return false; } - m_callerNo = ie->getValue("number"); - m_callerType = ie->getValue("type"); - m_callerPlan = ie->getValue("plan"); - m_callerPres = ie->getValue("presentation"); - m_callerScreening = ie->getValue("screening"); + m_callerNo = ie->getValue(YSTRING("number")); + m_callerType = ie->getValue(YSTRING("type")); + m_callerPlan = ie->getValue(YSTRING("plan")); + m_callerPres = ie->getValue(YSTRING("presentation")); + m_callerScreening = ie->getValue(YSTRING("screening")); return true; } @@ -839,7 +839,7 @@ bool ISDNQ931Call::sendEvent(SignallingEvent* event) default: m_terminate = m_destroy = true; retVal = sendReleaseComplete(event->message() ? - event->message()->params().getValue("reason") : 0); + event->message()->params().getValue(YSTRING("reason")) : 0); break; } break; @@ -948,9 +948,9 @@ SignallingEvent* ISDNQ931Call::getEvent(const Time& when) // Get reserved circuit or this object void* ISDNQ931Call::getObject(const String& name) const { - if (name == "SignallingCircuit") + if (name == YSTRING("SignallingCircuit")) return m_circuit; - if (name == "ISDNQ931Call") + if (name == YSTRING("ISDNQ931Call")) return (void*)this; return SignallingCall::getObject(name); } @@ -1448,9 +1448,9 @@ bool ISDNQ931Call::sendAlerting(SignallingMessage* sigMsg) MSG_CHECK_SEND(ISDNQ931Message::Alerting) const char* format = 0; if (sigMsg) { - format = sigMsg->params().getValue("format"); + format = sigMsg->params().getValue(YSTRING("format")); m_inbandAvailable = m_inbandAvailable || - sigMsg->params().getBoolValue("earlymedia",false); + sigMsg->params().getBoolValue(YSTRING("earlymedia"),false); if (m_inbandAvailable) SignallingUtils::appendFlag(m_data.m_progress,"in-band-info"); } @@ -1526,7 +1526,7 @@ bool ISDNQ931Call::sendConnect(SignallingMessage* sigMsg) } // Progress indicator if (sigMsg) { - m_data.m_progress = sigMsg->params().getValue("call-progress"); + m_data.m_progress = sigMsg->params().getValue(YSTRING("call-progress")); m_data.processProgress(msg,true,&q931()->parserData()); } m_conTimer.start(); @@ -1543,7 +1543,7 @@ bool ISDNQ931Call::sendConnectAck(SignallingMessage* sigMsg) ISDNQ931Message* msg = new ISDNQ931Message(ISDNQ931Message::ConnectAck,this); // Progress indicator if (sigMsg) { - m_data.m_progress = sigMsg->params().getValue("call-progress"); + m_data.m_progress = sigMsg->params().getValue(YSTRING("call-progress")); m_data.processProgress(msg,true,&q931()->parserData()); } else @@ -1558,7 +1558,7 @@ bool ISDNQ931Call::sendDisconnect(SignallingMessage* sigMsg) MSG_CHECK_SEND(ISDNQ931Message::Disconnect) m_data.m_reason = ""; if (sigMsg) - m_data.m_reason = sigMsg->params().getValue("reason"); + m_data.m_reason = sigMsg->params().getValue(YSTRING("reason")); ISDNQ931Message* msg = new ISDNQ931Message(ISDNQ931Message::Disconnect,this); m_data.processCause(msg,true); changeState(DisconnectReq); @@ -1575,12 +1575,12 @@ bool ISDNQ931Call::sendInfo(SignallingMessage* sigMsg) MSG_CHECK_SEND(ISDNQ931Message::Info) ISDNQ931Message* msg = new ISDNQ931Message(ISDNQ931Message::Info,this); // Check send complete complete - if (sigMsg->params().getBoolValue("complete")) + if (sigMsg->params().getBoolValue(YSTRING("complete"))) msg->appendSafe(new ISDNQ931IE(ISDNQ931IE::SendComplete)); - m_data.m_display = sigMsg->params().getValue("display"); + m_data.m_display = sigMsg->params().getValue(YSTRING("display")); m_data.processDisplay(msg,true,&q931()->parserData()); // Check tones or ringing - const char* tone = sigMsg->params().getValue("tone"); + const char* tone = sigMsg->params().getValue(YSTRING("tone")); if (tone) msg->appendIEValue(ISDNQ931IE::Keypad,"keypad",tone); return q931()->sendMessage(msg,callTei()); @@ -1592,9 +1592,9 @@ bool ISDNQ931Call::sendProgress(SignallingMessage* sigMsg) { MSG_CHECK_SEND(ISDNQ931Message::Progress) if (sigMsg) { - m_data.m_progress = sigMsg->params().getValue("progress"); + m_data.m_progress = sigMsg->params().getValue(YSTRING("progress")); m_inbandAvailable = m_inbandAvailable || - sigMsg->params().getBoolValue("earlymedia",false); + sigMsg->params().getBoolValue(YSTRING("earlymedia"),false); if (m_inbandAvailable) SignallingUtils::appendFlag(m_data.m_progress,"in-band-info"); } @@ -1611,7 +1611,7 @@ bool ISDNQ931Call::sendRelease(const char* reason, SignallingMessage* sigMsg) return false; // Get reason if (!reason && sigMsg) - reason = sigMsg->params().getValue("reason",0); + reason = sigMsg->params().getValue(YSTRING("reason"),0); if (reason) m_data.m_reason = reason; m_terminate = true; @@ -1661,7 +1661,7 @@ bool ISDNQ931Call::sendSetup(SignallingMessage* sigMsg) m_data.m_transferCapability = "speech"; m_data.m_transferMode = "circuit"; m_data.m_transferRate = "64kbit"; - m_data.m_format = sigMsg->params().getValue("format",q931()->format()); + m_data.m_format = sigMsg->params().getValue(YSTRING("format"),q931()->format()); if (0xffff == lookup(m_data.m_format,Q931Parser::s_dict_bearerProto1,0xffff)) m_data.m_format = "alaw"; m_data.processBearerCaps(msg,true); @@ -1693,22 +1693,22 @@ bool ISDNQ931Call::sendSetup(SignallingMessage* sigMsg) m_data.processChannelID(msg,true); } // Progress indicator - m_data.m_progress = sigMsg->params().getValue("call-progress"); + m_data.m_progress = sigMsg->params().getValue(YSTRING("call-progress")); m_data.processProgress(msg,true,&q931()->parserData()); // Display - m_data.m_display = sigMsg->params().getValue("callername"); + m_data.m_display = sigMsg->params().getValue(YSTRING("callername")); m_data.processDisplay(msg,true,&q931()->parserData()); // CallingNo - m_data.m_callerType = sigMsg->params().getValue("callernumtype",q931()->numType()); - m_data.m_callerPlan = sigMsg->params().getValue("callernumplan",q931()->numPlan()); - m_data.m_callerPres = sigMsg->params().getValue("callerpres",q931()->numPresentation()); - m_data.m_callerScreening = sigMsg->params().getValue("callerscreening",q931()->numScreening()); - m_data.m_callerNo = sigMsg->params().getValue("caller"); + m_data.m_callerType = sigMsg->params().getValue(YSTRING("callernumtype"),q931()->numType()); + m_data.m_callerPlan = sigMsg->params().getValue(YSTRING("callernumplan"),q931()->numPlan()); + m_data.m_callerPres = sigMsg->params().getValue(YSTRING("callerpres"),q931()->numPresentation()); + m_data.m_callerScreening = sigMsg->params().getValue(YSTRING("callerscreening"),q931()->numScreening()); + m_data.m_callerNo = sigMsg->params().getValue(YSTRING("caller")); m_data.processCallingNo(msg,true); // CalledNo - m_data.m_calledType = sigMsg->params().getValue("callednumtype"); - m_data.m_calledPlan = sigMsg->params().getValue("callednumplan"); - m_data.m_calledNo = sigMsg->params().getValue("called"); + m_data.m_calledType = sigMsg->params().getValue(YSTRING("callednumtype")); + m_data.m_calledPlan = sigMsg->params().getValue(YSTRING("callednumplan")); + m_data.m_calledNo = sigMsg->params().getValue(YSTRING("called")); m_data.processCalledNo(msg,true); // Send changeState(CallInitiated); @@ -1731,7 +1731,7 @@ bool ISDNQ931Call::sendSetup(SignallingMessage* sigMsg) bool ISDNQ931Call::sendSuspendRej(const char* reason, SignallingMessage* sigMsg) { if (!reason && sigMsg) - reason = sigMsg->params().getValue("reason"); + reason = sigMsg->params().getValue(YSTRING("reason")); ISDNQ931Message* msg = new ISDNQ931Message(ISDNQ931Message::SuspendRej,this); msg->appendIEValue(ISDNQ931IE::Cause,0,reason); return q931()->sendMessage(msg,callTei()); @@ -1790,7 +1790,7 @@ SignallingEvent* ISDNQ931Call::getCircuitEvent(const Time& when) SignallingEvent* event = 0; switch (ev->type()) { case SignallingCircuitEvent::Dtmf: { - const char* tone = ev->getValue("tone"); + const char* tone = ev->getValue(YSTRING("tone")); if (!(tone && *tone)) break; ISDNQ931Message* msg = new ISDNQ931Message(ISDNQ931Message::Info,this); @@ -2021,11 +2021,11 @@ void ISDNQ931CallMonitor::setTerminate(const char* reason) // Get caller's and called's circuit or this object void* ISDNQ931CallMonitor::getObject(const String& name) const { - if (name == "SignallingCircuitCaller") + if (name == YSTRING("SignallingCircuitCaller")) return m_callerCircuit; - if (name == "SignallingCircuitCalled") + if (name == YSTRING("SignallingCircuitCalled")) return m_calledCircuit; - if (name == "ISDNQ931CallMonitor") + if (name == YSTRING("ISDNQ931CallMonitor")) return (void*)this; return SignallingCall::getObject(name); } @@ -2200,7 +2200,7 @@ SignallingEvent* ISDNQ931CallMonitor::getCircuitEvent(const Time& when) SignallingEvent* event = 0; switch (ev->type()) { case SignallingCircuitEvent::Dtmf: { - const char* tone = ev->getValue("tone"); + const char* tone = ev->getValue(YSTRING("tone")); if (!(tone && *tone)) break; ISDNQ931Message* msg = new ISDNQ931Message(ISDNQ931Message::Info, @@ -2295,14 +2295,14 @@ ISDNQ931ParserData::ISDNQ931ParserData(const NamedList& params, DebugEnabler* db m_flags(0), m_flagsOrig(0) { - m_allowSegment = params.getBoolValue("allowsegmentation",false); - m_maxSegments = params.getIntValue("maxsegments",8); - m_maxDisplay = params.getIntValue("max-display",34); + m_allowSegment = params.getBoolValue(YSTRING("allowsegmentation"),false); + m_maxSegments = params.getIntValue(YSTRING("maxsegments"),8); + m_maxDisplay = params.getIntValue(YSTRING("max-display"),34); if (m_maxDisplay != 34 && m_maxDisplay != 82) m_maxDisplay = 34; - m_extendedDebug = params.getBoolValue("extended-debug",false); + m_extendedDebug = params.getBoolValue(YSTRING("extended-debug"),false); // Set flags - String flags = params.getValue("switchtype"); + String flags = params.getValue(YSTRING("switchtype")); SignallingUtils::encodeFlags(0,m_flagsOrig,flags,ISDNQ931::s_swType); SignallingUtils::encodeFlags(0,m_flagsOrig,flags,ISDNQ931::s_flags); m_flags = m_flagsOrig; @@ -2379,9 +2379,9 @@ ISDNQ931::ISDNQ931(const NamedList& params, const char* name) } #endif m_parserData.m_dbg = this; - m_networkHint = params.getBoolValue("network",m_networkHint); - m_data.m_bri = !(m_primaryRate = params.getBoolValue("primary",m_primaryRate)); - m_callRefLen = params.getIntValue("callreflen",m_primaryRate ? 2 : 1); + m_networkHint = params.getBoolValue(YSTRING("network"),m_networkHint); + m_data.m_bri = !(m_primaryRate = params.getBoolValue(YSTRING("primary"),m_primaryRate)); + m_callRefLen = params.getIntValue(YSTRING("callreflen"),m_primaryRate ? 2 : 1); if (m_callRefLen < 1 || m_callRefLen > 4) m_callRefLen = 2; // Set mask. Bit 7 of the first byte of the message header it's used for initiator flag @@ -2394,25 +2394,25 @@ ISDNQ931::ISDNQ931(const NamedList& params, const char* name) m_callDiscTimer.interval(params,"t305",0,5000,false); m_callRelTimer.interval(params,"t308",0,5000,false); m_callConTimer.interval(params,"t313",0,5000,false); - m_cpeNumber = params.getValue("number"); - m_numPlan = params.getValue("numplan"); + m_cpeNumber = params.getValue(YSTRING("number")); + m_numPlan = params.getValue(YSTRING("numplan")); if (0xffff == lookup(m_numPlan,Q931Parser::s_dict_numPlan,0xffff)) m_numPlan = "unknown"; - m_numType = params.getValue("numtype"); + m_numType = params.getValue(YSTRING("numtype")); if (0xffff == lookup(m_numType,Q931Parser::s_dict_typeOfNumber,0xffff)) m_numType = "unknown"; - m_numPresentation = params.getValue("presentation"); + m_numPresentation = params.getValue(YSTRING("presentation")); if (0xffff == lookup(m_numPresentation,Q931Parser::s_dict_presentation,0xffff)) m_numPresentation = "allowed"; - m_numScreening = params.getValue("screening"); + m_numScreening = params.getValue(YSTRING("screening")); if (0xffff == lookup(m_numScreening,Q931Parser::s_dict_screening,0xffff)) m_numScreening = "user-provided"; - m_format = params.getValue("format"); + m_format = params.getValue(YSTRING("format")); if (0xffff == lookup(m_format,Q931Parser::s_dict_bearerProto1,0xffff)) m_format = "alaw"; // Debug - setDebug(params.getBoolValue("print-messages",false), - params.getBoolValue("extended-debug",false)); + setDebug(params.getBoolValue(YSTRING("print-messages"),false), + params.getBoolValue(YSTRING("extended-debug"),false)); if (debugAt(DebugInfo)) { String s(network() ? "NET" : "CPE"); #ifdef DEBUG @@ -2437,14 +2437,14 @@ ISDNQ931::ISDNQ931(const NamedList& params, const char* name) s << " segmentation=" << String::boolText(m_parserData.m_allowSegment); s << " max-segments=" << (unsigned int)m_parserData.m_maxSegments; #else - s << " type=" << params.getValue("switchtype"); + s << " type=" << params.getValue(YSTRING("switchtype")); s << " pri=" << String::boolText(m_primaryRate); s << " format=" << m_format; s << " channelsync=" << String::boolText(0 != m_syncGroupTimer.interval()); #endif Debug(this,DebugInfo,"ISDN Call Controller %s [%p]",s.c_str(),this); } - setDumper(params.getValue("layer3dump")); + setDumper(params.getValue(YSTRING("layer3dump"))); m_syncGroupTimer.start(); } @@ -2469,13 +2469,13 @@ bool ISDNQ931::initialize(const NamedList* config) Debug(this,DebugInfo,"ISDNQ931::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_q931", - config->getIntValue("debuglevel",-1))); - setDebug(config->getBoolValue("print-messages",false), - config->getBoolValue("extended-debug",false)); + debugLevel(config->getIntValue(YSTRING("debuglevel_q931"), + config->getIntValue(YSTRING("debuglevel"),-1))); + setDebug(config->getBoolValue(YSTRING("print-messages"),false), + config->getBoolValue(YSTRING("extended-debug"),false)); } if (config && !layer2()) { - const String* name = config->getParam("sig"); + const String* name = config->getParam(YSTRING("sig")); if (!name) name = config; if (!TelEngine::null(name)) { @@ -2728,7 +2728,7 @@ void ISDNQ931::receiveData(const DataBlock& data, u_int8_t tei, ISDNLayer2* laye // We are a BRI CPE with a number - check the called party field ISDNQ931IE* ie = msg->getIE(ISDNQ931IE::CalledNo); if (ie) { - const String* number = ie->getParam("number"); + const String* number = ie->getParam(YSTRING("number")); if (number && !number->startsWith(m_cpeNumber)) { DDebug(this,DebugInfo,"Setup was for '%s', not us.",number->c_str()); break; @@ -3043,12 +3043,12 @@ ISDNQ931Message* ISDNQ931::getMsg(const DataBlock& data) ISDNQ931IE* ie = msg->getIE(ISDNQ931IE::Segmented); if (!ie) break; - NamedString* ns = ie->getParam("first"); + NamedString* ns = ie->getParam(YSTRING("first")); if (!ns) break; first = ns->toBoolean(); - remaining = (u_int8_t)ie->getIntValue("remaining",0xff); - type = (u_int8_t)ie->getIntValue("message",0xff); + remaining = (u_int8_t)ie->getIntValue(YSTRING("remaining"),0xff); + type = (u_int8_t)ie->getIntValue(YSTRING("message"),0xff); valid = true; break; } @@ -3196,7 +3196,7 @@ void ISDNQ931::processMsgRestart(ISDNQ931Message* msg, u_int8_t tei) msg->name(),m_data.m_restart.c_str(),m_data.m_channels.c_str()); while (true) { - if (m_data.m_restart == "channels") { + if (m_data.m_restart == YSTRING("channels")) { if (list->count() > 0) terminateCalls(list,"resource-unavailable"); else { @@ -3206,8 +3206,8 @@ void ISDNQ931::processMsgRestart(ISDNQ931Message* msg, u_int8_t tei) break; } - bool single = (m_data.m_restart == "interface"); - bool all = !single && (m_data.m_restart == "all-interfaces"); + bool single = (m_data.m_restart == YSTRING("interface")); + bool all = !single && (m_data.m_restart == YSTRING("all-interfaces")); // If all interfaces is specified, ChannelID must not be present // If ChannelID is present and allowed, it must contain a single channel code if (!(single || all) || (all && list->count() > 0) || @@ -3460,8 +3460,8 @@ ISDNQ931Monitor::ISDNQ931Monitor(const NamedList& params, const char* name) m_parserData.m_maxMsgLen = 0xffffffff; m_parserData.m_dbg = this; // Debug - setDebug(params.getBoolValue("print-messages",true), - params.getBoolValue("extended-debug",false)); + setDebug(params.getBoolValue(YSTRING("print-messages"),true), + params.getBoolValue(YSTRING("extended-debug"),false)); } ISDNQ931Monitor::~ISDNQ931Monitor() @@ -3485,10 +3485,10 @@ bool ISDNQ931Monitor::initialize(const NamedList* config) Debug(this,DebugInfo,"ISDNQ931Monitor::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_q931", - config->getIntValue("debuglevel",-1))); - setDebug(config->getBoolValue("print-messages",false), - config->getBoolValue("extended-debug",false)); + debugLevel(config->getIntValue(YSTRING("debuglevel_q931"), + config->getIntValue(YSTRING("debuglevel"),-1))); + setDebug(config->getBoolValue(YSTRING("print-messages"),false), + config->getBoolValue(YSTRING("extended-debug"),false)); for (int i = 0; i <= 1; i++) { bool net = (0 == i); if (net && m_q921Net) @@ -4044,7 +4044,7 @@ void ISDNQ931Message::toString(String& dest, bool extendedDebug, const char* ind void* ISDNQ931Message::getObject(const String& name) const { - if (name == "ISDNQ931Message") + if (name == YSTRING("ISDNQ931Message")) return (void*)this; return SignallingMessage::getObject(name); } @@ -4594,7 +4594,7 @@ ISDNQ931Message* Q931Parser::decode(const DataBlock& buffer, DataBlock* segData) if (m_settings->flag(ISDNQ931::IgnoreNonLockedIE)) { bool ignore = false; if (ie->type() == ISDNQ931IE::Shift) - ignore = m_skip = !ie->getBoolValue("lock",false); + ignore = m_skip = !ie->getBoolValue(YSTRING("lock"),false); else if (m_skip) { ignore = true; m_skip = false; @@ -5074,8 +5074,8 @@ ISDNQ931IE* Q931Parser::getIE(const u_int8_t* data, u_int32_t len, u_int32_t& co // Check Shift IE. Change current codeset void Q931Parser::shiftCodeset(const ISDNQ931IE* ie) { - bool locking = ie->getBoolValue("lock",false); - int value = ie->getIntValue("codeset",0); + bool locking = ie->getBoolValue(YSTRING("lock"),false); + int value = ie->getIntValue(YSTRING("codeset"),0); XDebug(m_settings->m_dbg,DebugAll, "Process %s shift with codeset %u [%p]", locking?"locking":"non locking",value,m_msg); diff --git a/libs/ysig/router.cpp b/libs/ysig/router.cpp index 56ea377a..f8d01b16 100644 --- a/libs/ysig/router.cpp +++ b/libs/ysig/router.cpp @@ -337,20 +337,20 @@ SS7Router::SS7Router(const NamedList& params) ¶ms,this,tmp.c_str()); } #endif - const String* tr = params.getParam("transfer"); + const String* tr = params.getParam(YSTRING("transfer")); if (!TelEngine::null(tr)) { - m_transferSilent = (*tr == "silent"); + m_transferSilent = (*tr == YSTRING("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); + m_autoAllowed = params.getBoolValue(YSTRING("autoallow"),m_autoAllowed); + m_sendUnavail = params.getBoolValue(YSTRING("sendupu"),m_sendUnavail); + m_sendProhibited = params.getBoolValue(YSTRING("sendtfp"),m_sendProhibited); m_restart.interval(params,"starttime",5000,(m_transfer ? 60000 : 10000),false); m_isolate.interval(params,"isolation",500,1000,true); m_routeTest.interval(params,"testroutes",10000,50000,true), m_trafficOk.interval(m_restart.interval() + 4000); m_trafficSent.interval(m_restart.interval() + 8000); - m_testRestricted = params.getBoolValue("testrestricted",m_testRestricted); + m_testRestricted = params.getBoolValue(YSTRING("testrestricted"),m_testRestricted); loadLocalPC(params); } @@ -369,18 +369,18 @@ bool SS7Router::initialize(const NamedList* config) Debug(this,DebugInfo,"SS7Router::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif if (config) { - debugLevel(config->getIntValue("debuglevel_router", - config->getIntValue("debuglevel",-1))); - const String* tr = config->getParam("transfer"); + debugLevel(config->getIntValue(YSTRING("debuglevel_router"), + config->getIntValue(YSTRING("debuglevel"),-1))); + const String* tr = config->getParam(YSTRING("transfer")); if (!TelEngine::null(tr)) { - m_transferSilent = (*tr == "silent"); + m_transferSilent = (*tr == YSTRING("silent")); m_transfer = !m_transferSilent && tr->toBoolean(m_transfer); } - setNI(SS7MSU::getNetIndicator(config->getValue("netindicator"),SS7MSU::National)); - m_autoAllowed = config->getBoolValue("autoallow",m_autoAllowed); - m_sendUnavail = config->getBoolValue("sendupu",m_sendUnavail); - m_sendProhibited = config->getBoolValue("sendtfp",m_sendProhibited); - const String* param = config->getParam("management"); + setNI(SS7MSU::getNetIndicator(config->getValue(YSTRING("netindicator")),SS7MSU::National)); + m_autoAllowed = config->getBoolValue(YSTRING("autoallow"),m_autoAllowed); + m_sendUnavail = config->getBoolValue(YSTRING("sendupu"),m_sendUnavail); + m_sendProhibited = config->getBoolValue(YSTRING("sendtfp"),m_sendProhibited); + const String* param = config->getParam(YSTRING("management")); const char* name = "ss7snm"; if (param) { if (*param && !param->toBoolean(false)) @@ -402,7 +402,7 @@ bool SS7Router::initialize(const NamedList* config) attach(m_mngmt = YSIGCREATE(SS7Management,¶ms)); } } - return m_started || (config && !config->getBoolValue("autostart")) || restart(); + return m_started || (config && !config->getBoolValue(YSTRING("autostart"))) || restart(); } void SS7Router::loadLocalPC(const NamedList& params) @@ -1765,9 +1765,9 @@ void SS7Router::notify(SS7Layer3* network, int sls) bool SS7Router::control(NamedList& params) { - String* ret = params.getParam("completion"); - const String* oper = params.getParam("operation"); - const char* cmp = params.getValue("component"); + String* ret = params.getParam(YSTRING("completion")); + const String* oper = params.getParam(YSTRING("operation")); + const char* cmp = params.getValue(YSTRING("component")); int cmd = -1; if (!TelEngine::null(oper)) cmd = oper->toInteger(s_dict_control,cmd); @@ -1775,7 +1775,7 @@ bool SS7Router::control(NamedList& params) if (ret) { if (oper && (cmd < 0)) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); if (cmp) { if (toString() != cmp) return false; @@ -1789,9 +1789,9 @@ bool SS7Router::control(NamedList& params) if (!(cmp && toString() == cmp)) return false; - m_autoAllowed = params.getBoolValue("autoallow",m_autoAllowed); - m_sendUnavail = params.getBoolValue("sendupu",m_sendUnavail); - m_sendProhibited = params.getBoolValue("sendtfp",m_sendProhibited); + m_autoAllowed = params.getBoolValue(YSTRING("autoallow"),m_autoAllowed); + m_sendUnavail = params.getBoolValue(YSTRING("sendupu"),m_sendUnavail); + m_sendProhibited = params.getBoolValue(YSTRING("sendtfp"),m_sendProhibited); String err; switch (cmd) { case SS7Router::Pause: @@ -1826,12 +1826,12 @@ bool SS7Router::control(NamedList& params) case SS7MsgSNM::TFR: case SS7MsgSNM::TFA: { - SS7PointCode::Type type = SS7PointCode::lookup(params.getValue("pointcodetype")); + SS7PointCode::Type type = SS7PointCode::lookup(params.getValue(YSTRING("pointcodetype"))); if (SS7PointCode::length(type) == 0) { err << "missing 'pointcodetype'"; break; } - const String* dest = params.getParam("destination"); + const String* dest = params.getParam(YSTRING("destination")); if (TelEngine::null(dest)) { err << "missing 'destination'"; break; @@ -1842,9 +1842,9 @@ bool SS7Router::control(NamedList& params) break; } if (SS7MsgSNM::RST == cmd || SS7MsgSNM::RSR == cmd) { - const String* addr = params.getParam("back-address"); + const String* addr = params.getParam(YSTRING("back-address")); if (TelEngine::null(addr)) - addr = params.getParam("address"); + addr = params.getParam(YSTRING("address")); if (TelEngine::null(addr)) { err = "missing 'address'"; break; @@ -1876,9 +1876,9 @@ bool SS7Router::control(NamedList& params) m_mngmt->controlExecute(ctl); return true; } - String src = params.getParam("source"); + String src = params.getParam(YSTRING("source")); if (src.null()) { - const String* addr = params.getParam("address"); + const String* addr = params.getParam(YSTRING("address")); if (addr) { ObjList* l = addr->split(','); if (l && l->at(1)) @@ -1889,18 +1889,18 @@ bool SS7Router::control(NamedList& params) if (src) { SS7PointCode opc; if (!opc.assign(src,type)) { - if (!params.getBoolValue("automatic")) + if (!params.getBoolValue(YSTRING("automatic"))) err << "invalid source: " << src ; break; } if (!setRouteSpecificState(type,pc,opc,routeState(static_cast(cmd)))) { - if (!params.getBoolValue("automatic")) + if (!params.getBoolValue(YSTRING("automatic"))) err << "no such route: " << *dest << " from: " << src; break; } } else if (!setRouteState(type,pc,routeState(static_cast(cmd)))) { - if (!params.getBoolValue("automatic")) + if (!params.getBoolValue(YSTRING("automatic"))) err << "no such route: " << *dest; break; } diff --git a/libs/ysig/sigcall.cpp b/libs/ysig/sigcall.cpp index 369c1d53..8422b5ce 100644 --- a/libs/ysig/sigcall.cpp +++ b/libs/ysig/sigcall.cpp @@ -75,13 +75,13 @@ SignallingCallControl::SignallingCallControl(const NamedList& params, m_exiting(false) { // Controller location - m_location = params.getValue("location"); + m_location = params.getValue(YSTRING("location")); // Strategy - const char* strategy = params.getValue("strategy","increment"); + const char* strategy = params.getValue(YSTRING("strategy"),"increment"); m_strategy = SignallingCircuitGroup::str2strategy(strategy); String restrict; if (m_strategy != SignallingCircuitGroup::Random) - restrict = params.getValue("strategy-restrict"); + restrict = params.getValue(YSTRING("strategy-restrict")); if (!restrict.null()) { if (restrict == "odd") m_strategy |= SignallingCircuitGroup::OnlyOdd; @@ -94,14 +94,14 @@ SignallingCallControl::SignallingCallControl(const NamedList& params, } // Message prefix - m_msgPrefix = params.getValue("message-prefix",msgPrefix); + m_msgPrefix = params.getValue(YSTRING("message-prefix"),msgPrefix); // Verify event timer m_verifyTimer.interval(params,"verifyeventinterval",10,120,true,true); m_verifyTimer.start(); // Media Required - m_mediaRequired = (MediaRequired)params.getIntValue("needmedia", + m_mediaRequired = (MediaRequired)params.getIntValue(YSTRING("needmedia"), s_mediaRequired,m_mediaRequired); } @@ -789,7 +789,7 @@ SignallingCircuitSpan* SignallingCircuitGroup::buildSpan(const String& name, uns : NamedList(name), m_group(group) { } virtual void* getObject(const String& name) const - { return (name == "SignallingCircuitGroup") ? m_group : NamedList::getObject(name); } + { return (name == YSTRING("SignallingCircuitGroup")) ? m_group : NamedList::getObject(name); } SignallingCircuitGroup* m_group; }; @@ -1174,15 +1174,15 @@ AnalogLine::AnalogLine(AnalogLineGroup* grp, unsigned int cic, const NamedList& if (m_type == Recorder) m_type = FXO; m_address << m_group->toString() << "/" << m_circuit->code(); - m_inband = params.getBoolValue("dtmfinband",false); - String tmp = params.getValue("echocancel"); + m_inband = params.getBoolValue(YSTRING("dtmfinband"),false); + String tmp = params.getValue(YSTRING("echocancel")); if (tmp.isBoolean()) m_echocancel = tmp.toBoolean() ? 1 : -1; - m_answerOnPolarity = params.getBoolValue("answer-on-polarity",false); - m_hangupOnPolarity = params.getBoolValue("hangup-on-polarity",false); - m_polarityControl = params.getBoolValue("polaritycontrol",false); + m_answerOnPolarity = params.getBoolValue(YSTRING("answer-on-polarity"),false); + m_hangupOnPolarity = params.getBoolValue(YSTRING("hangup-on-polarity"),false); + m_polarityControl = params.getBoolValue(YSTRING("polaritycontrol"),false); - m_callSetup = (CallSetupInfo)lookup(params.getValue("callsetup"),csNames(),After); + m_callSetup = (CallSetupInfo)lookup(params.getValue(YSTRING("callsetup")),csNames(),After); m_callSetupTimeout = getValidInt(params,"callsetup-timeout",2000); m_noRingTimeout = getValidInt(params,"ring-timeout",10000); @@ -1192,9 +1192,9 @@ AnalogLine::AnalogLine(AnalogLineGroup* grp, unsigned int cic, const NamedList& DDebug(m_group,DebugAll,"AnalogLine() addr=%s type=%s [%p]", address(),lookup(m_type,typeNames()),this); - if (!params.getBoolValue("out-of-service",false)) { + if (!params.getBoolValue(YSTRING("out-of-service"),false)) { resetCircuit(); - if (params.getBoolValue("connect",true)) + if (params.getBoolValue(YSTRING("connect"),true)) connect(false); } else diff --git a/libs/ysig/sigtran.cpp b/libs/ysig/sigtran.cpp index 52ba926d..e57ff7eb 100644 --- a/libs/ysig/sigtran.cpp +++ b/libs/ysig/sigtran.cpp @@ -282,9 +282,9 @@ bool SIGAdaptation::initialize(const NamedList* config) { if (transport()) return true; - NamedString* name = config->getParam("sig"); + NamedString* name = config->getParam(YSTRING("sig")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { DDebug(this,DebugInfo,"Creating transport for SIGTRAN UA [%p]",this); NamedPointer* ptr = YOBJECT(NamedPointer,name); @@ -513,8 +513,8 @@ SIGAdaptClient::SIGAdaptClient(const char* name, const NamedList* params, Debug(this,DebugInfo,"SIGAdaptClient(%u,%u) created [%p]%s", payload,port,this,tmp.c_str()); #endif - m_aspId = params->getIntValue("aspid",m_aspId); - m_traffic = (TrafficMode)params->getIntValue("traffic",s_trafficModes,m_traffic); + m_aspId = params->getIntValue(YSTRING("aspid"),m_aspId); + m_traffic = (TrafficMode)params->getIntValue(YSTRING("traffic"),s_trafficModes,m_traffic); } } @@ -861,7 +861,7 @@ SS7M2PA::SS7M2PA(const NamedList& params) // Confirmation timer 1/2 t4 m_confTimer.interval(params,"conf_timer",50,400,false); // Maximum unacknowledged messages, max_unack+1 will force an ACK - m_maxUnack = params.getIntValue("max_unack",4); + m_maxUnack = params.getIntValue(YSTRING("max_unack"),4); if (m_maxUnack > 10) m_maxUnack = 10; DDebug(this,DebugAll,"Creating SS7M2PA [%p]",this); @@ -882,13 +882,13 @@ bool SS7M2PA::initialize(const NamedList* config) config->dump(tmp,"\r\n ",'\'',true); Debug(this,DebugInfo,"SS7M2PA::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif - m_dumpMsg = config && config->getBoolValue("dumpMsg",false); - m_autostart = !config || config->getBoolValue("autostart",true); - m_autoEmergency = !config || config->getBoolValue("autoemergency",true); + m_dumpMsg = config && config->getBoolValue(YSTRING("dumpMsg"),false); + m_autostart = !config || config->getBoolValue(YSTRING("autostart"),true); + m_autoEmergency = !config || config->getBoolValue(YSTRING("autoemergency"),true); if (config && !transport()) { - NamedString* name = config->getParam("sig"); + NamedString* name = config->getParam(YSTRING("sig")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { NamedPointer* ptr = YOBJECT(NamedPointer,name); NamedList* trConfig = ptr ? YOBJECT(NamedList,ptr->userData()) : 0; @@ -1178,9 +1178,9 @@ unsigned int SS7M2PA::status() const bool SS7M2PA::control(Operation oper, NamedList* params) { if (params) { - m_autostart = params->getBoolValue("autostart",m_autostart); - m_autoEmergency = params->getBoolValue("autoemergency",m_autoEmergency); - m_maxUnack = params->getIntValue("max_unack",m_maxUnack); + m_autostart = params->getBoolValue(YSTRING("autostart"),m_autostart); + m_autoEmergency = params->getBoolValue(YSTRING("autoemergency"),m_autoEmergency); + m_maxUnack = params->getIntValue(YSTRING("max_unack"),m_maxUnack); if (m_maxUnack > 10) m_maxUnack = 10; } @@ -1498,12 +1498,13 @@ bool SS7M2UAClient::processMSG(unsigned char msgVersion, unsigned char msgClass, SS7M2UA::SS7M2UA(const NamedList& params) : SignallingComponent(params.safe("SS7M2UA"),¶ms), m_retrieve(50), - m_iid(params.getIntValue("iid",-1)), m_linkState(LinkDown), m_rpo(false), + m_iid(params.getIntValue(YSTRING("iid"),-1)), + m_linkState(LinkDown), m_rpo(false), m_longSeq(false) { DDebug(DebugInfo,"Creating SS7M2UA [%p]",this); m_retrieve.interval(params,"retrieve",5,200,true); - m_longSeq = params.getBoolValue("longsequence"); + m_longSeq = params.getBoolValue(YSTRING("longsequence")); m_lastSeqRx = -2; } @@ -1515,13 +1516,13 @@ bool SS7M2UA::initialize(const NamedList* config) config->dump(tmp,"\r\n ",'\'',true); 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); + m_autostart = !config || config->getBoolValue(YSTRING("autostart"),true); + m_autoEmergency = !config || config->getBoolValue(YSTRING("autoemergency"),true); if (config && !adaptation()) { - m_iid = config->getIntValue("iid",m_iid); - NamedString* name = config->getParam("client"); + m_iid = config->getIntValue(YSTRING("iid"),m_iid); + NamedString* name = config->getParam(YSTRING("client")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { DDebug(this,DebugInfo,"Creating adaptation '%s' for SS7 M2UA [%p]", name->c_str(),this); @@ -1550,9 +1551,9 @@ 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); - m_longSeq = params->getBoolValue("longsequence",m_longSeq); + m_autostart = params->getBoolValue(YSTRING("autostart"),m_autostart); + m_autoEmergency = params->getBoolValue(YSTRING("autoemergency"),m_autoEmergency); + m_longSeq = params->getBoolValue(YSTRING("longsequence"),m_longSeq); } switch (oper) { case Pause: @@ -1922,7 +1923,7 @@ bool ISDNIUAClient::processMSG(unsigned char msgVersion, unsigned char msgClass, ISDNIUA::ISDNIUA(const NamedList& params, const char *name, u_int8_t tei) : SignallingComponent(params.safe(name ? name : "ISDNIUA"),¶ms), ISDNLayer2(params,name,tei), - m_iid(params.getIntValue("iid",-1)) + m_iid(params.getIntValue(YSTRING("iid"),-1)) { DDebug(DebugInfo,"Creating ISDNIUA [%p]",this); } @@ -2122,12 +2123,12 @@ bool ISDNIUA::initialize(const NamedList* config) config->dump(tmp,"\r\n ",'\'',true); Debug(this,DebugInfo,"ISDNIUA::initialize(%p) [%p]%s",config,this,tmp.c_str()); #endif - m_autostart = !config || config->getBoolValue("autostart",true); + m_autostart = !config || config->getBoolValue(YSTRING("autostart"),true); if (config && !adaptation()) { - m_iid = config->getIntValue("iid",m_iid); - NamedString* name = config->getParam("client"); + m_iid = config->getIntValue(YSTRING("iid"),m_iid); + NamedString* name = config->getParam(YSTRING("client")); if (!name) - name = config->getParam("basename"); + name = config->getParam(YSTRING("basename")); if (name) { DDebug(this,DebugInfo,"Creating adaptation '%s' for ISDN UA [%p]", name->c_str(),this); diff --git a/libs/ysig/testpart.cpp b/libs/ysig/testpart.cpp index d65c7b7b..d47cc93d 100644 --- a/libs/ysig/testpart.cpp +++ b/libs/ysig/testpart.cpp @@ -129,7 +129,7 @@ bool SS7Testing::initialize(const NamedList* config) Lock mylock(this); setParams(*config); bool ok = SS7Layer4::initialize(config); - if (ok && config->getBoolValue("autostart",false)) { + if (ok && config->getBoolValue(YSTRING("autostart"),false)) { if (m_timer.interval() && m_lbl.length()) m_timer.start(); sendTraffic(); @@ -139,15 +139,15 @@ bool SS7Testing::initialize(const NamedList* config) bool SS7Testing::control(NamedList& params) { - String* ret = params.getParam("completion"); - const String* oper = params.getParam("operation"); - const char* cmp = params.getValue("component"); + String* ret = params.getParam(YSTRING("completion")); + const String* oper = params.getParam(YSTRING("operation")); + const char* cmp = params.getValue(YSTRING("component")); int cmd = oper ? oper->toInteger(s_dict_control,-1) : -1; if (ret) { if (oper && (cmd < 0)) return false; - String part = params.getValue("partword"); + String part = params.getValue(YSTRING("partword")); if (cmp) { if (toString() != cmp) return false; @@ -188,15 +188,15 @@ bool SS7Testing::control(NamedList& params) void SS7Testing::setParams(const NamedList& params, bool setSeq) { - if (!m_timer.interval() || params.getParam("interval")) + if (!m_timer.interval() || params.getParam(YSTRING("interval"))) m_timer.interval(params,"interval",20,1000,true); - m_len = params.getIntValue("length",m_len); - m_sharing = params.getBoolValue("sharing",m_sharing); + m_len = params.getIntValue(YSTRING("length"),m_len); + m_sharing = params.getBoolValue(YSTRING("sharing"),m_sharing); if (m_len > 1024) m_len = 1024; if (setSeq || !m_seq) - m_seq = params.getIntValue("sequence",m_seq); - const String* lbl = params.getParam("address"); + m_seq = params.getIntValue(YSTRING("sequence"),m_seq); + const String* lbl = params.getParam(YSTRING("address")); if (!TelEngine::null(lbl)) { // TYPE,opc,dpc,sls,spare SS7PointCode::Type t = SS7PointCode::Other;