comparison OrthancServer/main.cpp @ 1806:cd213ebcaefd

UnknownSopClassAccepted option
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 23 Nov 2015 15:24:39 +0100
parents 138664eb59de
children 91216c42c6e5
comparison
equal deleted inserted replaced
1804:bdef349f742c 1806:cd213ebcaefd
188 } 188 }
189 } 189 }
190 190
191 virtual bool IsAllowedTransferSyntax(const std::string& remoteIp, 191 virtual bool IsAllowedTransferSyntax(const std::string& remoteIp,
192 const std::string& remoteAet, 192 const std::string& remoteAet,
193 const std::string& /*calledAet*/, 193 const std::string& calledAet,
194 TransferSyntax syntax) 194 TransferSyntax syntax)
195 { 195 {
196 std::string configuration; 196 std::string configuration;
197 197
198 switch (syntax) 198 switch (syntax)
237 if (locker.GetLua().IsExistingFunction(lua.c_str())) 237 if (locker.GetLua().IsExistingFunction(lua.c_str()))
238 { 238 {
239 LuaFunctionCall call(locker.GetLua(), lua.c_str()); 239 LuaFunctionCall call(locker.GetLua(), lua.c_str());
240 call.PushString(remoteAet); 240 call.PushString(remoteAet);
241 call.PushString(remoteIp); 241 call.PushString(remoteIp);
242 call.PushString(calledAet);
243 return call.ExecutePredicate();
244 }
245 }
246
247 return Configuration::GetGlobalBoolParameter(configuration, true);
248 }
249
250
251 virtual bool IsUnknownSopClassAccepted(const std::string& remoteIp,
252 const std::string& remoteAet,
253 const std::string& calledAet)
254 {
255 static const char* configuration = "UnknownSopClassAccepted";
256
257 {
258 std::string lua = "Is" + std::string(configuration);
259
260 LuaScripting::Locker locker(context_.GetLua());
261
262 if (locker.GetLua().IsExistingFunction(lua.c_str()))
263 {
264 LuaFunctionCall call(locker.GetLua(), lua.c_str());
265 call.PushString(remoteAet);
266 call.PushString(remoteIp);
267 call.PushString(calledAet);
242 return call.ExecutePredicate(); 268 return call.ExecutePredicate();
243 } 269 }
244 } 270 }
245 271
246 return Configuration::GetGlobalBoolParameter(configuration, true); 272 return Configuration::GetGlobalBoolParameter(configuration, true);