Allow separate stacks registration through services operation
[anna.git] / example / diameter / launcher / Launcher.cpp
index e52b5d2..0fe55a0 100644 (file)
@@ -189,7 +189,8 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool bindRes
   // We will register a scope per stack id registered. The counters will be dynamically registered at count method.
   anna::diameter::comm::ApplicationMessageOamModule & appMsgOamModule = anna::diameter::comm::ApplicationMessageOamModule::instantiate();
   appMsgOamModule.enableCounters(); // this special module is disabled by default (the only)
-  static int scope_id = 3;
+  static int scope_id = 3 + appMsgOamModule.scopes();
+
   unsigned int id_value;
   std::string codecEngineName;
 
@@ -1171,7 +1172,7 @@ bool Launcher::eventOperation(const std::string &operation, std::string &respons
     outfile.write(xmlString.c_str(), xmlString.size());
     outfile.close();
   } else if((opType == "hide") || (opType == "show") || (opType == "hidden") || (opType == "shown")) {
-    return eop.visibility(opt_response, opType, param1, (param2 != "") ? atoi(param2.c_str()) : -1);
+    result = eop.visibility(opt_response, opType, param1, (param2 != "") ? atoi(param2.c_str()) : -1);
 
   } else if((opType == "sendxml2e") || (opType == "sendhex2e")) {
     anna::diameter::comm::Message *msg;
@@ -1675,12 +1676,7 @@ bool Launcher::eventOperation(const std::string &operation, std::string &respons
       if (numParams > 1)
         throw anna::RuntimeException("Wrong body content format on HTTP Request. Check 'HELP.md' for more information.", ANNA_FILE_LOCATION);
 
-      if (testManager.clearPool()) {
-        opt_response = "all the programmed test cases have been dropped";
-      }
-      else {
-        opt_response = "there are not programmed test cases to be removed";
-      }
+      result = testManager.clearPool(opt_response);
     }
     else if(param1 == "junit") {
       response = testManager.junitAsXMLString();