}
-void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false) {
- if(codec::functions::getCommandId(cer) != helpers::base::COMMANDID__Capabilities_Exchange_Request) {
- throw anna::RuntimeException("The message provided as 'CER' is not a Capabilities-Exchange-Request", ANNA_FILE_LOCATION);
- }
-
- if(codec::functions::getCommandId(dwr) != helpers::base::COMMANDID__Device_Watchdog_Request) {
- throw anna::RuntimeException("The message provided as 'DWR' is not a Device-Watchdog-Request", ANNA_FILE_LOCATION);
- }
-
- // La verificacion ya se hace implicitamente antes
- // if ((a_cer.isEmpty()) || (a_dwr.isEmpty())) {
- // LOGDEBUG (anna::Logger::debug ("Must define valid CER and DWR messages before use bind !", ANNA_FILE_LOCATION));
- // return;
- // }
- a_cer.setBody(cer);
- a_dwr.setBody(dwr);
-}
-
-
const Response* ClientSession::send(const Message* message) noexcept(false) {
LOGMETHOD(anna::TraceMethod traceMethod(a_className, "send", ANNA_FILE_LOCATION));
a_parent->eventRequestRetransmission(this, request);
}
-void ClientSession::eventResponse(const Response& response) noexcept(false) {
+void ClientSession::eventResponse(const Response& response, const anna::diameter::comm::OriginHost *myNode) noexcept(false) {
// Inform father server:
- a_parent->eventResponse(response);
+ a_parent->eventResponse(response, myNode);
}
-void ClientSession::eventRequest(const anna::DataBlock &request) noexcept(false) {
+void ClientSession::eventRequest(const anna::DataBlock &request, const anna::diameter::comm::OriginHost *myNode) noexcept(false) {
// Inform father server:
- a_parent->eventRequest(this, request);
+ a_parent->eventRequest(this, request, myNode);
}
-void ClientSession::eventUnknownResponse(const anna::DataBlock& response) noexcept(false) {
+void ClientSession::eventUnknownResponse(const anna::DataBlock& response, const anna::diameter::comm::OriginHost *myNode) noexcept(false) {
// Inform father server:
- a_parent->eventUnknownResponse(this, response);
+ a_parent->eventUnknownResponse(this, response, myNode);
}
-void ClientSession::eventDPA(const anna::DataBlock& response) noexcept(false) {
+void ClientSession::eventDPA(const anna::DataBlock& response, const anna::diameter::comm::OriginHost *myNode) noexcept(false) {
// Inform father server:
- a_parent->eventDPA(this, response);
+ a_parent->eventDPA(this, response, myNode);
}
oamModule.count(OamModule::Counter::DPRReceived);
if(a_state == State::Bound) {
- a_dpr.setBody(db);
setState(State::Disconnecting);
LOGWARNING(anna::Logger::warning("DPR has been received from peer (diameter server)", ANNA_FILE_LOCATION));
- if(getOTARequests() == 0) sendDPA();
+ if(getOTARequests() == 0) sendDPA(a_engine, db);
return; // DPR won't be informed because virtual readDPA is available for this
}
// application message counters
ApplicationMessageOamModule::instantiate().count(cid.first, -1 /* no result code */, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Request_Received_AsClient);
- eventRequest(db);
+ eventRequest(db, nullptr /* client classes have a valid engine usage to distinguish, and get origin host from */);
} catch(anna::RuntimeException& ex) {
ex.trace();
}
// application message counters
ApplicationMessageOamModule::instantiate().count(cid.first, resultCode, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Answer_UnknownReceived_AsClient);
- eventUnknownResponse(db);
+ eventUnknownResponse(db, nullptr /* client classes have a valid engine usage to distinguish, and get origin host from */);
string msg(asString());
msg += anna::functions::asString(" | Response received from entity, for non registered context (HopByHop: %u)", hopByHop);
throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
if(cid != helpers::base::COMMANDID__Capabilities_Exchange_Answer)
ApplicationMessageOamModule::instantiate().count(cid.first, resultCode, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Answer_Received_AsClient);
- eventResponse(*response);
+ eventResponse(*response, nullptr /* client classes have a valid engine usage to distinguish, and get origin host from */);
} catch(anna::RuntimeException& ex) {
ex.trace();
}
else { // DPA
// unbind is automatically performed, anyway we can inform to the application just in case some additional
// procedure could be issued:
- eventDPA(db);
+ eventDPA(db, nullptr /* client classes have a valid engine usage to distinguish, and get origin host from */);
}
response_erase(response);