Gives application control over event DPA received for both client and entity
[anna.git] / source / diameter.comm / ClientSession.cpp
index d521b60..8adb77b 100644 (file)
@@ -482,6 +482,11 @@ void ClientSession::eventUnknownResponse(const anna::DataBlock& response) throw(
   a_parent->eventUnknownResponse(this, response);
 }
 
+void ClientSession::eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) {
+  // Inform father server:
+  a_parent->eventDPA(this, response);
+}
+
 
 
 //------------------------------------------------------------------------------------------
@@ -679,7 +684,6 @@ throw(anna::RuntimeException) {
   requestMessage->setRequestServerSessionKey(response->getRequest()->getRequestServerSessionKey()); // -1 means unkown/unset
 
   if(cid != helpers::base::COMMANDID__Disconnect_Peer_Answer) {
-    // don't progress DPA: unbind is automatically performed and not open to any application decision
     try {
       response->setMessage(&db);
       // Restore received datablock
@@ -698,6 +702,11 @@ throw(anna::RuntimeException) {
       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);
+  }
 
   response_erase(response);