Skip to main content

sccp_protocol/message/
catalog.rs

1//! SCCP/SPCP message identifiers and direction metadata for the message domain.
2//!
3//! The numeric values are protocol facts.  The catalog intentionally includes
4//! messages which this crate can only preserve opaquely today: knowing the ID
5//! is still useful for bounded forwarding and future typed implementations.
6//!
7//! Start with [`MessageId`] when inspecting an unknown frame. Its
8//! [`MessageId::contract`] links the numeric identifier to routing, payload
9//! bounds, codec coverage, response selection, and field fidelity. Use
10//! [`implemented_message_contracts`] to enumerate the typed subset.
11
12use std::fmt;
13
14use super::values::ProtocolVersion;
15use super::wire::{HEADER_SIZE, MAX_FRAME_SIZE};
16
17/// The protocol roles between which a message is normally sent.
18///
19/// SCCP is not solely a station/client protocol. Conference resources, media
20/// resource services, and call-control peers share the same numeric message
21/// space. Keeping those routes explicit prevents a decoder or runtime from
22/// treating a service-node frame as handset input merely because both travel
23/// toward call control.
24#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
25pub enum MessageRoute {
26    StationToControl,
27    ControlToStation,
28    ControlToServiceNode,
29    ServiceNodeToControl,
30    IntraControl,
31}
32
33/// Legacy station-oriented view of the two handset message directions.
34///
35/// New code should use [`MessageRoute`]. A service-node or intra-control
36/// message deliberately has no `MessageDirection`.
37#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
38pub enum MessageDirection {
39    DeviceToServer,
40    ServerToDevice,
41}
42
43/// How completely the public message model implements a catalog entry.
44#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
45pub enum CodecSupport {
46    /// The message has a typed public representation and a checked codec.
47    Typed,
48    /// Only the identifier, direction, and opaque bytes are preserved.
49    OpaqueOnly,
50}
51
52/// The rule used to choose and bound a message payload layout.
53#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
54pub enum PayloadLayout {
55    /// No semantic payload bytes are carried.
56    Empty,
57    /// One fixed layout is used for all supported protocol versions.
58    Fixed,
59    /// The negotiated protocol selects between fixed layouts.
60    VersionSelected,
61    /// The negotiated protocol and exact body length jointly select a layout.
62    VersionAndLengthSelected,
63    /// A typed fixed prefix is decoded while a bounded extension is preserved.
64    MinimumLengthPreserved,
65    /// A bounded length/count field controls a variable tail.
66    LengthPrefixed,
67    /// A bounded payload is retained exactly while consumers may inspect it.
68    BoundedPreserved,
69    /// A bounded extension is retained byte-for-byte because its internal
70    /// schema is not modeled.
71    BoundedOpaque,
72    /// NUL-terminated station strings are followed by zero bytes to a
73    /// four-byte boundary.
74    DynamicWordPadded,
75    /// The crate deliberately does not interpret the payload.
76    Opaque,
77}
78
79/// Whether application code can construct a message without supplying raw
80/// wire bytes.
81#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
82pub enum EmissionSupport {
83    /// A typed encoder is available.
84    Typed,
85    /// Bytes can be forwarded explicitly through `KnownOpaque`, but there is
86    /// no typed constructor and runtime code must not synthesize the message.
87    PreserveOnly,
88}
89
90/// Present production/runtime role of a known message.
91#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
92pub enum RuntimeUse {
93    /// A typed phone-originated input accepted by the session runtime.
94    DeviceInput,
95    /// A server response required by a currently handled phone request.
96    RequiredResponse,
97    /// A server output emitted only for the corresponding configured feature
98    /// or call state.
99    ConditionalServerOutput,
100    /// A typed service-node input accepted by its independent runtime.
101    ServiceNodeInput,
102    /// A service-node output emitted only for an owned reservation transition.
103    ConditionalServiceNodeOutput,
104    /// The codec is typed for conformance/testing, but ordinary runtime flows
105    /// intentionally do not emit it.
106    TypedButNotEmitted,
107    /// Only catalog metadata and explicit opaque preservation are supported.
108    CatalogOnly,
109}
110
111/// Whether all semantic wire fields survive typed decoding and re-encoding.
112#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
113pub enum FieldFidelity {
114    /// Every accepted semantic field is represented; reserved/padding bytes
115    /// are validated rather than exposed.
116    Lossless,
117    /// A server-only producer omits or fills the named fields. Decoding may
118    /// project other values, so this is not an exact decode/re-encode guarantee.
119    CanonicalServerOutput(&'static str),
120    /// Typed decoding is intentionally projected onto the named runtime data.
121    SemanticProjection(&'static str),
122    /// The uninterpreted bounded body is retained exactly.
123    OpaquePreserved,
124}
125
126/// SCCP-level response expected for a request or media transaction.
127#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
128pub enum ResponseExpectation {
129    None,
130    Message(MessageId),
131    OptionalMessage(MessageId),
132    /// The negotiated protocol selects the response identifier.
133    VersionSelected {
134        /// Response used before `minimum_protocol`.
135        before: MessageId,
136        /// Response used at and after `minimum_protocol`.
137        from: MessageId,
138        /// First protocol version that selects `from`.
139        minimum_protocol: u8,
140    },
141    /// Negotiated session inputs select the response identifier.
142    SessionSelected {
143        /// Response used when `selector` does not select the dynamic form.
144        before: MessageId,
145        /// Dynamic response selected by `selector`.
146        from: MessageId,
147        /// Session rule that chooses between the response identifiers.
148        selector: SessionResponseSelector,
149    },
150    /// The response may be any member of this family.
151    OneOf(&'static [MessageId]),
152}
153
154/// Session rule used to select a dynamic response identifier.
155#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
156pub enum SessionResponseSelector {
157    /// Select the dynamic form when the feature is present or the negotiated
158    /// protocol meets the stated minimum.
159    DynamicMessagesOrProtocol { minimum_protocol: u8 },
160    /// Select the dynamic form only when the feature is present.
161    DynamicMessages,
162}
163
164/// Verification depth for a wire contract.
165#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
166pub enum ContractVerification {
167    Structural,
168    StructuralAndValidated,
169}
170
171/// Whether an identifier belongs to the base station-control inventory or an
172/// independently supported extension family.
173#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
174pub enum ContractScope {
175    Base,
176    Supplemental,
177}
178
179/// Inclusive payload-size bounds, excluding the 12-byte frame header.
180#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
181pub struct PayloadSizeBounds {
182    /// Smallest accepted payload in bytes.
183    pub minimum: usize,
184    /// Largest accepted payload in bytes.
185    pub maximum: usize,
186}
187
188/// Machine-readable support record for one known message identifier.
189///
190/// This is an implementation inventory, not a claim that every cataloged
191/// message is safe to send. `OpaqueOnly` entries exist for bounded forwarding
192/// and remain non-emittable through the typed API. `response`
193/// describes SCCP transaction acknowledgement; TCP acknowledgement is
194/// intentionally not treated as application-level acceptance.
195#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
196pub struct MessageContract {
197    pub id: MessageId,
198    pub scope: ContractScope,
199    pub route: MessageRoute,
200    pub codec: CodecSupport,
201    pub payload_layout: PayloadLayout,
202    /// Canonical typed-encoder payload size when there is one stable,
203    /// independently useful value. This excludes the 12-byte frame header;
204    /// nominally empty decoders may still accept bounded extension bytes.
205    pub fixed_payload_bytes: Option<usize>,
206    /// Accepted payload-size range when both bounds are known.
207    pub payload_size_bounds: Option<PayloadSizeBounds>,
208    /// Typed construction versus explicit opaque preservation.
209    pub emission: EmissionSupport,
210    /// Production/runtime use, distinct from mere encoder availability.
211    pub runtime_use: RuntimeUse,
212    /// Whether the typed model retains every accepted semantic wire field.
213    pub field_fidelity: FieldFidelity,
214    /// SCCP response/acknowledgement family, when one exists.
215    pub response: ResponseExpectation,
216    /// Depth of contract validation performed by the codec.
217    pub verification: ContractVerification,
218}
219
220/// Contract fields which are declared once beside a message's numeric ID and route.
221///
222/// Keeping the complete metadata record in the catalog entry prevents independent
223/// exhaustive matches from drifting or describing an incoherent wire contract.
224#[derive(Clone, Copy)]
225struct ContractMetadata {
226    scope: ContractScope,
227    codec: CodecSupport,
228    payload_layout: PayloadLayout,
229    fixed_payload_bytes: Option<usize>,
230    payload_size_bounds: Option<PayloadSizeBounds>,
231    runtime_use: RuntimeUse,
232    field_fidelity: FieldFidelity,
233    response: ResponseExpectation,
234    verification: ContractVerification,
235}
236
237impl ContractMetadata {
238    const fn into_contract(self, id: MessageId, route: MessageRoute) -> MessageContract {
239        MessageContract {
240            id,
241            scope: self.scope,
242            route,
243            codec: self.codec,
244            payload_layout: self.payload_layout,
245            fixed_payload_bytes: self.fixed_payload_bytes,
246            payload_size_bounds: self.payload_size_bounds,
247            emission: match self.codec {
248                CodecSupport::Typed => EmissionSupport::Typed,
249                CodecSupport::OpaqueOnly => EmissionSupport::PreserveOnly,
250            },
251            runtime_use: self.runtime_use,
252            field_fidelity: self.field_fidelity,
253            response: self.response,
254            verification: self.verification,
255        }
256    }
257}
258
259macro_rules! message_catalog {
260    ($(($variant:ident $(=> $wire_name:ident)?, $value:expr, $route:ident, $metadata:expr)),+ $(,)?) => {
261        /// A Skinny message identifier.
262        ///
263        /// Unknown values are retained to keep decoding forward-compatible.
264        #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
265        pub enum MessageId {
266            $($variant,)+
267            Unknown(u32),
268        }
269
270        impl MessageId {
271            pub const ALL_KNOWN: &'static [Self] = &[$(Self::$variant,)+];
272            /// Declarative contract records generated in catalog order.
273            pub const ALL_CONTRACTS: &'static [MessageContract] = &[
274                $($metadata.into_contract(Self::$variant, MessageRoute::$route),)+
275            ];
276
277            pub const fn wire_value(self) -> u32 {
278                match self {
279                    $(Self::$variant => $value,)+
280                    Self::Unknown(value) => value,
281                }
282            }
283
284            /// Returns the protocol route for a known identifier.
285            ///
286            /// Unknown identifiers return `None` because direction cannot be
287            /// inferred from their numeric value alone.
288            pub const fn route(self) -> Option<MessageRoute> {
289                match self {
290                    $(Self::$variant => Some(MessageRoute::$route),)+
291                    Self::Unknown(_) => None,
292                }
293            }
294
295            /// Return the legacy two-ended station direction, if applicable.
296            pub const fn direction(self) -> Option<MessageDirection> {
297                match self.route() {
298                    Some(MessageRoute::StationToControl) => {
299                        Some(MessageDirection::DeviceToServer)
300                    }
301                    Some(MessageRoute::ControlToStation) => {
302                        Some(MessageDirection::ServerToDevice)
303                    }
304                    Some(MessageRoute::ControlToServiceNode)
305                    | Some(MessageRoute::ServiceNodeToControl)
306                    | Some(MessageRoute::IntraControl)
307                    | None => None,
308                }
309            }
310
311            pub const fn name(self) -> &'static str {
312                match self {
313                    $(Self::$variant => stringify!($variant),)+
314                    Self::Unknown(_) => "Unknown",
315                }
316            }
317
318            pub const fn is_known(self) -> bool {
319                !matches!(self, Self::Unknown(_))
320            }
321
322            /// Return the codec and wire contract for this identifier.
323            pub const fn contract(self) -> Option<MessageContract> {
324                match self {
325                    $(
326                        Self::$variant => Some(
327                            $metadata.into_contract(Self::$variant, MessageRoute::$route)
328                        ),
329                    )+
330                    Self::Unknown(_) => None,
331                }
332            }
333        }
334
335        impl From<u32> for MessageId {
336            fn from(value: u32) -> Self {
337                match value {
338                    $($value => Self::$variant,)+
339                    value => Self::Unknown(value),
340                }
341            }
342        }
343
344        /// Raw identifiers used internally where Rust patterns require integer constants.
345        pub(crate) mod wire_id {
346            $(
347                $(pub(crate) const $wire_name: u32 =
348                    super::MessageId::$variant.wire_value();)?
349            )+
350        }
351    };
352}
353message_catalog! {
354    (KeepAlive => KEEP_ALIVE, 0x0000, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::Message(MessageId::KeepAliveAck), verification: ContractVerification::StructuralAndValidated }),
355    (Register => REGISTER, 0x0001, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 32, maximum: 172 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("device and firmware text are normalized while the exact length-selected layout is retained"), response: ResponseExpectation::Message(MessageId::RegisterAck), verification: ContractVerification::StructuralAndValidated }),
356    (IpPort => IP_PORT, 0x0002, StationToControl, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
357    (KeypadButton => KEYPAD_BUTTON, 0x0003, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
358    (EnblocCall => ENBLOC_CALL, 0x0004, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 24, maximum: 32 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
359    (Stimulus => STIMULUS, 0x0005, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
360    (OffHook => OFF_HOOK, 0x0006, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
361    (OnHook => ON_HOOK, 0x0007, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 8 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("fieldless form omits line and call identity"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
362    (HookFlash => HOOK_FLASH, 0x0008, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
363    (ForwardStatusRequest => FORWARD_STAT_REQ, 0x0009, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
364    (SpeedDialStatusRequest => SPEED_DIAL_STAT_REQ, 0x000a, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::SessionSelected { before: MessageId::SpeedDialStatus, from: MessageId::SpeedDialStatusDynamic, selector: SessionResponseSelector::DynamicMessagesOrProtocol { minimum_protocol: 9 } }, verification: ContractVerification::Structural }),
365    (LineStatusRequest => LINE_STAT_REQ, 0x000b, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::SessionSelected { before: MessageId::LineStatus, from: MessageId::LineStatusDynamic, selector: SessionResponseSelector::DynamicMessagesOrProtocol { minimum_protocol: 9 } }, verification: ContractVerification::Structural }),
366    (ConfigStatusRequest => CONFIG_STAT_REQ, 0x000c, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::SessionSelected { before: MessageId::ConfigStatus, from: MessageId::ConfigStatusDynamic, selector: SessionResponseSelector::DynamicMessagesOrProtocol { minimum_protocol: 9 } }, verification: ContractVerification::Structural }),
367    (TimeDateRequest => TIME_DATE_REQ, 0x000d, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::Message(MessageId::DefineTimeDate), verification: ContractVerification::Structural }),
368    (ButtonTemplateRequest => BUTTON_TEMPLATE_REQ, 0x000e, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("the optional total-button-count request word is accepted but not modeled"), response: ResponseExpectation::Message(MessageId::ButtonTemplate), verification: ContractVerification::Structural }),
369    (VersionRequest => VERSION_REQ, 0x000f, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::Message(MessageId::Version), verification: ContractVerification::Structural }),
370    (CapabilitiesResponse => CAPABILITIES_RES, 0x0010, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 4, maximum: 388 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("advertised capability count; inactive fixed-reservoir entries are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
371    (MediaPortList => MEDIA_PORT_LIST, 0x0011, StationToControl, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(68), payload_size_bounds: Some(PayloadSizeBounds { minimum: 68, maximum: 68 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("inactive fixed-array entries are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
372    (ServerRequest => SERVER_REQ, 0x0012, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::Message(MessageId::ServerResponse), verification: ContractVerification::Structural }),
373    (Alarm => ALARM, 0x0020, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
374    (MulticastMediaReceptionAck => MULTICAST_MEDIA_RECEPTION_ACK, 0x0021, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
375    (OpenReceiveChannelAck => OPEN_RECEIVE_CHANNEL_ACK, 0x0022, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
376    (ConnectionStatisticsResponse => CONNECTION_STATISTICS_RES, 0x0023, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 61, maximum: 668 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("inactive fixed quality-reservoir bytes are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
377    (OffHookWithCallingParty => OFF_HOOK_WITH_CALLING_PARTY, 0x0024, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
378    (SoftKeySetRequest => SOFT_KEY_SET_REQ, 0x0025, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::Message(MessageId::SoftKeySetResponse), verification: ContractVerification::Structural }),
379    (SoftKeyEvent => SOFT_KEY_EVENT, 0x0026, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
380    (Unregister => UNREGISTER, 0x0027, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("an empty reason-zero body is accepted and normalized to the typed reason"), response: ResponseExpectation::Message(MessageId::UnregisterAck), verification: ContractVerification::Structural }),
381    (SoftKeyTemplateRequest => SOFT_KEY_TEMPLATE_REQ, 0x0028, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("nominally empty request; bounded extension bytes are accepted but not modeled"), response: ResponseExpectation::Message(MessageId::SoftKeyTemplateResponse), verification: ContractVerification::Structural }),
382    (RegisterTokenRequest => REGISTER_TOKEN_REQ, 0x0029, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("simultaneously populated IPv4 and IPv6 station addresses collapse to one address"), response: ResponseExpectation::OneOf(&[MessageId::RegisterTokenAck, MessageId::RegisterTokenReject]), verification: ContractVerification::Structural }),
383    (MediaTransmissionFailure => MEDIA_TRANSMISSION_FAILURE, 0x002a, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("the public status is synthesized because the failure wire layouts carry no status"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
384    (HeadsetStatus => HEADSET_STATUS, 0x002b, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("non-canonical raw states are projected onto a boolean"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
385    (MediaResourceNotification => MEDIA_RESOURCE_NOTIFICATION, 0x002c, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
386    (RegisterAvailableLines => REGISTER_AVAILABLE_LINES, 0x002d, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("an absent or short legacy body is projected onto zero available lines"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
387    (DeviceToUserData => DEVICE_TO_USER_DATA, 0x002e, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
388    (DeviceToUserDataResponse => DEVICE_TO_USER_DATA_RESPONSE, 0x002f, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
389    (UpdateCapabilities => UPDATE_CAPABILITIES, 0x0030, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
390    (OpenMultimediaReceiveChannelAck => OPEN_MULTIMEDIA_RECEIVE_CHANNEL_ACK, 0x0031, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
391    (ClearConference => CLEAR_CONFERENCE, 0x0032, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
392    (ServiceUrlStatusRequest => SERVICE_URL_STAT_REQ, 0x0033, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::SessionSelected { before: MessageId::ServiceUrlStatus, from: MessageId::ServiceUrlStatusDynamic, selector: SessionResponseSelector::DynamicMessagesOrProtocol { minimum_protocol: 9 } }, verification: ContractVerification::Structural }),
393    (FeatureStatusRequest => FEATURE_STAT_REQ, 0x0034, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::SessionSelected { before: MessageId::FeatureStatus, from: MessageId::FeatureStatusDynamic, selector: SessionResponseSelector::DynamicMessages }, verification: ContractVerification::Structural }),
394    (CreateConferenceResponse => CREATE_CONFERENCE_RES, 0x0035, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
395    (DeleteConferenceResponse => DELETE_CONFERENCE_RES, 0x0036, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
396    (ModifyConferenceResponse => MODIFY_CONFERENCE_RES, 0x0037, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
397    (AddParticipantResponse => ADD_PARTICIPANT_RES, 0x0038, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::MinimumLengthPreserved, fixed_payload_bytes: Some(272), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 272 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
398    (AuditConferenceResponse => AUDIT_CONFERENCE_RES, 0x0039, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
399    (AuditParticipantResponse => AUDIT_PARTICIPANT_RES, 0x0040, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::BoundedOpaque, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
400    (DeviceToUserDataV1 => DEVICE_TO_USER_DATA_V1, 0x0041, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
401    (DeviceToUserDataResponseV1 => DEVICE_TO_USER_DATA_RESPONSE_V1, 0x0042, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
402    (UpdateCapabilitiesV2 => UPDATE_CAPABILITIES_V2, 0x0043, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(2000), payload_size_bounds: Some(PayloadSizeBounds { minimum: 2000, maximum: 2000 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
403    (UpdateCapabilitiesV3 => UPDATE_CAPABILITIES_V3, 0x0044, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::MinimumLengthPreserved, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 20, maximum: 2380 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
404    (PortResponse => PORT_RESPONSE, 0x0045, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::SemanticProjection("pre-v20 bodies omit media type, which is synthesized on decode"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
405    (QosReservationNotify => QOS_RESERVATION_NOTIFY, 0x0046, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(24), payload_size_bounds: Some(PayloadSizeBounds { minimum: 24, maximum: 24 }), runtime_use: RuntimeUse::ServiceNodeInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
406    (QosErrorNotify => QOS_ERROR_NOTIFY, 0x0047, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(44), payload_size_bounds: Some(PayloadSizeBounds { minimum: 44, maximum: 44 }), runtime_use: RuntimeUse::ServiceNodeInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
407    (SubscriptionStatusRequest => SUBSCRIPTION_STAT_REQ, 0x0048, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
408    (MediaPathEvent => ACCESSORY_STATUS, 0x0049, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
409    (MediaPathCapability => MEDIA_PATH_CAPABILITY, 0x004a, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
410    (MwiNotification => MWI_NOTIFICATION, 0x004c, ServiceNodeToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(88), payload_size_bounds: Some(PayloadSizeBounds { minimum: 88, maximum: 88 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
411    (RegisterAck => REGISTER_ACK, 0x0081, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(20), payload_size_bounds: Some(PayloadSizeBounds { minimum: 20, maximum: 20 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
412    (StartTone => START_TONE, 0x0082, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
413    (StopTone => STOP_TONE, 0x0083, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("post-v11 tone word"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
414    (SetRinger => SET_RINGER, 0x0085, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
415    (SetLamp => SET_LAMP, 0x0086, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
416    (SetHookFlashDetect => SET_HOOK_FLASH_DETECT, 0x0087, ControlToStation, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 0 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
417    (SetSpeakerMode => SET_SPEAKER_MODE, 0x0088, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
418    (SetMicrophoneMode => SET_MICROPHONE_MODE, 0x0089, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
419    (StartMediaTransmission => START_MEDIA_TRANSMISSION, 0x008a, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::OptionalMessage(MessageId::StartMediaTransmissionAck), verification: ContractVerification::StructuralAndValidated }),
420    (StopMediaTransmission => STOP_MEDIA_TRANSMISSION, 0x008b, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
421    (StartMediaReception => START_MEDIA_RECEPTION, 0x008c, ControlToStation, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 0 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
422    (StopMediaReception => STOP_MEDIA_RECEPTION, 0x008d, ControlToStation, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(8), payload_size_bounds: Some(PayloadSizeBounds { minimum: 8, maximum: 8 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
423    (CallInfo => CALL_INFO, 0x008f, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("mailboxes, call instance/security and version-selected party metadata"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
424    (ForwardStatus => FORWARD_STAT, 0x0090, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("aggregate active flag and inactive forwarding-number slots"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
425    (SpeedDialStatus => SPEED_DIAL_STAT, 0x0091, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
426    (LineStatus => LINE_STAT, 0x0092, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(112), payload_size_bounds: Some(PayloadSizeBounds { minimum: 112, maximum: 112 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("display label/fully-qualified display name and display-options word"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
427    (ConfigStatus => CONFIG_STAT, 0x0093, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
428    (DefineTimeDate => DEFINE_TIME_DATE, 0x0094, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(36), payload_size_bounds: Some(PayloadSizeBounds { minimum: 36, maximum: 36 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
429    (StartSessionTransmission => START_SESSION_TRANSMISSION, 0x0095, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
430    (StopSessionTransmission => STOP_SESSION_TRANSMISSION, 0x0096, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
431    (ButtonTemplate => BUTTON_TEMPLATE, 0x0097, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(96), payload_size_bounds: Some(PayloadSizeBounds { minimum: 96, maximum: 96 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("unused fixed-array entries outside the declared template count"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
432    (Version => VERSION, 0x0098, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
433    (DisplayText => DISPLAY_TEXT, 0x0099, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
434    (ClearDisplay => CLEAR_DISPLAY, 0x009a, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("display-control word"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
435    (CapabilitiesRequest => CAPABILITIES_REQ, 0x009b, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("nominally empty response; accepted extension bytes are not modeled"), response: ResponseExpectation::OneOf(&[MessageId::CapabilitiesResponse, MessageId::UpdateCapabilities, MessageId::UpdateCapabilitiesV2, MessageId::UpdateCapabilitiesV3]), verification: ContractVerification::Structural }),
436    (EnunciatorCommand => ENUNCIATOR_COMMAND, 0x009c, ControlToStation, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 0 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
437    (RegisterReject => REGISTER_REJECT, 0x009d, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
438    (ServerResponse => SERVER_RES, 0x009e, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::SemanticProjection("empty server-list slot positions are not retained"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
439    (Reset => RESET, 0x009f, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
440    (KeepAliveAck => KEEP_ALIVE_ACK, 0x0100, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("nominally empty response; accepted extension bytes are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
441    (StartMulticastMediaReception => START_MULTICAST_MEDIA_RECEPTION, 0x0101, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
442    (StartMulticastMediaTransmission => START_MULTICAST_MEDIA_TRANSMISSION, 0x0102, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
443    (StopMulticastMediaReception => STOP_MULTICAST_MEDIA_RECEPTION, 0x0103, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
444    (StopMulticastMediaTransmission => STOP_MULTICAST_MEDIA_TRANSMISSION, 0x0104, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
445    (OpenReceiveChannel => OPEN_RECEIVE_CHANNEL, 0x0105, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::OpenReceiveChannelAck), verification: ContractVerification::StructuralAndValidated }),
446    (CloseReceiveChannel => CLOSE_RECEIVE_CHANNEL, 0x0106, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
447    (ConnectionStatisticsRequest => CONNECTION_STATISTICS_REQ, 0x0107, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("post-v18 directory-number alignment bytes"), response: ResponseExpectation::Message(MessageId::ConnectionStatisticsResponse), verification: ContractVerification::Structural }),
448    (SoftKeyTemplateResponse => SOFT_KEY_TEMPLATE_RES, 0x0108, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(652), payload_size_bounds: Some(PayloadSizeBounds { minimum: 652, maximum: 652 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("unused fixed-array entries outside the declared template count"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
449    (SoftKeySetResponse => SOFT_KEY_SET_RES, 0x0109, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(780), payload_size_bounds: Some(PayloadSizeBounds { minimum: 780, maximum: 780 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("unused fixed-array entries outside the declared template count"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
450    (SelectSoftKeys => SELECT_SOFT_KEYS, 0x0110, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
451    (CallState => CALL_STATE, 0x0111, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("visibility, precedence and domain"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
452    (DisplayPromptStatus => DISPLAY_PROMPT_STATUS, 0x0112, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
453    (ClearPromptStatus => CLEAR_PROMPT_STATUS, 0x0113, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
454    (DisplayNotify => DISPLAY_NOTIFY, 0x0114, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
455    (ClearNotify => CLEAR_NOTIFY, 0x0115, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::CanonicalServerOutput("nominally empty response; accepted extension bytes are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
456    (ActivateCallPlane => ACTIVATE_CALL_PLANE, 0x0116, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
457    (DeactivateCallPlane => DEACTIVATE_CALL_PLANE, 0x0117, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::CanonicalServerOutput("nominally empty response; accepted extension bytes are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
458    (UnregisterAck => UNREGISTER_ACK, 0x0118, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("acknowledgement body word"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
459    (BackspaceResponse => BACKSPACE_RESPONSE, 0x0119, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
460    (RegisterTokenAck => REGISTER_TOKEN_ACK, 0x011a, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Empty, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: MAX_FRAME_SIZE - HEADER_SIZE }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("nominally empty response; accepted extension bytes are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
461    (RegisterTokenReject => REGISTER_TOKEN_REJECT, 0x011b, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
462    (StartMediaFailureDetection => START_MEDIA_FAILURE_DETECTION, 0x011c, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(28), payload_size_bounds: Some(PayloadSizeBounds { minimum: 28, maximum: 28 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
463    (DialedNumber => DIALED_NUMBER, 0x011d, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
464    (UserToDeviceData => USER_TO_DEVICE_DATA, 0x011e, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
465    (FeatureStatus => FEATURE_STAT, 0x011f, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
466    (DisplayPriorityNotify => DISPLAY_PRIORITY_NOTIFY, 0x0120, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
467    (ClearPriorityNotify => CLEAR_PRIORITY_NOTIFY, 0x0121, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
468    (StartAnnouncement => START_ANNOUNCEMENT, 0x0122, IntraControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::CanonicalServerOutput("unused announcement and conference-party array entries"), response: ResponseExpectation::None, verification: ContractVerification::Structural }),
469    (StopAnnouncement => STOP_ANNOUNCEMENT, 0x0123, IntraControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
470    (AnnouncementFinish => ANNOUNCEMENT_FINISH, 0x0124, IntraControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
471    (NotifyDtmfTone => NOTIFY_DTMF_TONE, 0x0127, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
472    (SendDtmfTone => SEND_DTMF_TONE, 0x0128, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
473    (SubscribeDtmfPayloadRequest => SUBSCRIBE_DTMF_PAYLOAD_REQ, 0x0129, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::SubscribeDtmfPayloadResponse), verification: ContractVerification::Structural }),
474    (SubscribeDtmfPayloadResponse => SUBSCRIBE_DTMF_PAYLOAD_RES, 0x012a, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
475    (SubscribeDtmfPayloadError => SUBSCRIBE_DTMF_PAYLOAD_ERR, 0x012b, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
476    (UnsubscribeDtmfPayloadRequest => UNSUBSCRIBE_DTMF_PAYLOAD_REQ, 0x012c, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::UnsubscribeDtmfPayloadResponse), verification: ContractVerification::Structural }),
477    (UnsubscribeDtmfPayloadResponse => UNSUBSCRIBE_DTMF_PAYLOAD_RES, 0x012d, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
478    (UnsubscribeDtmfPayloadError => UNSUBSCRIBE_DTMF_PAYLOAD_ERR, 0x012e, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
479    (ServiceUrlStatus => SERVICE_URL_STAT, 0x012f, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
480    (CallSelectStatus => CALL_SELECT_STAT, 0x0130, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
481    (OpenMultimediaChannel => OPEN_MULTIMEDIA_CHANNEL, 0x0131, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::OpenMultimediaReceiveChannelAck), verification: ContractVerification::Structural }),
482    (StartMultimediaTransmission => START_MULTIMEDIA_TRANSMISSION, 0x0132, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::StartMultimediaTransmissionAck), verification: ContractVerification::Structural }),
483    (StopMultimediaTransmission => STOP_MULTIMEDIA_TRANSMISSION, 0x0133, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
484    (MiscellaneousCommand => MISCELLANEOUS_COMMAND, 0x0134, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(52), payload_size_bounds: Some(PayloadSizeBounds { minimum: 52, maximum: 52 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
485    (FlowControlCommand => FLOW_CONTROL_COMMAND, 0x0135, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
486    (CloseMultimediaReceiveChannel => CLOSE_MULTIMEDIA_RECEIVE_CHANNEL, 0x0136, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
487    (CreateConferenceRequest => CREATE_CONFERENCE_REQ, 0x0137, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::CreateConferenceResponse), verification: ContractVerification::Structural }),
488    (DeleteConferenceRequest => DELETE_CONFERENCE_REQ, 0x0138, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::DeleteConferenceResponse), verification: ContractVerification::Structural }),
489    (ModifyConferenceRequest => MODIFY_CONFERENCE_REQ, 0x0139, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::ModifyConferenceResponse), verification: ContractVerification::Structural }),
490    (AddParticipantRequest => ADD_PARTICIPANT_REQ, 0x013a, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::AddParticipantResponse), verification: ContractVerification::Structural }),
491    (DropParticipantRequest => DROP_PARTICIPANT_REQ, 0x013b, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
492    (AuditConferenceRequest => AUDIT_CONFERENCE_REQ, 0x013c, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(0), payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 0 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::AuditConferenceResponse), verification: ContractVerification::Structural }),
493    (AuditParticipantRequest => AUDIT_PARTICIPANT_REQ, 0x013d, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::AuditParticipantResponse), verification: ContractVerification::Structural }),
494    (ChangeParticipantRequest => CHANGE_PARTICIPANT_REQ, 0x013e, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
495    (UserToDeviceDataV1 => USER_TO_DEVICE_DATA_V1, 0x013f, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::LengthPrefixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
496    (VideoDisplayCommand => VIDEO_DISPLAY_COMMAND, 0x0140, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(12), payload_size_bounds: Some(PayloadSizeBounds { minimum: 12, maximum: 12 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
497    (FlowControlNotify => FLOW_CONTROL_NOTIFY, 0x0141, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(16), payload_size_bounds: Some(PayloadSizeBounds { minimum: 16, maximum: 16 }), runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
498    (ConfigStatusDynamic => CONFIG_STAT_DYNAMIC, 0x0142, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
499    (DisplayDynamicNotify => DISPLAY_DYNAMIC_NOTIFY, 0x0143, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
500    (DisplayDynamicPriorityNotify => DISPLAY_DYNAMIC_PRIORITY_NOTIFY, 0x0144, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
501    (DisplayDynamicPromptStatus => DISPLAY_DYNAMIC_PROMPT_STATUS, 0x0145, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
502    (FeatureStatusDynamic => FEATURE_STAT_DYNAMIC, 0x0146, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
503    (LineStatusDynamic => LINE_STAT_DYNAMIC, 0x0147, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::CanonicalServerOutput("display label/fully-qualified display name and display-options word"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
504    (ServiceUrlStatusDynamic => SERVICE_URL_STAT_DYNAMIC, 0x0148, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
505    (SpeedDialStatusDynamic => SPEED_DIAL_STAT_DYNAMIC, 0x0149, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
506    (CallInfoDynamic => CALL_INFO_DYNAMIC, 0x014a, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::DynamicWordPadded, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::CanonicalServerOutput("mailboxes, call instance/security and version-selected party metadata"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
507    (PortRequest => PORT_REQUEST, 0x014b, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::PortResponse), verification: ContractVerification::Structural }),
508    (PortClose => PORT_CLOSE, 0x014c, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
509    (QosListen => QOS_LISTEN, 0x014d, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(172), payload_size_bounds: Some(PayloadSizeBounds { minimum: 172, maximum: 172 }), runtime_use: RuntimeUse::ConditionalServiceNodeOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
510    (QosPath => QOS_PATH, 0x014e, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(168), payload_size_bounds: Some(PayloadSizeBounds { minimum: 168, maximum: 168 }), runtime_use: RuntimeUse::ConditionalServiceNodeOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
511    (QosTeardown => QOS_TEARDOWN, 0x014f, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(24), payload_size_bounds: Some(PayloadSizeBounds { minimum: 24, maximum: 24 }), runtime_use: RuntimeUse::ConditionalServiceNodeOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
512    (UpdateDscp => UPDATE_DSCP, 0x0150, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(24), payload_size_bounds: Some(PayloadSizeBounds { minimum: 24, maximum: 24 }), runtime_use: RuntimeUse::ConditionalServiceNodeOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
513    (QosModify => QOS_MODIFY, 0x0151, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(152), payload_size_bounds: Some(PayloadSizeBounds { minimum: 152, maximum: 152 }), runtime_use: RuntimeUse::ConditionalServiceNodeOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
514    (SubscriptionStatus => SUBSCRIPTION_STAT, 0x0152, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
515    (Notification => NOTIFICATION, 0x0153, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
516    (StartMediaTransmissionAck => START_MEDIA_TRANSMISSION_ACK, 0x0154, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
517    (StartMultimediaTransmissionAck => START_MULTIMEDIA_TRANSMISSION_ACK, 0x0155, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionSelected, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
518    (CallHistoryDisposition => CALL_HISTORY_DISPOSITION, 0x0156, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
519    (LocationInfo => LOCATION_INFO, 0x0157, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(2404), payload_size_bounds: Some(PayloadSizeBounds { minimum: 2404, maximum: 2404 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
520    (MwiResponse => MWI_RESPONSE, 0x0158, ControlToServiceNode, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(32), payload_size_bounds: Some(PayloadSizeBounds { minimum: 32, maximum: 32 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
521    (ExtensionDeviceCapabilities => EXTENSION_DEVICE_CAPABILITIES, 0x0159, StationToControl, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(164), payload_size_bounds: Some(PayloadSizeBounds { minimum: 164, maximum: 164 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
522    (XmlAlarm => XML_ALARM, 0x015a, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::BoundedPreserved, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 2048 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
523    (CallCountRequest => CALL_COUNT_REQ, 0x015e, StationToControl, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::VersionAndLengthSelected, fixed_payload_bytes: None, payload_size_bounds: Some(PayloadSizeBounds { minimum: 0, maximum: 152 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::Message(MessageId::CallCountResponse), verification: ContractVerification::StructuralAndValidated }),
524    (CallCountResponse => CALL_COUNT_RES, 0x015f, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(180), payload_size_bounds: Some(PayloadSizeBounds { minimum: 180, maximum: 180 }), runtime_use: RuntimeUse::RequiredResponse, field_fidelity: FieldFidelity::SemanticProjection("inactive fixed-array line entries are not modeled"), response: ResponseExpectation::None, verification: ContractVerification::StructuralAndValidated }),
525    (RecordingStatus => RECORDING_STATUS, 0x0160, ControlToStation, ContractMetadata { scope: ContractScope::Base, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: None, payload_size_bounds: None, runtime_use: RuntimeUse::ConditionalServerOutput, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
526    (SpcpRegisterTokenRequest => SPCP_REGISTER_TOKEN_REQ, 0x8000, StationToControl, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(36), payload_size_bounds: Some(PayloadSizeBounds { minimum: 36, maximum: 36 }), runtime_use: RuntimeUse::DeviceInput, field_fidelity: FieldFidelity::SemanticProjection("reserved station identifier word is not modeled"), response: ResponseExpectation::OneOf(&[MessageId::SpcpRegisterTokenAck, MessageId::SpcpRegisterTokenReject]), verification: ContractVerification::StructuralAndValidated }),
527    (SpcpRegisterTokenAck => SPCP_REGISTER_TOKEN_ACK, 0x8100, ControlToStation, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(4), payload_size_bounds: Some(PayloadSizeBounds { minimum: 4, maximum: 4 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
528    (SpcpRegisterTokenReject => SPCP_REGISTER_TOKEN_REJECT, 0x8101, ControlToStation, ContractMetadata { scope: ContractScope::Supplemental, codec: CodecSupport::Typed, payload_layout: PayloadLayout::Fixed, fixed_payload_bytes: Some(4), payload_size_bounds: Some(PayloadSizeBounds { minimum: 4, maximum: 4 }), runtime_use: RuntimeUse::TypedButNotEmitted, field_fidelity: FieldFidelity::Lossless, response: ResponseExpectation::None, verification: ContractVerification::Structural }),
529}
530
531#[derive(Clone, Copy, Debug, Eq, PartialEq)]
532pub(crate) enum ObservationSanitization {
533    Preserve,
534    Redact { start: usize, end: usize },
535    SuppressPayload,
536}
537
538pub(crate) fn observation_sanitization(
539    message_id: Option<u32>,
540    protocol_header: Option<u32>,
541) -> ObservationSanitization {
542    let from_version_17 =
543        protocol_header.is_some_and(|version| version >= ProtocolVersion::V17.wire());
544    match (message_id.map(MessageId::from), from_version_17) {
545        (Some(MessageId::OpenReceiveChannel), _) => {
546            ObservationSanitization::Redact { start: 48, end: 80 }
547        }
548        (Some(MessageId::StartMediaTransmission), false) => {
549            ObservationSanitization::Redact { start: 64, end: 96 }
550        }
551        (Some(MessageId::StartMediaTransmission), true) => ObservationSanitization::Redact {
552            start: 80,
553            end: 112,
554        },
555        (Some(MessageId::OpenMultimediaChannel), _) => ObservationSanitization::Redact {
556            start: 128,
557            end: 160,
558        },
559        (Some(MessageId::StartMultimediaTransmission), false) => ObservationSanitization::Redact {
560            start: 132,
561            end: 164,
562        },
563        (Some(MessageId::StartMultimediaTransmission), true) => ObservationSanitization::Redact {
564            start: 148,
565            end: 180,
566        },
567        (
568            Some(
569                MessageId::DeviceToUserData
570                | MessageId::DeviceToUserDataResponse
571                | MessageId::DeviceToUserDataV1
572                | MessageId::DeviceToUserDataResponseV1,
573            ),
574            _,
575        ) => ObservationSanitization::SuppressPayload,
576        _ => ObservationSanitization::Preserve,
577    }
578}
579
580impl fmt::Display for MessageId {
581    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
582        match self {
583            Self::Unknown(value) => write!(f, "Unknown(0x{value:04x})"),
584            known => f.write_str(known.name()),
585        }
586    }
587}
588
589/// Iterates the complete typed implementation inventory in wire-ID order.
590///
591/// Opaque-only contracts are intentionally excluded. To inspect every known
592/// identifier, iterate [`MessageId::ALL_KNOWN`] and call
593/// [`MessageId::contract`] instead.
594pub fn implemented_message_contracts() -> impl Iterator<Item = MessageContract> {
595    MessageId::ALL_CONTRACTS
596        .iter()
597        .copied()
598        .filter(|contract| contract.codec == CodecSupport::Typed)
599}
600
601#[cfg(test)]
602mod tests {
603    use super::*;
604    use sha2::{Digest, Sha256};
605    use std::collections::HashSet;
606
607    #[test]
608    fn known_catalog_values_are_unique_and_round_trip() {
609        let mut values = HashSet::new();
610        for id in MessageId::ALL_KNOWN {
611            assert!(values.insert(id.wire_value()), "duplicate {id}");
612            assert_eq!(MessageId::from(id.wire_value()), *id);
613            assert!(id.route().is_some());
614            assert!(id.is_known());
615        }
616        assert!(MessageId::ALL_KNOWN.len() > 140);
617    }
618
619    #[test]
620    fn supplemental_contract_scope_is_explicit_and_closed() {
621        let supplemental = MessageId::ALL_KNOWN
622            .iter()
623            .copied()
624            .filter(|id| id.contract().unwrap().scope == ContractScope::Supplemental)
625            .collect::<Vec<_>>();
626
627        assert_eq!(
628            supplemental,
629            [
630                MessageId::IpPort,
631                MessageId::MediaPortList,
632                MessageId::SetHookFlashDetect,
633                MessageId::StartMediaReception,
634                MessageId::StopMediaReception,
635                MessageId::EnunciatorCommand,
636                MessageId::ExtensionDeviceCapabilities,
637                MessageId::SpcpRegisterTokenRequest,
638                MessageId::SpcpRegisterTokenAck,
639                MessageId::SpcpRegisterTokenReject,
640            ]
641        );
642    }
643
644    #[test]
645    fn message_contract_catalog_matches_the_golden_snapshot() {
646        let snapshot = MessageId::ALL_KNOWN
647            .iter()
648            .filter_map(|id| id.contract())
649            .map(|contract| format!("{contract:?}\n"))
650            .collect::<String>();
651        let digest = Sha256::digest(snapshot.as_bytes())
652            .iter()
653            .map(|byte| format!("{byte:02x}"))
654            .collect::<String>();
655        assert_eq!(
656            digest,
657            "d8d291836879483d4c9f0773457d847454c9c2bfc296bba6c34c54cf949e7b2b"
658        );
659    }
660
661    #[test]
662    fn unknown_identifiers_remain_lossless() {
663        let id = MessageId::from(0xdead_beef);
664        assert_eq!(id, MessageId::Unknown(0xdead_beef));
665        assert_eq!(id.wire_value(), 0xdead_beef);
666        assert_eq!(id.direction(), None);
667    }
668
669    #[test]
670    fn dtmf_subscription_responses_have_the_device_to_server_direction() {
671        assert_eq!(
672            MessageId::SubscribeDtmfPayloadRequest.direction(),
673            Some(MessageDirection::ServerToDevice)
674        );
675        assert_eq!(
676            MessageId::SubscribeDtmfPayloadResponse.direction(),
677            Some(MessageDirection::DeviceToServer)
678        );
679        assert_eq!(
680            MessageId::UnsubscribeDtmfPayloadRequest.direction(),
681            Some(MessageDirection::ServerToDevice)
682        );
683        assert_eq!(
684            MessageId::UnsubscribeDtmfPayloadResponse.direction(),
685            Some(MessageDirection::DeviceToServer)
686        );
687    }
688
689    #[test]
690    fn every_known_id_has_an_explicit_support_and_runtime_contract() {
691        for id in MessageId::ALL_KNOWN {
692            let contract = id.contract().expect("known ID has a contract");
693            assert_eq!(contract.id, *id);
694            assert_eq!(contract.route, id.route().unwrap());
695            match contract.codec {
696                CodecSupport::Typed => {
697                    assert_eq!(contract.emission, EmissionSupport::Typed);
698                    assert_ne!(contract.runtime_use, RuntimeUse::CatalogOnly);
699                }
700                CodecSupport::OpaqueOnly => {
701                    assert_eq!(contract.emission, EmissionSupport::PreserveOnly);
702                    assert_eq!(contract.runtime_use, RuntimeUse::CatalogOnly);
703                    assert_eq!(contract.payload_layout, PayloadLayout::Opaque);
704                }
705            }
706            match contract.field_fidelity {
707                FieldFidelity::CanonicalServerOutput(detail) => {
708                    assert!(matches!(
709                        contract.route,
710                        MessageRoute::ControlToStation
711                            | MessageRoute::ControlToServiceNode
712                            | MessageRoute::IntraControl
713                    ));
714                    assert!(!detail.is_empty());
715                }
716                FieldFidelity::SemanticProjection(detail) => {
717                    assert_eq!(contract.codec, CodecSupport::Typed);
718                    assert!(!detail.is_empty());
719                }
720                FieldFidelity::OpaquePreserved => {
721                    assert_eq!(contract.codec, CodecSupport::OpaqueOnly);
722                }
723                FieldFidelity::Lossless => {}
724            }
725        }
726        assert!(implemented_message_contracts().count() > 100);
727
728        for id in [
729            MessageId::OpenReceiveChannel,
730            MessageId::StartMediaTransmission,
731            MessageId::StartMediaTransmissionAck,
732            MessageId::KeypadButton,
733            MessageId::EnblocCall,
734            MessageId::Alarm,
735            MessageId::DefineTimeDate,
736        ] {
737            assert_eq!(
738                id.contract().unwrap().field_fidelity,
739                FieldFidelity::Lossless
740            );
741        }
742    }
743
744    #[test]
745    fn semantic_field_fidelity_overclaims_are_explicitly_excluded() {
746        for (id, omitted) in [
747            (MessageId::LineStatus, "display label"),
748            (MessageId::CallInfo, "mailboxes"),
749            (MessageId::CallState, "visibility"),
750        ] {
751            let FieldFidelity::CanonicalServerOutput(detail) =
752                id.contract().unwrap().field_fidelity
753            else {
754                panic!("{id} must not claim lossless field fidelity");
755            };
756            assert!(detail.contains(omitted), "{id}: {detail}");
757        }
758
759        for id in [MessageId::ConfigStatus, MessageId::ConfigStatusDynamic] {
760            assert_eq!(
761                id.contract().unwrap().field_fidelity,
762                FieldFidelity::Lossless
763            );
764        }
765
766        for id in [
767            MessageId::CapabilitiesResponse,
768            MessageId::MediaTransmissionFailure,
769            MessageId::PortResponse,
770            MessageId::Register,
771        ] {
772            assert!(matches!(
773                id.contract().unwrap().field_fidelity,
774                FieldFidelity::SemanticProjection(_)
775            ));
776        }
777    }
778
779    #[test]
780    fn variable_layout_messages_never_claim_one_fixed_payload_size() {
781        for contract in MessageId::ALL_KNOWN.iter().filter_map(|id| id.contract()) {
782            if matches!(
783                contract.payload_layout,
784                PayloadLayout::VersionSelected
785                    | PayloadLayout::VersionAndLengthSelected
786                    | PayloadLayout::BoundedPreserved
787            ) {
788                assert_eq!(
789                    contract.fixed_payload_bytes, None,
790                    "{} has a variable payload layout",
791                    contract.id
792                );
793            }
794        }
795    }
796
797    #[test]
798    fn bounded_and_counted_payload_contracts_report_their_wire_limits() {
799        for id in [
800            MessageId::KeepAlive,
801            MessageId::ConfigStatusRequest,
802            MessageId::ButtonTemplateRequest,
803            MessageId::KeepAliveAck,
804        ] {
805            assert_eq!(
806                id.contract().unwrap().payload_size_bounds,
807                Some(PayloadSizeBounds {
808                    minimum: 0,
809                    maximum: MAX_FRAME_SIZE - HEADER_SIZE,
810                }),
811                "{id}"
812            );
813        }
814
815        let capabilities = MessageId::CapabilitiesResponse.contract().unwrap();
816        assert_eq!(
817            capabilities.payload_layout,
818            PayloadLayout::VersionAndLengthSelected
819        );
820        assert_eq!(capabilities.fixed_payload_bytes, None);
821        assert_eq!(
822            capabilities.payload_size_bounds,
823            Some(PayloadSizeBounds {
824                minimum: 4,
825                maximum: 388,
826            })
827        );
828
829        for (id, minimum, maximum) in [
830            (MessageId::EnblocCall, 24, 32),
831            (MessageId::OnHook, 0, 8),
832            (MessageId::ConnectionStatisticsResponse, 61, 668),
833        ] {
834            assert_eq!(
835                id.contract().unwrap().payload_size_bounds,
836                Some(PayloadSizeBounds { minimum, maximum }),
837                "{id}"
838            );
839        }
840
841        let on_hook = MessageId::OnHook.contract().unwrap();
842        assert_eq!(
843            on_hook.payload_layout,
844            PayloadLayout::VersionAndLengthSelected
845        );
846        assert_eq!(
847            on_hook.field_fidelity,
848            FieldFidelity::SemanticProjection("fieldless form omits line and call identity")
849        );
850
851        let call_count = MessageId::CallCountRequest.contract().unwrap();
852        assert_eq!(
853            call_count.payload_layout,
854            PayloadLayout::VersionAndLengthSelected
855        );
856        assert_eq!(
857            call_count.payload_size_bounds,
858            Some(PayloadSizeBounds {
859                minimum: 0,
860                maximum: 152,
861            })
862        );
863
864        let call_count_response = MessageId::CallCountResponse.contract().unwrap();
865        assert_eq!(call_count_response.payload_layout, PayloadLayout::Fixed);
866        assert_eq!(call_count_response.fixed_payload_bytes, Some(180));
867        assert_eq!(
868            call_count_response.payload_size_bounds,
869            Some(PayloadSizeBounds {
870                minimum: 180,
871                maximum: 180,
872            })
873        );
874
875        let version_two = MessageId::UpdateCapabilitiesV2.contract().unwrap();
876        assert_eq!(version_two.payload_layout, PayloadLayout::Fixed);
877        assert_eq!(version_two.fixed_payload_bytes, Some(2_000));
878
879        let version_three = MessageId::UpdateCapabilitiesV3.contract().unwrap();
880        assert_eq!(
881            version_three.payload_layout,
882            PayloadLayout::MinimumLengthPreserved
883        );
884        assert_eq!(
885            version_three.payload_size_bounds,
886            Some(PayloadSizeBounds {
887                minimum: 20,
888                maximum: 2_380,
889            })
890        );
891    }
892
893    #[test]
894    fn service_message_payload_bounds_are_explicit() {
895        assert_eq!(
896            MessageId::XmlAlarm.contract().unwrap().payload_size_bounds,
897            Some(PayloadSizeBounds {
898                minimum: 0,
899                maximum: 2_048,
900            })
901        );
902        assert_eq!(
903            MessageId::AddParticipantResponse
904                .contract()
905                .unwrap()
906                .payload_size_bounds,
907            Some(PayloadSizeBounds {
908                minimum: 12,
909                maximum: 272,
910            })
911        );
912
913        for (id, size) in [
914            (MessageId::AuditConferenceRequest, 0),
915            (MessageId::SubscribeDtmfPayloadRequest, 16),
916            (MessageId::SubscribeDtmfPayloadResponse, 12),
917            (MessageId::SubscribeDtmfPayloadError, 12),
918            (MessageId::UnsubscribeDtmfPayloadRequest, 16),
919            (MessageId::UnsubscribeDtmfPayloadResponse, 12),
920            (MessageId::UnsubscribeDtmfPayloadError, 12),
921        ] {
922            assert_eq!(
923                id.contract().unwrap().payload_size_bounds,
924                Some(PayloadSizeBounds {
925                    minimum: size,
926                    maximum: size,
927                }),
928                "{id}"
929            );
930        }
931    }
932
933    #[test]
934    fn media_contracts_record_fixed_and_version_selected_sizes() {
935        for id in [
936            MessageId::OpenMultimediaReceiveChannelAck,
937            MessageId::StartMultimediaTransmissionAck,
938            MessageId::StartSessionTransmission,
939            MessageId::StopSessionTransmission,
940            MessageId::OpenMultimediaChannel,
941            MessageId::StartMultimediaTransmission,
942            MessageId::PortRequest,
943            MessageId::PortClose,
944        ] {
945            let contract = id.contract().unwrap();
946            assert_eq!(contract.payload_layout, PayloadLayout::VersionSelected);
947            assert_eq!(contract.fixed_payload_bytes, None);
948        }
949
950        for (id, size) in [
951            (MessageId::MulticastMediaReceptionAck, 12),
952            (MessageId::CloseReceiveChannel, 16),
953            (MessageId::StopMediaTransmission, 16),
954            (MessageId::MiscellaneousCommand, 52),
955            (MessageId::QosReservationNotify, 24),
956            (MessageId::QosErrorNotify, 44),
957            (MessageId::QosListen, 172),
958            (MessageId::QosPath, 168),
959            (MessageId::QosTeardown, 24),
960            (MessageId::UpdateDscp, 24),
961            (MessageId::QosModify, 152),
962        ] {
963            assert_eq!(id.contract().unwrap().fixed_payload_bytes, Some(size));
964        }
965
966        assert_eq!(
967            MessageId::StartMediaTransmissionAck
968                .contract()
969                .unwrap()
970                .payload_layout,
971            PayloadLayout::VersionAndLengthSelected
972        );
973        assert_eq!(
974            MessageId::LocationInfo
975                .contract()
976                .unwrap()
977                .payload_size_bounds,
978            Some(PayloadSizeBounds {
979                minimum: 2_404,
980                maximum: 2_404,
981            })
982        );
983        for id in [
984            MessageId::CloseReceiveChannel,
985            MessageId::StopMediaTransmission,
986        ] {
987            assert_eq!(
988                id.contract().unwrap().field_fidelity,
989                FieldFidelity::Lossless
990            );
991        }
992    }
993
994    #[test]
995    fn session_transmission_contracts_use_the_service_node_codec() {
996        for id in [
997            MessageId::StartSessionTransmission,
998            MessageId::StopSessionTransmission,
999        ] {
1000            let contract = id.contract().unwrap();
1001            assert_eq!(contract.route, MessageRoute::ControlToServiceNode);
1002            assert_eq!(contract.codec, CodecSupport::Typed);
1003            assert_eq!(contract.emission, EmissionSupport::Typed);
1004            assert_eq!(contract.runtime_use, RuntimeUse::TypedButNotEmitted);
1005            assert_eq!(contract.field_fidelity, FieldFidelity::Lossless);
1006            assert_eq!(contract.payload_layout, PayloadLayout::VersionSelected);
1007        }
1008    }
1009
1010    #[test]
1011    fn supplemental_token_messages_are_typed() {
1012        for (id, size) in [
1013            (MessageId::SpcpRegisterTokenRequest, 36),
1014            (MessageId::SpcpRegisterTokenAck, 4),
1015            (MessageId::SpcpRegisterTokenReject, 4),
1016        ] {
1017            let contract = id.contract().unwrap();
1018            assert_eq!(contract.codec, CodecSupport::Typed);
1019            assert_eq!(contract.emission, EmissionSupport::Typed);
1020            assert_eq!(contract.payload_layout, PayloadLayout::Fixed);
1021            assert_eq!(contract.fixed_payload_bytes, Some(size));
1022        }
1023
1024        assert_eq!(
1025            MessageId::SpcpRegisterTokenRequest
1026                .contract()
1027                .unwrap()
1028                .response,
1029            ResponseExpectation::OneOf(&[
1030                MessageId::SpcpRegisterTokenAck,
1031                MessageId::SpcpRegisterTokenReject,
1032            ])
1033        );
1034    }
1035
1036    #[test]
1037    fn runtime_emission_is_distinct_from_typed_encodability() {
1038        let dtmf = MessageId::SubscribeDtmfPayloadRequest.contract().unwrap();
1039        assert_eq!(dtmf.codec, CodecSupport::Typed);
1040        assert_eq!(dtmf.emission, EmissionSupport::Typed);
1041        assert_eq!(dtmf.runtime_use, RuntimeUse::TypedButNotEmitted);
1042
1043        let open = MessageId::OpenReceiveChannel.contract().unwrap();
1044        assert_eq!(open.runtime_use, RuntimeUse::ConditionalServerOutput);
1045        assert_eq!(
1046            open.response,
1047            ResponseExpectation::Message(MessageId::OpenReceiveChannelAck)
1048        );
1049
1050        assert_eq!(
1051            MessageId::StartMediaTransmission
1052                .contract()
1053                .unwrap()
1054                .response,
1055            ResponseExpectation::OptionalMessage(MessageId::StartMediaTransmissionAck)
1056        );
1057
1058        for id in [
1059            MessageId::MiscellaneousCommand,
1060            MessageId::FlowControlCommand,
1061            MessageId::FlowControlNotify,
1062        ] {
1063            assert_eq!(
1064                id.contract().unwrap().runtime_use,
1065                RuntimeUse::ConditionalServerOutput
1066            );
1067        }
1068
1069        for (id, response, runtime_use) in [
1070            (
1071                MessageId::OpenMultimediaChannel,
1072                MessageId::OpenMultimediaReceiveChannelAck,
1073                RuntimeUse::ConditionalServerOutput,
1074            ),
1075            (
1076                MessageId::StartMultimediaTransmission,
1077                MessageId::StartMultimediaTransmissionAck,
1078                RuntimeUse::ConditionalServerOutput,
1079            ),
1080        ] {
1081            let contract = id.contract().unwrap();
1082            assert_eq!(contract.route, MessageRoute::ControlToStation);
1083            assert_eq!(contract.codec, CodecSupport::Typed);
1084            assert_eq!(contract.emission, EmissionSupport::Typed);
1085            assert_eq!(contract.runtime_use, runtime_use);
1086            assert_eq!(contract.field_fidelity, FieldFidelity::Lossless);
1087            assert_eq!(contract.payload_layout, PayloadLayout::VersionSelected);
1088            assert_eq!(contract.response, ResponseExpectation::Message(response));
1089        }
1090    }
1091
1092    #[test]
1093    fn dynamic_response_contracts_include_every_session_selector() {
1094        for (request, before, from) in [
1095            (
1096                MessageId::ConfigStatusRequest,
1097                MessageId::ConfigStatus,
1098                MessageId::ConfigStatusDynamic,
1099            ),
1100            (
1101                MessageId::LineStatusRequest,
1102                MessageId::LineStatus,
1103                MessageId::LineStatusDynamic,
1104            ),
1105            (
1106                MessageId::ServiceUrlStatusRequest,
1107                MessageId::ServiceUrlStatus,
1108                MessageId::ServiceUrlStatusDynamic,
1109            ),
1110            (
1111                MessageId::SpeedDialStatusRequest,
1112                MessageId::SpeedDialStatus,
1113                MessageId::SpeedDialStatusDynamic,
1114            ),
1115        ] {
1116            assert_eq!(
1117                request.contract().unwrap().response,
1118                ResponseExpectation::SessionSelected {
1119                    before,
1120                    from,
1121                    selector: SessionResponseSelector::DynamicMessagesOrProtocol {
1122                        minimum_protocol: 9,
1123                    },
1124                }
1125            );
1126        }
1127
1128        assert_eq!(
1129            MessageId::FeatureStatusRequest.contract().unwrap().response,
1130            ResponseExpectation::SessionSelected {
1131                before: MessageId::FeatureStatus,
1132                from: MessageId::FeatureStatusDynamic,
1133                selector: SessionResponseSelector::DynamicMessages,
1134            }
1135        );
1136    }
1137}