// Counters record procedure:
const char *varname = "cntRecordPeriod";
- anna::Millisecond cntRecordPeriod = (cl.exists(varname)) ? checkTimeMeasure(varname, cl.getValue(varname)) : (anna::Millisecond)300000;
+ anna::Millisecond cntRecordPeriod;
+ try {
+ cntRecordPeriod = (cl.exists(varname)) ? checkTimeMeasure(varname, cl.getValue(varname)) : (anna::Millisecond)300000;
+ }
+ catch(anna::RuntimeException &ex) {
+ if (cntRecordPeriod != 0) throw ex;
+ }
+
if(cntRecordPeriod != 0) {
a_counterRecorderClock = new MyCounterRecorderClock("Counters record procedure clock", cntRecordPeriod); // clock
std::string cntDir = ".";
if [ "$option" = "s" ]
then
cd $DPATH
- ln -s services_example services
+ #ln -s services_example services
mv run.sh .run-one.sh
mv run_all.sh run.sh
mv operation.sh .operation-one.sh
# FUNCTIONS #
#############
_exit () {
- echo
- echo $1
- echo
+ echo -e "\n$1\n"
exit 1
}
_exit
fi
-[ ! -d services ] && _exit "Missing services configuration (expecting '$PWD/services' directory) !"
+[ ! -d services ] && _exit "Missing services configuration (expecting '$PWD/services' directory).\nTake a look to 'services_example' and './dynlibs' scenaries stuff to complete your services.\n\nFor example:\n ln -s services_example services\n cp dynlibs/gx/00001/services/* services\n Edit CER files and 'services.msk' there, to fit your needs."
calculate_deployment_layout
TESTCASE_DIR=$(readlink -f dynlibs/libanna_launcher_procedure_default_shared.so | xargs dirname)
DYNAMIC_SUFFIX_FILE=$TESTCASE_DIR/dynamic.suffix
- [ ! -f $DYNAMIC_SUFFIX_FILE ] && _exit "Missing '$DYNAMIC_SUFFIX_FILE' file.\nUse 'dynlibs/select.sh' to change the dynamic procedure and restart the ADML instances."
+ [ ! -f $DYNAMIC_SUFFIX_FILE ] && _exit "Missing '$DYNAMIC_SUFFIX_FILE' file.\nUse 'dynlibs/select.sh' to change the dynamic procedure and very important: RESTART the ADML instances."
dynamic_suffix=( $(grep -v ^# $DYNAMIC_SUFFIX_FILE) )
# Multiple scenarios:
ln -sf $option $dynamicProcedureLibName
[ $? -ne 0 ] && { rm -f $dynamicProcedureLibName ; echo -e "\nInvalid file (must be a dynamic procedure library) !\n" ; exit 1 ; }
echo
-echo "Library enabled"
+echo "Library enabled."
+echo
+echo
+echo "IMPORTANT: remember to Re-Start the affected ADML instances:"
+echo
+echo " pkill -9 ADML ; ./run.sh"
echo
setActiveCounterScope(scopeId);
// Build event id: <message code>_<result code>
- std::string eventId = anna::functions::asString("%d%d", messageCode, resultCode);
+ std::string eventId = anna::functions::asString("%d_%d", messageCode, resultCode);
std::map<std::string /* event id */, int /* base offset */>::const_iterator eventMap_it = a_eventMap.find(eventId);
- int baseOffset = eventMap_it->second;
+ int baseOffset;
if (eventMap_it == a_eventMap.end()) {
int capacity = anna::oam::CounterScope::MaxCounter / getCounterTypes();
registerCounter(baseOffset + offset, counterName, baseOffset + offset);
//}
}
+ else {
+ baseOffset = eventMap_it->second;
+ }
// Count
Module::count(baseOffset + type, amount);
/////////////////////////////
bool doUnbind = false;
bool immediateUnbind = false;
- int resultCode = 0;
+ int resultCode = -1;
try {
resultCode = helpers::base::functions::getResultCode(db);
} catch(anna::RuntimeException& ex) {
- ex.trace();
+ // Not always mandatory ...
+ //ex.trace();
}
// Received CEA
if (it != a_origin_hosts.end())
return it->second;
- LOGWARNING(
- std::string msg = "Unknown origin host node with name '"; msg += name; msg += "'";
- anna::Logger::warning(msg, ANNA_FILE_LOCATION);
- );
-
return NULL;
}
if (it != a_appid_codec_engines.end())
return it->second;
- return NULL;
+ // Just in case:
+ return getMonoStackCodecEngine();
}
void EngineManager::registerCodecEngine(const ApplicationId &appid, Engine* engine) throw() {
// Session-Id if exists:
const Avp *reqSessionId = request.getAvp(helpers::base::AVPID__Session_Id, 1, anna::Exception::Mode::Ignore);
+ LOGDEBUG(anna::Logger::debug("Check answer message AVPs Session-Id, Origin-Host and Origin-Realm => replace them if missing, with request session-id & node configuration:", ANNA_FILE_LOCATION));
+
if(reqSessionId)
if(!getAvp(helpers::base::AVPID__Session_Id, 1, anna::Exception::Mode::Ignore))
addAvp(helpers::base::AVPID__Session_Id)->getUTF8String()->setValue(reqSessionId->getUTF8String()->getValue());
engine->releaseMessage(message);
}
else {
- LOGWARNING(anna::Logger::warning("Cannot release a message for which i don't know the codec engine (check the registered stack id regarding the message application id) !", ANNA_FILE_LOCATION));
+ LOGWARNING(anna::Logger::warning("Cannot release a message for which I don't know the codec engine (check the registered stack id regarding the message application id) !", ANNA_FILE_LOCATION));
return;
}
}