Skip to main content

Module server

Module server 

Source
Expand description

Stateful SCCP station-session boundary.

A successful socket write or TCP acknowledgement proves only transport delivery. Media and other correlated operations remain provisional until the station sends the matching SCCP response. Every new media transaction gets a fresh nonzero wire token (a deliberately coupled ORC/SMT pair shares one), and the session accepts an acknowledgement only for the exact direction and current request generation. The zero-party acknowledgement fallback is limited to the first generation, where the stable call reference still makes it unambiguous; reopened media fails closed instead of letting an old acknowledgement settle a new request. Deadlines retire that same generation before a late response is considered. Handset presentation, receive media, transmit media, and call ownership are therefore separate states rather than one broad “connected” flag.

One explicit wire exception writes OpenReceiveChannel and StartMediaTransmission together for coupled outbound NAT media. A matching successful receive acknowledgement atomically settles both halves and emits DeviceEventKind::TransmitChannelImplied; ordinary staged media never infers transmit success from a receive acknowledgement. Close, failure, timeout, disconnect, and replacement paths retire the coupled transaction.

§Runtime workflow

Server::bind creates a plain TCP listener, while Server::with_ingress lets a transport owner inject clear or already decrypted streams through ServerIngress. Both constructors return a ServerHandle for commands and a bounded Event receiver for handset input and session outcomes. The caller must run Server::run for any of those channels to make progress and should consume events continuously so a full event queue cannot apply backpressure to station sessions.

A station becomes addressable by Command only after registration has selected a configured DeviceDefinition and emitted DeviceEventKind::Registered. Call adapters reserve or receive a CallId, send commands through the handle, and react to correlated media acknowledgements delivered as device events. ServerHandle::send confirms queue admission; ServerHandle::send_confirmed additionally waits for the complete encoded command to reach the station stream. Neither operation substitutes for a protocol acknowledgement when the command defines one.

Reconfiguration replaces definitions atomically and disconnects only the sessions named by ReconfigureResult or explicitly marked as affected. ServerHandle::shutdown asks the run loop to disconnect all sessions and finish. Dropping every handle also closes the command channel and causes the same orderly exit.

Structs§

AnonymousHotlineDefinition
Restricted definition used to admit an otherwise unknown station as a single-line hotline device.
Command
One station-targeted operation submitted through ServerHandle.
DeviceEvent
One station-scoped item in the server event stream.
IncomingRing
Audible presentation to apply to a newly offered incoming call.
MediaStatisticsSnapshot
One fully correlated, privacy-safe station media snapshot retained independently of call teardown. The firmware-specific quality payload remains opaque and is represented only by its bounded byte count.
MulticastMediaRoute
Network and framing policy for one station multicast audio direction.
MultimediaReceiveDescriptor
Complete application-owned description of one station video receive flow.
MultimediaTransmitDescriptor
Complete application-owned description of one station video transmit flow.
ParkingMenuEntry
One selectable parked call rendered by the station parking application.
ReconfigureResult
The station definitions changed by one atomic server reconfiguration.
RegistrationTokenPolicy
Policy applied when a station probes this server while registered elsewhere.
Server
Stateful owner of station admission, registration, command dispatch, and event correlation.
ServerConfig
Immutable policy shared by every session owned by one Server.
ServerHandle
Cloneable command and management endpoint for a running Server.
ServerIngress
Cloneable admission endpoint returned by super::Server::with_ingress.
SignalingServerRoute
One configured server and the ports available for each signaling transport.
SignalingSocket
Clone of a TCP socket retained independently of its clear or TLS stream.
SocketQosFailure
One failed marking operation.
SocketQosReport
Independent results from applying every supported socket mark.
VideoPictureReference
Picture identity carried by recovery feedback.
VideoPictureReferences
A recovery request’s bounded ordered picture-reference list.

Enums§

CallSelectionOrder
Ordering used when a station asks to answer without identifying a call.
CommandAction
Operation applied to the target station session in command-queue order.
DeviceEventKind
State transitions and handset input produced by one station session.
DoNotDisturbButtonMode
Behavior selected for one do-not-disturb feature button.
DoNotDisturbMode
Device-wide do-not-disturb state rendered by configured feature buttons.
Event
Output emitted by the running server to its integration adapter.
HandsetAcknowledgement
Station acknowledgement whose correlation deadline expired.
HandsetStatusMessage
Device-wide status-line mutation.
MultimediaTransmitControl
Parameters for one command applied to an exact live station video encoder.
RegistrationFallback
Decision applied to a pre-registration token probe after station and transport eligibility have been established.
ServerError
Failure returned by server construction, command submission, session I/O, or stateful command validation.
SocketQosMark
A socket option that could not be applied.

Constants§

HANDSET_ACKNOWLEDGEMENT_TIMEOUT
Maximum time a phone may leave an ordering-sensitive media command unacknowledged before the call owner is notified and the stale correlation state is retired.
MAX_REGISTRATION_BACKOFF
Longest retry delay accepted for a rejected registration token.
MIN_REGISTRATION_BACKOFF
Shortest retry delay accepted for a rejected registration token.
ORDERING_ACKNOWLEDGEMENT_TIMEOUT
Bound for the writer acknowledgement used to serialize commands whose resources must remain owned until their complete frame reaches the socket.
PARKING_MENU_MAX_ITEMS
Maximum number of parked calls rendered in one station selection menu.

Traits§

SocketQosPolicy
Typed socket-marking values accepted by the shared platform adapter.
StationIo
Bidirectional asynchronous byte stream accepted by a station session.
StationSocketQos
Session-owned capability for changing the underlying signaling socket.

Functions§

apply_socket_qos
Apply typed marking policy to a borrowed socket without taking ownership.