Skip to content

Abort Session

API reference for diameter.message.commands.abort_session.

This module contains Abort Session Request and Answer messages, implementing AVPs documented in rfc6733.

AbortSession

AbortSession(header: MessageHeader = None, avps: list[Avp] = None)

Bases: DefinedMessage

An Abort-Session base message.

This message class lists message attributes based on the current rfc6733 as python properties, acessible as instance attributes. AVPs not listed in the base protocol can be retrieved using the AbortSession.find_avps search method.

Examples:

AVPs accessible either as instance attributes or by searching:

>>> msg = Message.from_bytes(b"...")
>>> msg.session_id
dra1.mvno.net;2323;546
>>> msg.find_avps((AVP_SESSION_ID, 0))
['dra1.mvno.net;2323;546']

When diameter message is decoded using Message.from_bytes, it returns either an instance of AbortSessionRequest or AbortSessionAnswer automatically:

>>> msg = Message.from_bytes(b"...")
>>> assert msg.header.is_request is True
>>> assert isinstance(msg, AbortSessionRequest)

When creating a new message, the AbortSessionRequest or AbortSessionAnswer class should be instantiated directly, and values for AVPs set as class attributes:

>>> msg = AbortSessionRequest()
>>> msg.session_id = "dra1.mvno.net;2323;546"

Other, custom AVPs can be appended to the message using the AbortSession.append_avp method, or by overwriting the avp attribute entirely. Regardless of the custom AVPs set, the mandatory values listed in RFC6733 must be set, however they can be set as None, if they are not to be used.

Warning

Every AVP documented for the subclasses of this command can be accessed as an instance attribute, even if the original network-received message did not contain that specific AVP. Such AVPs will be returned with the value None when accessed.

Every other AVP not mentioned here, and not present in a network-received message will raise an AttributeError when being accessed; their presence should be validated with hasattr before accessing.

AbortSessionAnswer

AbortSessionAnswer(
    header: MessageHeader = None, avps: list[Avp] = None
)

Bases: AbortSession

An Abort-Session-Answer message.

error_message instance-attribute

error_message: str

error_reporting_host instance-attribute

error_reporting_host: bytes

failed_avp instance-attribute

failed_avp: FailedAvp

origin_aaa_protocol instance-attribute

origin_aaa_protocol: int

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

origin_state_id instance-attribute

origin_state_id: int

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

redirect_host instance-attribute

redirect_host: list[str]

redirect_host_usage instance-attribute

redirect_host_usage: int

redirect_max_cache_time instance-attribute

redirect_max_cache_time: int

result_code instance-attribute

result_code: int

route_record instance-attribute

route_record: list[bytes]

session_id instance-attribute

session_id: str

user_name instance-attribute

user_name: str

AbortSessionRequest

AbortSessionRequest(
    header: MessageHeader = None, avps: list[Avp] = None
)

Bases: AbortSession

An Abort-Session-Request message.

acct_multi_session_id instance-attribute

acct_multi_session_id: str

acct_session_id instance-attribute

acct_session_id: bytes

auth_application_id instance-attribute

auth_application_id: int

called_station_id instance-attribute

called_station_id: str

calling_station_id instance-attribute

calling_station_id: str

destination_host instance-attribute

destination_host: bytes

destination_realm instance-attribute

destination_realm: bytes

framed_interface_id instance-attribute

framed_interface_id: int

framed_ip_address instance-attribute

framed_ip_address: bytes

framed_ipv6_prefix instance-attribute

framed_ipv6_prefix: list[bytes]

nas_identifier instance-attribute

nas_identifier: str

nas_ip_address instance-attribute

nas_ip_address: bytes

nas_ipv6_address instance-attribute

nas_ipv6_address: bytes

nas_port instance-attribute

nas_port: int

nas_port_id instance-attribute

nas_port_id: str

nas_port_type instance-attribute

nas_port_type: int

origin_aaa_protocol instance-attribute

origin_aaa_protocol: int

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

origin_state_id instance-attribute

origin_state_id: int

originating_line_info instance-attribute

originating_line_info: bytes

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

reply_message instance-attribute

reply_message: list[str]

route_record instance-attribute

route_record: list[bytes]

service_type instance-attribute

service_type: int

session_id instance-attribute

session_id: str

state instance-attribute

state: bytes

state_class instance-attribute

state_class: list[bytes]

user_name instance-attribute

user_name: str