Megaco Protocol Version 1.0
Extracted elements (29)
The connection model separates Terminations (sources/sinks of media) from Contexts (their associations), allowing a single MGC to manage complex topologies such as conferencing, call-waiting, and hold by moving Terminations between Contexts atomically, without re-establishing bearers.
The protocol is defined as common text with ITU-T Recommendation H.248, enabling a single specification to serve both IETF and ITU-T standardization tracks. This dual-standardization approach was chosen to facilitate global interoperability between internet-side and PSTN/SCN-side equipment from different vendors.
In text encoding, Local and Remote descriptors consist of SDP session descriptions (RFC 2327). Exceptions allowed in MGC-to-MG direction: 's=', 't=', and 'o=' lines are optional; CHOOSE and alternative value lists may replace single parameter values. Implementations SHALL accept fully RFC 2327-conformant session descriptions.
Transport over UDP uses Application Level Framing (ALF) with at-most-once delivery semantics enforced by transaction identifiers and a three-way handshake. Retransmission timers are computed adaptively. Transport over TCP provides ordering and reliability natively, with different provisional-response and retransmission considerations (Annex D).
A Termination SHALL exist in only one Context at a time. It may be moved atomically between Contexts using the Move command.
Cold start: upon startup, an MG sends a ServiceChange command with method 'Boot' to the MGC to announce its availability (registration). The MGC reply may provide protocol version and alternative MGC address information for subsequent communication.
No wildcard SHALL be used in a SignalID within a SignalsDescriptor. If a replacement SignalsDescriptor contains a signal with the KeepActive flag that is not currently playing, that signal SHALL be ignored.
Only one level of EventsDescriptor embedding is permitted: an embedded EventsDescriptor SHALL NOT contain another embedded EventsDescriptor. An embedded EventsDescriptor may contain an embedded SignalsDescriptor. A MGC SHALL NOT send an EventsDescriptor with an event both marked KeepActive and containing an embedded SignalsDescriptor.
Protection against restart avalanche: when an MG restarts and must register with an MGC, it SHOULD delay its ServiceChange(Boot) by a random interval to prevent simultaneous flooding of the MGC by many MGs restarting concurrently.
The MG SHALL include mandatory properties and their values in its response to Local/Remote descriptors even when those properties were absent from the MGC's request (e.g., detailed video encoding parameters when only payload type was specified). A new Local or Remote Descriptor completely replaces the prior setting.
When ReserveGroup or ReserveValue is True, the MG SHALL reserve resources for all alternatives it can support and SHALL return an empty Local or Remote descriptor if it cannot support any alternative within that descriptor. When both are False, the MG SHOULD choose the first supportable Local alternative paired with a supportable Remote, returning Error 510 (Insufficient Resources) if none is possible.
A Context is an association between a collection of Terminations that describes the topology (who hears/sees whom) and media mixing/switching parameters. A special null Context contains all Terminations not associated with any other Termination; idle lines in a decomposed access gateway are represented there.
A DigitMap is a dialing plan resident in the MG for detecting and reporting digit events. Digit collection is governed by three configurable timers: start timer T (started before any digit is dialed), long interdigit timer L (applied when at least one more digit is needed for any pattern match), and short timer S (applied when a complete match exists but additional digits could yield a different match).
A Termination is a logical entity on a MG that sources and/or sinks media and/or control streams. Terminations are either physical (semi-permanent, e.g., TDM channels) or ephemeral (e.g., RTP flows created by Add and destroyed by Subtract), uniquely identified by TerminationIDs assigned by the MG.
Eight commands are defined: Add (add Termination to Context, creating a new Context if none specified), Modify (change properties/events/signals), Subtract (disconnect and return statistics, deleting Context when last Termination removed), Move (atomic relocation), AuditValue (query current state), AuditCapabilities (query possible values), Notify (MG-to-MGC event report), and ServiceChange (registration, restart, in/out-of-service).
Packages group optional Properties, Events, Signals, and Statistics to accommodate widely differing Termination types. An MGC can audit a Termination to determine which Packages it realizes; identifiers within a Package are scoped to separate namespaces (PropertyIds, EventIds, SignalIds, StatisticsIds, ParameterIds).
Protocol version negotiation is performed via the ServiceChange command at cold start. The MG proposes a version; the MGC may accept or reply with a different supported version. The negotiated version governs all subsequent messages in the session.
TerminationIDs support two wildcards: ALL (applies the command to every matching Termination, with responses optionally merged via UNION suppressing duplicates) and CHOOSE (instructs the MG to select any qualifying Termination within a partially specified ID, e.g., any circuit in a trunk group).
The LocalControl Descriptor contains the Mode property (send-only, receive-only, send/receive, inactive, loop-back — relative to the exterior of the Context) and the boolean ReserveValue and ReserveGroup properties governing how the MG reserves resources for over-specified media alternatives. Signals and Events are unaffected by mode.
The Root Termination is a reserved TerminationID that refers to the entire gateway. It may appear in Modify, Notify, AuditValue, AuditCapabilities, and ServiceChange commands; any other use is an error. Packages may be defined on Root, giving it properties, events, and statistics, but not signals.
Three signal types are defined in the Signals Descriptor: on/off (lasts until explicitly stopped), timeout (lasts until stopped or a configurable duration elapses; duration is an integer in hundredths of a second), and brief (self-terminating; no timeout needed). Multiple signals and sequential signal lists in the same SignalsDescriptor are played simultaneously.
Transactions group one or more Commands and are the unit of reliable exchange. Three message types are defined: TransactionRequest (carries commands), TransactionReply (carries results including error codes), and TransactionPending (acknowledges receipt while processing continues, to prevent premature retransmission).
IANA maintains a Megaco Packages registry (section 13.1) for package identifiers and descriptions, an Error Codes registry (section 13.2) for protocol error codes and their meanings, and a ServiceChange Reasons registry (section 13.3) for reason codes used in ServiceChange commands.
An interim authentication scheme based on IP Authentication Header (RFC 2402) is defined for environments where full IPsec deployment is impractical. It provides per-message authentication using a shared secret covering the entire Megaco message content.
Media connections between MGs require independent protection from the control channel. The MGC may negotiate media-level security by conveying keying material and security parameters through the Local and Remote descriptors of the affected Terminations.
Protocol connections between MG and MGC SHOULD be protected using IPsec AH or ESP to provide authentication, integrity, and optionally confidentiality. AH alone is sufficient when encryption is not required; ESP provides both integrity and encryption.
EventBufferControl (in TerminationState Descriptor) governs post-detection event handling. In LockStep mode, after detecting a recognized event the MG suspends normal event processing, buffers subsequent events in a FIFO queue, and waits for a new EventsDescriptor; buffered events are replayed FIFO against the new descriptor. In Off mode (default), the MG continues immediately with the active EventsDescriptor.
The TerminationState Descriptor's ServiceStates property defines three states: 'in service' (default; available for normal traffic), 'out of service' (cannot carry traffic), and 'test' (under testing). Transitions are driven by MGC commands or MG-initiated ServiceChange.
The protocol defines two normative, fully equivalent encodings: binary using ASN.1 BER (Annex A, with ASN.1 module provided) and text using ABNF (Annex B). Both encodings share the same connection model semantics; implementations select one encoding per deployment.