Skip to content

Server Assignment

API reference for diameter.message.commands.server_assignment.

This module contains Server-Assignment Request and Answer messages, implementing AVPs documented in 3GPP TS 29.229.

ServerAssignment

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

Bases: DefinedMessage

A Server-Assignment base message.

This message class lists message attributes based on the current 3GPP TS 29.229 version 13.1.0 Release 13 as python properties, accessible as instance attributes. AVPs not listed in the spec protocol can be retrieved using the ServerAssignment.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 ServerAssignmentRequest or ServerAssignmentAnswer automatically:

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

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

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

Other, custom AVPs can be appended to the message using the ServerAssignment.append_avp method, or by overwriting the avp attribute entirely. Regardless of the custom AVPs set, the mandatory values listed in TS 29.229 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.

ServerAssignmentAnswer

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

Bases: ServerAssignment

A Server-Assignment-Answer message.

allowed_waf_wwsf_identities instance-attribute

allowed_waf_wwsf_identities: AllowedWafWwsfIdentities

associated_identities instance-attribute

associated_identities: AssociatedIdentities

associated_registered_identities instance-attribute

associated_registered_identities: AssociatedRegisteredIdentities

auth_session_state instance-attribute

auth_session_state: int

charging_information instance-attribute

charging_information: ChargingInformation

drmp instance-attribute

drmp: int

experimental_result instance-attribute

experimental_result: ExperimentalResult

failed_avp instance-attribute

failed_avp: list[FailedAvp]

loose_route_indication instance-attribute

loose_route_indication: int

oc_olr instance-attribute

oc_olr: OcOlr

oc_supported_features instance-attribute

oc_supported_features: OcSupportedFeatures

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

privileged_sender_indication instance-attribute

privileged_sender_indication: int

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

result_code instance-attribute

result_code: int

route_record instance-attribute

route_record: list[bytes]

scscf_restoration_info instance-attribute

scscf_restoration_info: list[ScscfRestorationInfo]

server_name instance-attribute

server_name: str

session_id instance-attribute

session_id: str

supported_features instance-attribute

supported_features: list[SupportedFeatures]

user_data instance-attribute

user_data: bytes

vendor_specific_application_id instance-attribute

vendor_specific_application_id: VendorSpecificApplicationId

wildcarded_public_identity instance-attribute

wildcarded_public_identity: str

ServerAssignmentRequest

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

Bases: ServerAssignment

A Server-Assignment-Request message.

auth_session_state instance-attribute

auth_session_state: int

destination_host instance-attribute

destination_host: bytes

destination_realm instance-attribute

destination_realm: bytes

drmp instance-attribute

drmp: int

multiple_registration_indication instance-attribute

multiple_registration_indication: int

oc_supported_features instance-attribute

oc_supported_features: OcSupportedFeatures

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

public_identity instance-attribute

public_identity: list[str]

route_record instance-attribute

route_record: list[bytes]

sar_flags instance-attribute

sar_flags: int

scscf_restoration_info instance-attribute

scscf_restoration_info: ScscfRestorationInfo

server_assignment_type instance-attribute

server_assignment_type: int

server_name instance-attribute

server_name: str

session_id instance-attribute

session_id: str

session_priority instance-attribute

session_priority: int

supported_features instance-attribute

supported_features: list[SupportedFeatures]

user_data_already_available instance-attribute

user_data_already_available: int

user_name instance-attribute

user_name: str

vendor_specific_application_id instance-attribute

vendor_specific_application_id: VendorSpecificApplicationId

wildcarded_public_identity instance-attribute

wildcarded_public_identity: str