pynetdicom.acse.ACSE

class pynetdicom.acse.ACSE(acse_timeout=30)[source][source]

The Association Control Service Element (ACSE) service provider.

The ACSE protocol handles association establishment, normal release of an association and the abnormal release of an association.

acse_timeout

The maximum time (in seconds) to wait for association related PDUs from the peer.

Type:int
__init__(acse_timeout=30)[source][source]

Create the ACSE service provider.

Parameters:acse_timeout (int, optional) – The maximum time (in seconds) to wait for A-ASSOCIATE related PDUs from the peer (default: 30)

Methods

__init__([acse_timeout]) Create the ACSE service provider.
debug_receive_abort(a_abort) Placeholder for a function callback.
debug_receive_associate_ac(a_associate_ac) Placeholder for a function callback.
debug_receive_associate_rj(a_associate_rj) Placeholder for a function callback.
debug_receive_associate_rq(a_associate_rq) Placeholder for a function callback.
debug_receive_data_tf(p_data_tf) Placeholder for a function callback.
debug_receive_release_rp(a_release_rp) Placeholder for a function callback.
debug_receive_release_rq(a_release_rq) Placeholder for a function callback.
debug_send_abort(a_abort_rq) Placeholder for a function callback.
debug_send_associate_ac(a_associate_ac) Placeholder for a function callback.
debug_send_associate_rj(a_associate_rj) Placeholder for a function callback.
debug_send_associate_rq(a_associate_rq) Placeholder for a function callback.
debug_send_data_tf(p_data_tf) Placeholder for a function callback.
debug_send_release_rp(a_release_rp) Placeholder for a function callback.
debug_send_release_rq(a_release_rq) Placeholder for a function callback.
is_aborted(assoc) Return True if an A-ABORT or A-P-ABORT request has been received.
is_released(assoc) Return True if an A-RELEASE request has been received.
negotiate_association(assoc) Perform an association negotiation as either the requestor or acceptor.
release_association(assoc) Release an established association.
send_abort(assoc, source) Send an A-ABORT request to the peer.
send_accept(assoc) Send an A-ASSOCIATE (accept) to the peer.
send_ap_abort(assoc, reason) Send an A-P-ABORT to the peer.
send_reject(assoc, result, source, diagnostic) Send an A-ASSOCIATE (reject) to the peer.
send_release(assoc[, is_response]) Send an A-RELEASE (request or response) to the peer.
send_request(assoc) Send an A-ASSOCIATE (request) to the peer.
static debug_receive_abort(a_abort)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an A-ABORT

Parameters:a_abort (pdu.A_ABORT_RQ) – The A-ABORT PDU instance
static debug_receive_associate_ac(a_associate_ac)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an A-ASSOCIATE-AC

The default implementation is used for logging debugging information

Most of this should be moved to on_association_accepted()

Parameters:a_associate_ac (pdu.A_ASSOCIATE_AC) – The A-ASSOCIATE-AC PDU instance
static debug_receive_associate_rj(a_associate_rj)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an A-ASSOCIATE-RJ

Parameters:a_associate_rj (pdu.A_ASSOCIATE_RJ) – The A-ASSOCIATE-RJ PDU instance
static debug_receive_associate_rq(a_associate_rq)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an A-ASSOCIATE-RQ

Parameters:a_associate_rq (pdu.A_ASSOCIATE_RQ) – The A-ASSOCIATE-RQ PDU instance
static debug_receive_data_tf(p_data_tf)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an P-DATA-TF

Parameters:p_data_tf (pdu.P_DATA_TF) – The P-DATA-TF PDU instance
static debug_receive_release_rp(a_release_rp)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an A-RELEASE-RP

Parameters:a_release_rp (pdu.A_RELEASE_RP) – The A-RELEASE-RP PDU instance
static debug_receive_release_rq(a_release_rq)[source][source]

Placeholder for a function callback. Function will be called immediately after receiving and decoding an A-RELEASE-RQ

Parameters:a_release_rq (pdu.A_RELEASE_RQ) – The A-RELEASE-RQ PDU instance
static debug_send_abort(a_abort_rq)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an A-ABORT to a peer AE

Parameters:a_abort (pdu.A_ABORT_RQ) – The A-ABORT PDU instance
static debug_send_associate_ac(a_associate_ac)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an A-ASSOCIATE-AC to a peer AE

Parameters:a_associate_ac (pdu.A_ASSOCIATE_AC) – The A-ASSOCIATE-AC PDU instance
static debug_send_associate_rj(a_associate_rj)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an A-ASSOCIATE-RJ to a peer AE

Parameters:a_associate_rj (pdu.A_ASSOCIATE_RJ) – The A-ASSOCIATE-RJ PDU instance
static debug_send_associate_rq(a_associate_rq)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an A-ASSOCIATE-RQ to a peer AE

The default implementation is used for logging debugging information

Parameters:a_associate_rq (pdu.A_ASSOCIATE_RQ) – The A-ASSOCIATE-RQ PDU instance to be encoded and sent
static debug_send_data_tf(p_data_tf)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an P-DATA-TF to a peer AE

Parameters:a_release_rq (pdu.P_DATA_TF) – The P-DATA-TF PDU instance
static debug_send_release_rp(a_release_rp)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an A-RELEASE-RP to a peer AE

Parameters:a_release_rp (pdu.A_RELEASE_RP) – The A-RELEASE-RP PDU instance
static debug_send_release_rq(a_release_rq)[source][source]

Placeholder for a function callback. Function will be called immediately prior to encoding and sending an A-RELEASE-RQ to a peer AE

Parameters:a_release_rq (pdu.A_RELEASE_RQ) – The A-RELEASE-RQ PDU instance
static is_aborted(assoc)[source][source]

Return True if an A-ABORT or A-P-ABORT request has been received.

static is_released(assoc)[source][source]

Return True if an A-RELEASE request has been received.

negotiate_association(assoc)[source][source]

Perform an association negotiation as either the requestor or acceptor.

Parameters:assoc (association.Association) – The Association instance to perform the negotiation for.
release_association(assoc)[source][source]

Release an established association.

Sends an A-RELEASE request and waits for the response. If no response is received then aborts the association instead.

Parameters:assoc (association.Association) – The Association instance to release.
static send_abort(assoc, source)[source][source]

Send an A-ABORT request to the peer.

Parameters:
  • assoc (pynetdicom.association.Association) – The association that is sending the A-ABORT.
  • source (int) –

    The source of the abort request

    • 0x00 - the DUL service user
    • 0x02 - the DUL service provider
Raises:

ValueError – If the source value is invalid.

static send_accept(assoc)[source][source]

Send an A-ASSOCIATE (accept) to the peer.

Parameters:assoc (pynetdicom.association.Association) – The association that is sending the A-ASSOCIATE (accept).
static send_ap_abort(assoc, reason)[source][source]

Send an A-P-ABORT to the peer.

Parameters:
  • assoc (pynetdicom.association.Association) – The association that is sending the A-P-ABORT.
  • reason (int) –

    The reason for aborting the association, one of the following:

    • 0x00 - reason not specified
    • 0x01 - unrecognised PDU
    • 0x02 - unexpected PDU
    • 0x04 - unrecognised PDU parameter
    • 0x05 - unexpected PDU parameter
    • 0x06 - invalid PDU parameter value
Raises:

ValueError – If the reason value is invalid.

static send_reject(assoc, result, source, diagnostic)[source][source]

Send an A-ASSOCIATE (reject) to the peer.

Parameters:
  • assoc (pynetdicom.association.Association) – The association that is sending the A-ASSOCIATE (reject).
  • result (int) –

    The association rejection:

    • 0x01 - rejected permanent
    • 0x02 - rejected transient
  • source (int) –

    The source of the rejection:

    • 0x01 - DUL service user
    • 0x02 - DUL service provider (ACSE related)
    • 0x03 - DUL service provider (presentation related)
  • diagnostic (int) –

    The reason for the rejection, if the source is 0x01:

    • 0x01 - no reason given
    • 0x02 - application context name not supported
    • 0x03 - calling AE title not recognised
    • 0x07 - called AE title not recognised

    If the source is 0x02:

    • 0x01 - no reason given
    • 0x02 - protocol version not supported

    If the source is 0x03:

    • 0x01 - temporary congestion
    • 0x02 - local limit exceeded
static send_release(assoc, is_response=False)[source][source]

Send an A-RELEASE (request or response) to the peer.

Parameters:
  • assoc (pynetdicom.association.Association) – The association that is sending the A-RELEASE.
  • is_response (bool, optional) – True to send an A-RELEASE (response) to the peer, False to send an A-RELEASE (request) to the peer (default).
static send_request(assoc)[source][source]

Send an A-ASSOCIATE (request) to the peer.

Parameters:assoc (pynetdicom.association.Association) – The association that is sending the A-ASSOCIATE (request).