[BitBucket date: 2018-06-10.23:29:45]
Hi all,
I am developing (trying) a plugin. I need to check all the move request(find too) and, depending the modality that asks, index new studies from other dicom servers.
When I create a move request using dcmtk, i get this:
I:
E: Move Request Failed: 0006:020e DIMSE Failed to send message
E: 0006:031d TCP I/O Error (Connection reset by peer) occurred in routine: writeDataPDU
E: Move SCU Failed: 0006:020e DIMSE Failed to send message
E: 0006:031d TCP I/O Error (Connection reset by peer) occurred in routine: writeDataPDU
I: Aborting Association
F: Association Abort Failed: 0006:031d TCP I/O Error (Broken pipe) occurred in routine: sendAbortTCP
If I don't use the plugin this does not happen
My log file in verbose mode:
W0609 02:38:25.673379 main.cpp:683] Orthanc has started
W0609 02:38:25.673460 ServerScheduler.cpp:135] The server scheduler has started
E0609 02:39:02.907250 RunnableWorkersPool.cpp:74] Exception while handling some runnable object: Error encountered within the plugin engine
The server seems to works fine. .
I started to code it using the code of sample plugin (this one https://hg.orthanc-server.com/orthanc/file/62cc762d1fb0aec4fb06c986bbb30a90a3ab03b1/Plugins/Samples/Basic/Plugin.c)
At the moment my code is this (simply to check if it executes the callback function):
```
#!c
#include "orthanc/OrthancCPlugin.h"
#include <string.h>
#include <stdio.h>
static OrthancPluginContext* context = NULL;
static OrthancPluginGetMoveSize moveSize = NULL;
static OrthancPluginApplyMove applyMove = NULL;
static OrthancPluginFreeMove freeMove = NULL;
OrthancPluginMoveCallback * OnMoveCallback (OrthancPluginMoveCallback resourceType, const char *patientId, const char *accessionNumber, const char *studyInstanceUid, const char *seriesInstanceUid, const char *sopInstanceUid, const char *originatorAet, const char *sourceAet, const char *targetAet, uint16_t originatorId)
{
OrthancPluginLogWarning(context, "Sample plugin is movecallback");
}
ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c)
{
context = c;
OrthancPluginLogWarning(context, "Sample plugin is initializing");
/* Register the callbacks */
OrthancPluginRegisterMoveCallback(context, OnMoveCallback, moveSize, applyMove, freeMove);
/* Declare several properties of the plugin */
OrthancPluginSetRootUri(context, "/plugin/hello");
OrthancPluginSetDescription(context, "This is the description of the TFG plugin that can be seen in Orthanc Explorer.");
}
ORTHANC_PLUGINS_API void OrthancPluginFinalize()
{
OrthancPluginLogWarning(context, "Sample plugin is finalizing");
}
ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
{
return "sample";
}
ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
{
return "1.0";
}
```
I compiled it just like any other plugin:
cmake .. -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release
make
Any help to make orthanc execute correcly the method will be appretiated
|