Hi Sébastien,
I followed your advice, and start a implementation of auto-routing with Ruby script.
The main idea was to use the former lua script, mentioned by you, to call a system instruction (my ruby script), to enqueue the instanceID.
But during this process, I realized two things.
1 - Empty response (no response) for POST request
When I do a POST request against the resource "modalities/mymodality/store", the result is "no response". Even when you use curl instruction, it returns code 52.
2 - I still have lack of assurance about the DICOM transfer success.
Supose that the POST request mentioned above, returns a 200 status code to me. What it means? For me, (after reading the source code of Orthanc), the meaning is: "Ok man, I scheduled a transfer Dicom operation for you with success"
And that is the big issue. Because if the sender or the receiver looses your internet connection that operation can fail, without I have noticed.
In my opnion, one possible solution for this issue is automatically reschedule the failured job .
I looked the OrthancRestApi source code. But my inexpressive C++ skills limited me just to read the code.
So I would to know if you think that is possbile to do this in ServerScheduler::SignalFailure.
Or maybe add a RetryJob method to ServerScheduler, in order to use them from the ServerCommandInstance::Execute.