X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdiameter.comm%2FClientSession.cpp;h=c624155dd37ee0920a6416ece7bd9de790c80216;hb=64d7c531cdf5f4bca4fa2d8c9736de98247dfe13;hp=87c9cc12f1e49165c586094ef9deef2e3b48f000;hpb=028006fc5ee34967fcfffff24a2b1c8b410c26c3;p=anna.git diff --git a/source/diameter.comm/ClientSession.cpp b/source/diameter.comm/ClientSession.cpp index 87c9cc1..c624155 100644 --- a/source/diameter.comm/ClientSession.cpp +++ b/source/diameter.comm/ClientSession.cpp @@ -81,7 +81,7 @@ int ClientSession::getPort() const throw() { void ClientSession::setState(State::_v state) throw() { Session::setState(state); // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); } void ClientSession::bind() throw(anna::RuntimeException) { @@ -554,7 +554,7 @@ throw(anna::RuntimeException) { try { // application message counters - ApplicationMessageOamModule::instantiate().count(cid.first, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Request_Received_AsClient); + ApplicationMessageOamModule::instantiate().count(cid.first, -1 /* no result code */, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Request_Received_AsClient); eventRequest(db); } catch(anna::RuntimeException& ex) { @@ -569,12 +569,13 @@ throw(anna::RuntimeException) { ///////////////////////////// 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 @@ -600,7 +601,7 @@ throw(anna::RuntimeException) { setState(State::Bound); //activateTimer(); // Ya se invoca al inicio de este metodo ::receive // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); //startClock(); } } @@ -658,7 +659,7 @@ throw(anna::RuntimeException) { oamModule.activateAlarm(OamModule::Alarm::AnswerReceivedOnClientSessionUnknown); // application message counters - ApplicationMessageOamModule::instantiate().count(cid.first, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Answer_UnknownReceived_AsClient); + ApplicationMessageOamModule::instantiate().count(cid.first, resultCode, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Answer_UnknownReceived_AsClient); eventUnknownResponse(db); string msg(asString()); @@ -708,7 +709,7 @@ throw(anna::RuntimeException) { // application message counters if(cid != helpers::base::COMMANDID__Capabilities_Exchange_Answer) - ApplicationMessageOamModule::instantiate().count(cid.first, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Answer_Received_AsClient); + ApplicationMessageOamModule::instantiate().count(cid.first, resultCode, anna::diameter::codec::functions::getApplicationId(db), ApplicationMessageOamModule::Counter::Answer_Received_AsClient); eventResponse(*response); } catch(anna::RuntimeException& ex) { @@ -731,10 +732,8 @@ throw(anna::RuntimeException) { void ClientSession::finalize() throw() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "finalize", ANNA_FILE_LOCATION)); Session::finalize(); - // Check deprecated entity: - const Entity *entity = getParent() /* server */ ->getParent() /* entity */; // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); // OAM const Server *server = getParent(); bool multipleConnections = (server->getMaxClientSessions() > 1); @@ -765,7 +764,7 @@ void ClientSession::recover() throw() { } // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); // OAM const Server *server = getParent(); bool multipleConnections = (server->getMaxClientSessions() > 1); @@ -981,7 +980,7 @@ void ClientSession::countSendings(const diameter::CommandId & cid, unsigned int else if(cid == helpers::base::COMMANDID__Disconnect_Peer_Answer) oamModule.count(OamModule::Counter::DPASentOK); // Application messages: else { - appMsgOamModule.count(cid.first, aid, isRequest ? ApplicationMessageOamModule::Counter::Request_SentOK_AsClient : ApplicationMessageOamModule::Counter::Answer_SentOK_AsClient); + appMsgOamModule.count(cid.first, -1 /* no result code */, aid, isRequest ? ApplicationMessageOamModule::Counter::Request_SentOK_AsClient : ApplicationMessageOamModule::Counter::Answer_SentOK_AsClient); } } else { // Main counters: @@ -995,7 +994,7 @@ void ClientSession::countSendings(const diameter::CommandId & cid, unsigned int else if(cid == helpers::base::COMMANDID__Disconnect_Peer_Answer) oamModule.count(OamModule::Counter::DPASentNOK); // Application messages: else { - appMsgOamModule.count(cid.first, aid, isRequest ? ApplicationMessageOamModule::Counter::Request_SentNOK_AsClient : ApplicationMessageOamModule::Counter::Answer_SentNOK_AsClient); + appMsgOamModule.count(cid.first, -1 /* no result code */, aid, isRequest ? ApplicationMessageOamModule::Counter::Request_SentNOK_AsClient : ApplicationMessageOamModule::Counter::Answer_SentNOK_AsClient); } } }