From: Eduardo Ramos Testillano Date: Mon, 17 Feb 2014 20:46:55 +0000 (-0800) Subject: Virtual bindingClientSession for diameter::comm::Engine, in order to have control... X-Git-Tag: REFACTORING_TESTING_LIBRARY~267 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=858b6e049e795cc50a362e8e41dfaefe7106fd9f;p=anna.git Virtual bindingClientSession for diameter::comm::Engine, in order to have control before diameter binding procedure --- diff --git a/include/anna/diameter.comm/Engine.hpp b/include/anna/diameter.comm/Engine.hpp index 2d36b6f..1d9b77e 100644 --- a/include/anna/diameter.comm/Engine.hpp +++ b/include/anna/diameter.comm/Engine.hpp @@ -590,6 +590,12 @@ public: */ virtual void availabilityRecovered(Server *) const throw() {;} + /** + When a subyacent client session is going to be bound, this method is invoked before. + Default implementation do nothing. + */ + virtual void bindingClientSession(const ClientSession *) const throw() {;} + /** * Class user should implement this method in order to define Disconnect-Peer-Answer for last received DPR. * Origin-Host and Origin-Realm are configured at comm::Engine with hostname and FQDN (Fully Qualified Domain Name). diff --git a/source/diameter.comm/ClientSession.cpp b/source/diameter.comm/ClientSession.cpp index 73d097a..71be8a3 100644 --- a/source/diameter.comm/ClientSession.cpp +++ b/source/diameter.comm/ClientSession.cpp @@ -140,6 +140,10 @@ void ClientSession::bind() throw(anna::RuntimeException) { return; } + // Some operations could be done before sending CER, for example non-standard Origin-Host manipulation for + // Tekelec PCRF + a_engine->bindingClientSession(this); + // OAM Lo comento, porque no se contabilizan los reintentos y por lo tanto no son muy Ăștiles. // OamModule &oamModule = OamModule::instantiate(); // oamModule.count(a_server->isAvailable() ? OamModule::Counter::TCPConnectOK:OamModule::Counter::TCPConnectNOK);