Media Gateway Control Protocol
|Internet protocol suite|
The Media Gateway Control Protocol (MGCP) is a signaling and call control communications protocol used in voice over IP (VoIP) telecommunication systems. It implements the media gateway control protocol architecture for controlling media gateways on Internet Protocol (IP) networks connected to the public switched telephone network (PSTN). The protocol is a successor to the Simple Gateway Control Protocol (SGCP), which was developed by Bellcore and Cisco, and the Internet Protocol Device Control (IPDC).
The methodology of MGCP reflects the structure of the PSTN with the power of the network residing in a call control center softswitch which is analogous to the central office in the telephone network. The endpoints are low-intelligence devices, mostly executing control commands and providing result indications in response. The protocol represents a decomposition of other VoIP models, such as H.323, in which the H.323 Gatekeeper, have higher levels of signaling intelligence.
MGCP is a text-based protocol consisting of commands and responses. It uses the Session Description Protocol (SDP) for specifying and negotiating the media streams to be transmitted in a call session and the Real-time Transport Protocol (RTP) for framing the media streams.
MGCP is a master/slave protocol that allows a call control device such as a Call Agent to take control of a specific port on a media gateway. In MGCP context media gateway controller is referred to as call agent. This has the advantage of centralized gateway administration and provides for largely scalable IP Telephony solutions. The distributed system is composed of a call agent, at least one media gateway (MG) that performs the conversion of media signals between circuits and packets switched networks, and at least one signaling gateway (SG) when connected to the PSTN.
MGCP assumes a call control architecture where there is limited intelligence at the edge (endpoints, media gateways) and intelligence at the core Call Agent. The MGCP assumes that Call Agents, will synchronize with each other to send coherent commands and responses to the gateways under their control.
The Call Agent uses MGCP to tell the media gateway which events should be reported to the Call Agent, how endpoints should be inter-connected, and which signals should be activated on the endpoints.
MGCP also allows the Call Agent to audit the current state of endpoints on a media gateway.
The media gateway uses MGCP to report events, such as off-hook or dialed digits, to the Call Agent.
While any signaling gateway is usually on the same physical switch as a media gateway, there is no such need. The Call Agent does not use MGCP to control the Signaling Gateway; rather, SIGTRAN protocols are used to backhaul signaling between the Signaling Gateway and Call Agent.
Multiple call agents
Typically, a media gateway is configured with a list of Call Agents from which it may accept programming (where that list normally comprises only one or two Call Agents).
In principle, event notifications may be sent to different Call Agents for each endpoint on the gateway (as programmed by the Call Agents, by setting the NotifiedEntity parameter). In practice, however, it is usually desirable that at any given moment all endpoints on a gateway should be controlled by the same Call Agent; other Call Agents are available only to provide redundancy in the event that the primary Call Agent fails, or loses contact with the media gateway. In the event of such a failure it is the backup Call Agent's responsibility to reprogram the MG so that the gateway comes under the control of the backup Call Agent. Care is needed in such cases; two Call Agents may know that they have lost contact with one another, but this does not guarantee that they are not both attempting to control the same gateway. The ability to audit the gateway to determine which Call Agent is currently controlling can be used to resolve such conflicts.
MGCP assumes that the multiple Call Agents will maintain knowledge of device state among themselves (presumably with an unspecified protocol) or rebuild it if necessary (in the face of catastrophic failure). Its failover features take into account both planned and unplanned outages.
MGCP recognizes three essential elements of communication, the media gateway controller (call agent), the media gateway endpoint, and connections between these entities. A media gateway may host multiple endpoints and each endpoint should be able to engage in multiple connections. Multiple connections on the endpoints support calling features such as call waiting and three-way calling.
MGCP is a text-based protocol using a command and response model. Commands and responses are encoded in messages that are structured and formatted with the whitespace characters space, horizontal tab, carriage return, and linefeed, and the colon and the full stop. Messages are transmitted using the User Datagram Protocol (UDP). Media gateways use the port number 2427, and call agents use 2727 by default.
The message sequence of command (or request) and its response is known as a transaction, which is identified by the numerical Transaction Identifier exchanged in each transaction. The protocol specification defines nine standard commands that are distinguished by a four-letter command verb: AUEP, AUCX, CRCX, DLCX, EPCF, MDCX, NTFY, RQNT, and RSIP. Responses begin with a three-digit numerical response code that identifies the outcome or result of the transaction.
Two verbs are used by a call agent to query the state of an endpoint:
- AUEP: Audit Endpoint
- AUCX: Audit Connection
Three verbs are used by a call agent to manage the connection between a media gateway.
- CRCX: Create Connection
- DLCX: Delete Connection. An endpoint may also terminate a connection with this command.
- MDCX: Modify Connection
One verb is used by a call agent to request notification of events on the endpoint, and to apply signals:
- RQNT: Request for Notification
One verb is used by a call agent to modify coding characteristics expected by the line side of the endpoint:
- EPCF: Endpoint Configuration
One verb is used by an endpoint to indicate to the call agent that it has detected an event for which the call agent had previously requested notification with the RQNT command:
- NTFY: Notify
One verb is used by an endpoint to indicate to the call agent that it is in the process of restarting:
- RSIP: Restart In Progress
- RFC 3435 - Media Gateway Control Protocol (MGCP) Version 1.0 (this supersedes RFC 2705)
- RFC 3660 - Basic Media Gateway Control Protocol (MGCP) Packages (informational)
- RFC 3661 - Media Gateway Control Protocol (MGCP) Return Code Usage
- RFC 3064 - MGCP CAS Packages
- RFC 3149 - MGCP Business Phone Packages
- RFC 3991 - Media Gateway Control Protocol (MGCP) Redirect and Reset Package
- RFC 3992 - Media Gateway Control Protocol (MGCP) Lockstep State Reporting Mechanism (informational)
- RFC 2805 - Media Gateway Control Protocol Architecture and Requirements
- RFC 2897 - Proposal for an MGCP Advanced Audio Package
Another implementation of the media gateway control protocol architecture is the H.248/Megaco protocol, a collaboration of the Internet Engineering Task Force (RFC 3525) and the International Telecommunication Union (Recommendation H.248.1). Both protocols follow the guidelines of the overlying media gateway control protocol architecture, as described in RFC 2805. However, the protocols are incompatible due to differences in protocol syntax and underlying connection model.
- RFC 2805, Media Gateway Control Protocol Architecture and Requirements, N. Greene, M. Ramalho, B. Rosen, IETF, April 2000
- "Level 3 Communications, Bellcore Announce Merger of Protocol Specifications for Voice Over IP". Level 3 Communications. Retrieved 8 June 2012.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
- RFC 2805, Media Gateway Control Protocol Architecture and Requirements, N. Greene, M. Ramalho, B. Rosen, The Internet Society (April 2000)