}
catch(anna::RuntimeException &ex) {
ex.trace();
- LOGINFORMATION(anna::Logger::information("XXXXXXXXXXXX EXCEPCION PENDIENTE DE CATCHEAR ABAJO !!! XXXXXXXXXXXXXXXXX", ANNA_FILE_LOCATION));
+ LOGINFORMATION(anna::Logger::information("doPOST exception: TODO control in inner method. Check traces", ANNA_FILE_LOCATION));
}
}
// Flow operations
else if ((opType == "/sendmsg2e")||(opType == "/sendmsg2c")) {
- auto it = j.find("diameterJson");
- if (it != j.end())
+ auto itJ = j.find("diameterJson");
+ if (itJ != j.end()) {
if (opType == "/sendmsg2e")
- result = eop.sendmsg2e(response, it->dump(4)); // get the object as string (always indentation = 4)
+ result = eop.sendmsg_hex_2e(response, itJ->dump(4), true); // get the object as string (always indentation = 4)
else
- result = eop.sendmsg2c(response, it->dump(4)); // get the object as string (always indentation = 4)
+ result = eop.sendmsg_hex_2c(response, itJ->dump(4), true); // get the object as string (always indentation = 4)
+ }
else
response += "missing 'diameterJson' object field";
}
+ else if ((opType == "/sendhex2e")||(opType == "/sendhex2c")) {
+ auto itH = j.find("diameterHex");
+ if (itH != j.end())
+ if (opType == "/sendhex2e")
+ result = eop.sendmsg_hex_2e(response, *itH, false);
+ else
+ result = eop.sendmsg_hex_2c(response, *itH, false);
+ else
+ response += "missing 'diameterHex' string field";
+ }
else if ((opType == "/answermsg2e")||(opType == "/answermsg2c")) {
auto itJ = j.find("diameterJson");
auto itA = j.find("action");
bool hasA = (itA != j.end());
if (hasJ != hasA) { // XOR
-
- if (opType == "/answermsg2e") {
- if (hasJ)
- result = eop.answermsg2e(response, itJ->dump(4)); // get the object as string (always indentation = 4)
- else
- result = eop.answermsg2e_action(response, *itA);
- }
- else {
- if (hasJ)
- result = eop.answermsg2c(response, itJ->dump(4)); // get the object as string (always indentation = 4)
- else
- result = eop.answermsg2c_action(response, *itA);
+ std::string action;
+ if (hasA) {
+ action = *itA;
+ if (action == "") action = "list"; // default if missing
}
+
+ if (opType == "/answermsg2e")
+ result = eop.answermsg_action_2e(response, (hasJ ? itJ->dump(4) : action), hasJ); // itJ: get the object as string (always indentation = 4)
+ else
+ result = eop.answermsg_action_2c(response, (hasJ ? itJ->dump(4) : action), hasJ); // itJ: get the object as string (always indentation = 4)
}
else
response += "missing 'diameterJson' object or 'action' string field (only one accepted)";
}
- else if ((opType == "/sendhex2e")||(opType == "/sendhex2c")) {
- auto it = j.find("diameterHex");
- if (it != j.end())
- if (opType == "/sendhex2e")
- result = eop.sendhex2e(response, *it);
- else
- result = eop.sendhex2c(response, *it);
- else
- response += "missing 'diameterHex' string field";
- }
// FSM testing
// test_id__<command>