diff OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp @ 4281:d2f79a475b51

debug log for DCMTK SCU
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Nov 2020 13:48:42 +0100
parents bf7b9edf6b81
children 65086904ec45
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp	Wed Nov 04 07:56:22 2020 +0100
+++ b/OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp	Wed Nov 04 13:48:42 2020 +0100
@@ -93,6 +93,17 @@
   {
     try
     {
+      if (cond.bad() &&
+          cond == DUL_ASSOCIATIONREJECTED)
+      {
+        T_ASC_RejectParameters rej;
+        ASC_getRejectParameters(params_, &rej);
+
+        OFString str;
+        CLOG(TRACE, DICOM) << "Association Rejected:" << std::endl
+                           << ASC_printRejectParameters(str, &rej);
+      }
+      
       CheckCondition(cond, parameters, "connecting");
     }
     catch (OrthancException&)
@@ -307,10 +318,25 @@
       presentationContextId += 2;
     }
 
+    {
+      OFString str;
+      CLOG(TRACE, DICOM) << "Request Parameters:" << std::endl
+                         << ASC_dumpParameters(str, params_, ASC_ASSOC_RQ);
+    }
+
     // Do the association
     CheckConnecting(parameters, ASC_requestAssociation(net_, params_, &assoc_));
     isOpen_ = true;
 
+    {
+      OFString str;
+      CLOG(TRACE, DICOM) << "Connection Parameters: "
+                         << ASC_dumpConnectionParameters(str, assoc_);
+      CLOG(TRACE, DICOM) << "Association Parameters Negotiated:" << std::endl
+                         << ASC_dumpParameters(str, params_, ASC_ASSOC_AC);
+    }
+
+
     // Inspect the accepted transfer syntaxes
     LST_HEAD **l = &params_->DULparams.acceptedPresentationContext;
     if (*l != NULL)