diff OrthancServer/main.cpp @ 1799:4f01c9d73f02 worklists

calledAet made available to all the handlers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Nov 2015 12:57:14 +0100
parents 23722a191e4e
children 30e97a1f4093
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Fri Nov 20 12:00:34 2015 +0100
+++ b/OrthancServer/main.cpp	Fri Nov 20 12:57:14 2015 +0100
@@ -110,8 +110,11 @@
   virtual bool Handle(DicomFindAnswers& answers,
                       ParsedDicomFile& query,
                       const std::string& remoteIp,
-                      const std::string& remoteAet)
+                      const std::string& remoteAet,
+                      const std::string& calledAet)
   {
+    LOG(WARNING) << "Worklist Find query from " << remoteAet << " to " << calledAet;
+
     bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false);
     HierarchicalMatcher matcher(query, caseSensitivePN);
 
@@ -227,14 +230,16 @@
   {
   }
 
-  virtual bool IsAllowedConnection(const std::string& /*callingIp*/,
-                                   const std::string& /*callingAet*/)
+  virtual bool IsAllowedConnection(const std::string& /*remoteIp*/,
+                                   const std::string& /*remoteAet*/,
+                                   const std::string& /*calledAet*/)
   {
     return true;
   }
 
-  virtual bool IsAllowedRequest(const std::string& /*callingIp*/,
-                                const std::string& callingAet,
+  virtual bool IsAllowedRequest(const std::string& /*remoteIp*/,
+                                const std::string& remoteAet,
+                                const std::string& /*calledAet*/,
                                 DicomRequestType type)
   {
     if (type == DicomRequestType_Store)
@@ -243,9 +248,9 @@
       return true;
     }
 
-    if (!Configuration::IsKnownAETitle(callingAet))
+    if (!Configuration::IsKnownAETitle(remoteAet))
     {
-      LOG(ERROR) << "Unknown remote DICOM modality AET: \"" << callingAet << "\"";
+      LOG(ERROR) << "Unknown remote DICOM modality AET: \"" << remoteAet << "\"";
       return false;
     }
     else
@@ -254,8 +259,9 @@
     }
   }
 
-  virtual bool IsAllowedTransferSyntax(const std::string& callingIp,
-                                       const std::string& callingAet,
+  virtual bool IsAllowedTransferSyntax(const std::string& remoteIp,
+                                       const std::string& remoteAet,
+                                       const std::string& /*calledAet*/,
                                        TransferSyntax syntax)
   {
     std::string configuration;
@@ -302,8 +308,8 @@
       if (locker.GetLua().IsExistingFunction(lua.c_str()))
       {
         LuaFunctionCall call(locker.GetLua(), lua.c_str());
-        call.PushString(callingAet);
-        call.PushString(callingIp);
+        call.PushString(remoteAet);
+        call.PushString(remoteIp);
         return call.ExecutePredicate();
       }
     }