comparison OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp @ 4463:522e13a60cfc

"LocalAet" in "DicomModalities" to overwrite global "DicomAet" for SCU on a per-modality basis
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Jan 2021 17:36:23 +0100
parents f4dbdb2dcba6
children c494ee5d0101
comparison
equal deleted inserted replaced
4462:da460bef88f8 4463:522e13a60cfc
263 { 263 {
264 throw OrthancException(ErrorCode_BadSequenceOfCalls, 264 throw OrthancException(ErrorCode_BadSequenceOfCalls,
265 "No presentation context was proposed"); 265 "No presentation context was proposed");
266 } 266 }
267 267
268 std::string localAet = parameters.GetLocalApplicationEntityTitle();
269 if (parameters.GetRemoteModality().HasLocalAet())
270 {
271 localAet = parameters.GetRemoteModality().GetLocalAet();
272 }
273
268 CLOG(INFO, DICOM) << "Opening a DICOM SCU connection " 274 CLOG(INFO, DICOM) << "Opening a DICOM SCU connection "
269 << (parameters.GetRemoteModality().IsDicomTlsEnabled() ? "using DICOM TLS" : "without DICOM TLS") 275 << (parameters.GetRemoteModality().IsDicomTlsEnabled() ? "using DICOM TLS" : "without DICOM TLS")
270 << " from AET \"" << parameters.GetLocalApplicationEntityTitle() 276 << " from AET \"" << localAet
271 << "\" to AET \"" << parameters.GetRemoteModality().GetApplicationEntityTitle() 277 << "\" to AET \"" << parameters.GetRemoteModality().GetApplicationEntityTitle()
272 << "\" on host " << parameters.GetRemoteModality().GetHost() 278 << "\" on host " << parameters.GetRemoteModality().GetHost()
273 << ":" << parameters.GetRemoteModality().GetPortNumber() 279 << ":" << parameters.GetRemoteModality().GetPortNumber()
274 << " (manufacturer: " << EnumerationToString(parameters.GetRemoteModality().GetManufacturer()) << ")"; 280 << " (manufacturer: " << EnumerationToString(parameters.GetRemoteModality().GetManufacturer()) << ")";
275 281
296 } 302 }
297 #endif 303 #endif
298 304
299 // Set this application's title and the called application's title in the params 305 // Set this application's title and the called application's title in the params
300 CheckConnecting(parameters, ASC_setAPTitles( 306 CheckConnecting(parameters, ASC_setAPTitles(
301 params_, parameters.GetLocalApplicationEntityTitle().c_str(), 307 params_, localAet.c_str(),
302 parameters.GetRemoteModality().GetApplicationEntityTitle().c_str(), NULL)); 308 parameters.GetRemoteModality().GetApplicationEntityTitle().c_str(), NULL));
303 309
304 // Set the network addresses of the local and remote entities 310 // Set the network addresses of the local and remote entities
305 char localHost[HOST_NAME_MAX]; 311 char localHost[HOST_NAME_MAX];
306 gethostname(localHost, HOST_NAME_MAX - 1); 312 gethostname(localHost, HOST_NAME_MAX - 1);