Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1798:e92cd8841a5f | 1799:4f01c9d73f02 |
---|---|
108 } | 108 } |
109 | 109 |
110 virtual bool Handle(DicomFindAnswers& answers, | 110 virtual bool Handle(DicomFindAnswers& answers, |
111 ParsedDicomFile& query, | 111 ParsedDicomFile& query, |
112 const std::string& remoteIp, | 112 const std::string& remoteIp, |
113 const std::string& remoteAet) | 113 const std::string& remoteAet, |
114 { | 114 const std::string& calledAet) |
115 { | |
116 LOG(WARNING) << "Worklist Find query from " << remoteAet << " to " << calledAet; | |
117 | |
115 bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); | 118 bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); |
116 HierarchicalMatcher matcher(query, caseSensitivePN); | 119 HierarchicalMatcher matcher(query, caseSensitivePN); |
117 | 120 |
118 boost::filesystem::path source("/tmp/worklists/db/ORTHANCTEST"); | 121 boost::filesystem::path source("/tmp/worklists/db/ORTHANCTEST"); |
119 boost::filesystem::directory_iterator end; | 122 boost::filesystem::directory_iterator end; |
225 public: | 228 public: |
226 OrthancApplicationEntityFilter(ServerContext& context) : context_(context) | 229 OrthancApplicationEntityFilter(ServerContext& context) : context_(context) |
227 { | 230 { |
228 } | 231 } |
229 | 232 |
230 virtual bool IsAllowedConnection(const std::string& /*callingIp*/, | 233 virtual bool IsAllowedConnection(const std::string& /*remoteIp*/, |
231 const std::string& /*callingAet*/) | 234 const std::string& /*remoteAet*/, |
235 const std::string& /*calledAet*/) | |
232 { | 236 { |
233 return true; | 237 return true; |
234 } | 238 } |
235 | 239 |
236 virtual bool IsAllowedRequest(const std::string& /*callingIp*/, | 240 virtual bool IsAllowedRequest(const std::string& /*remoteIp*/, |
237 const std::string& callingAet, | 241 const std::string& remoteAet, |
242 const std::string& /*calledAet*/, | |
238 DicomRequestType type) | 243 DicomRequestType type) |
239 { | 244 { |
240 if (type == DicomRequestType_Store) | 245 if (type == DicomRequestType_Store) |
241 { | 246 { |
242 // Incoming store requests are always accepted, even from unknown AET | 247 // Incoming store requests are always accepted, even from unknown AET |
243 return true; | 248 return true; |
244 } | 249 } |
245 | 250 |
246 if (!Configuration::IsKnownAETitle(callingAet)) | 251 if (!Configuration::IsKnownAETitle(remoteAet)) |
247 { | 252 { |
248 LOG(ERROR) << "Unknown remote DICOM modality AET: \"" << callingAet << "\""; | 253 LOG(ERROR) << "Unknown remote DICOM modality AET: \"" << remoteAet << "\""; |
249 return false; | 254 return false; |
250 } | 255 } |
251 else | 256 else |
252 { | 257 { |
253 return true; | 258 return true; |
254 } | 259 } |
255 } | 260 } |
256 | 261 |
257 virtual bool IsAllowedTransferSyntax(const std::string& callingIp, | 262 virtual bool IsAllowedTransferSyntax(const std::string& remoteIp, |
258 const std::string& callingAet, | 263 const std::string& remoteAet, |
264 const std::string& /*calledAet*/, | |
259 TransferSyntax syntax) | 265 TransferSyntax syntax) |
260 { | 266 { |
261 std::string configuration; | 267 std::string configuration; |
262 | 268 |
263 switch (syntax) | 269 switch (syntax) |
300 LuaScripting::Locker locker(context_.GetLua()); | 306 LuaScripting::Locker locker(context_.GetLua()); |
301 | 307 |
302 if (locker.GetLua().IsExistingFunction(lua.c_str())) | 308 if (locker.GetLua().IsExistingFunction(lua.c_str())) |
303 { | 309 { |
304 LuaFunctionCall call(locker.GetLua(), lua.c_str()); | 310 LuaFunctionCall call(locker.GetLua(), lua.c_str()); |
305 call.PushString(callingAet); | 311 call.PushString(remoteAet); |
306 call.PushString(callingIp); | 312 call.PushString(remoteIp); |
307 return call.ExecutePredicate(); | 313 return call.ExecutePredicate(); |
308 } | 314 } |
309 } | 315 } |
310 | 316 |
311 return Configuration::GetGlobalBoolParameter(configuration, true); | 317 return Configuration::GetGlobalBoolParameter(configuration, true); |