Skip to Content
go-dicom(3)
Command line

echoscu

Opens an association with a DICOM peer, sends a C-ECHO (the Verification service), and reports whether the peer answered: a DICOM "ping".

When to use it

Use echoscu first when connecting to a PACS, a modality or a router: it tells you whether the host and port are reachable, whether the peer accepts your calling AE title and its own called AE title, and, with -tls, whether the TLS setup is right. It sends no patient data.

It does not test that the peer will accept the SOP classes you mean to send; storescu and findscu negotiate their own.

The closest tools are dcmtk's echoscu and pynetdicom's python -m pynetdicom echoscu. The peer is one argument, host:port.

Examples

Verify a peer

go-dicom echoscu -aec ECHOSCP pacs:11112
Requesting Association with pacs:11112 (AE: ECHOSCP)
Association accepted
Sending C-ECHO...
C-ECHO response: Success (0x0000)
Releasing Association

Exit status 0. -aec is the called AE title, the peer's; -aet is yours (default ECHOSCU).

A wrong called AE title

go-dicom echoscu pacs:11112
Requesting Association with pacs:11112 (AE: ANY-SCP)
Error: association failed: association error [ASSOCIATION_REJECTED]: association rejected: result=1, source=1, reason=7

Without -aec the called title is ANY-SCP. A go-dicom server, and most PACS, answer only to their own title; reason 7 is "called AE title not recognized" (PS3.8 9.3.4). Reason 3 would be the calling title.

Over TLS

go-dicom echoscu -aec ECHOSCP -tls -tls-ca ca.crt pacs:2762
Requesting Association with pacs:2762 (AE: ECHOSCP)
Association accepted
Sending C-ECHO...
C-ECHO response: Success (0x0000)
Releasing Association

-tls-ca names the CA to verify the server against instead of the system roots; without it a private CA's certificate is refused (x509: … certificate is not trusted). -tls-cert and -tls-key present a client certificate for mutual TLS; -tls-server-name verifies a name other than the host.

Caution

-tls-insecure skips verifying the server's certificate, so anyone on the path can pose as the peer. Use it only for testing.

Record the association

go-dicom echoscu -aec ECHOSCP -events trace.jsonl pacs:11112

-events appends every PDU with its bytes, the association's events and every DIMSE message to the file as JSON lines (- for standard output). One echo gives 14 lines, from EVT_CONN_OPEN to EVT_CONN_CLOSE. Events describes them.

Notes

  • Exit status is 0 when the peer answered Success, 1 otherwise (refused connection, rejected association, TLS failure, or a timeout).
  • -timeout is the connection timeout in seconds (default 30).
  • A plain association to a TLS-only port fails while reading the association response (failed to read PDU header: EOF).

See also

Options

On this page