Implementing MGCP Gateways (Examining VoIP Gateways and Gateway Control Protocols) Part 1

The MGCP enables the remote control and management of voice and data communications devices at the edge of multiservice IP packet networks. Because of its centralized architecture, MGCP overcomes the distributed configuration and administration problems inherent in the use of protocols such as H.323. This section describes how to configure MGCP on a gateway and describes the features and functions of the MGCP environment.

MGCP Overview

MGCP is a protocol used within a distributed VoIP system. MGCP is defined in RFC 3435, which obsoletes an earlier definition in RFC 2705. Another protocol used for the same purpose is Megaco, a coproduction of Internet Engineering Task Force (IETF) (RFC 3525) and ITU (Recommendation H.248-1). Both protocols follow the guidelines of the API Media Gateway Control Protocol Architecture and Requirements at RFC 2805.

These IETF standards describe MGCP as a centralized device control protocol with simple endpoints. The MGCP protocol allows a central control component, or call agent, to remotely control various devices. This protocol is referred to as a stimulus protocol because the endpoints and gateways cannot function alone. MGCP incorporates the IETF Session Description Protocol (SDP) to describe the type of session to initiate.

MGCP is an extension of the earlier version of Simple Gateway Control Protocol (SGCP) and supports SGCP functionality in addition to several enhancements. Systems using SGCP can easily migrate to MGCP, and MGCP commands are available to enable SGCP capabilities.


MGCP is a plaintext protocol that uses a server-to-client relationship between the call agent and the gateway to fully control the gateway and its associated ports. The plaintext commands are sent to gateways from the call agent using UDP port 2427. Port 2727 is used to send messages from the gateways to the call agent.

An MGCP gateway handles translation between audio signals and a packet network. Gateways interact with a call agent (CA), also called a Media Gateway Controller (MGC), that performs signal and call processing on gateway calls. In the MGCP configurations that Cisco IOS supports, a gateway can be a Cisco router, access server, or cable modem, and the CA is a server from a third-party vendor.

Configuration commands for MGCP define the path between the call agent and the gateway, the type of gateway, and the type of calls handled by the gateway.

MGCP uses endpoints and connections to construct a call. Endpoints are sources or destinations for data and can be physical or logical locations in a device. Connections can be point-to-point or multipoint.

Similar to SGCP, MGCP uses UDP for establishing audio connections over IP networks. However, MGCP also uses "hairpinning" to return a call to the PSTN when the packet network is not available.

Why MGCP

There are several advantages to using MGCP controlled gateways as voice gateways:

■ Alternative dial tone for VoIP environments: Deregulation in the telecommunications industry gives Competitive Local-Exchange Carriers (CLECs) opportunities to provide toll-bypass from the Incumbent Local-Exchange Carriers (ILECs) by means of VoIP. MGCP enables a VoIP system to control call setup and teardown and Custom Local Area Subscriber Services (CLASS) features for less-sophisticated gateways.

■ Simplified configuration for static VoIP network dial peers: When you use MGCP as the call agent in a VoIP environment, you need not configure static VoIP network dial peers. The MGCP call agent provides functions similar to VoIP-network dial peers.

Note POTS dial-peer configuration is still required.

■ Migration paths: Systems using earlier versions of the protocol can easily migrate to MGCP.

■ Centralized dial plan configured on Cisco Unified Communications Manager: A  centralized dial plan configuration on Cisco UBE enables you to handle and manage the entire dial plan configuration on Cisco Unified Communications Manager cluster within a multisite network. This simplifies the management and troubleshooting of a company telephone network.

■ Centralized gateway configuration on Cisco Unified Communications Manager:

As in the case of the dial plan, centralized gateway configurations for all gateways are managed via one central configuration page, which simplifies the management and troubleshooting of a company telephony network.

Note Some network management tools do not work correctly when performing the configuration via Cisco Unified Communications Manager. In such cases, you might need to manually configure the gateway for MGCP without using the config download functionality.

■ Simple Cisco IOS gateway configuration: Because the gateway configuration is mostly done on Cisco Unified Communications Manager, far fewer Cisco IOS router commands are necessary to bring up the gateway, as compared to any other gateway type.

■ Supports Q Signaling (QSIG) supplementary services with Cisco Unified Communications Manager: With the support of QSIG supplementary services, MGCP is a protocol you can use to interconnect a Cisco Unified Communications Manager environment with a traditional PBX.

MGCP Architecture

The distributed system is composed of a Call Agent (or Media Gateway Controller), at least one Media Gateway (MG) that performs the conversion of media signals between circuits and packets, and at least one Signaling Gateway (SG) when connected to the PSTN.

MGCP defines a number of components and concepts. You must understand the relationships between components and how the components use the concepts to implement a working MGCP environment.

Following are the components that are used in an MGCP environment:

■ Endpoints: Represent the point of interconnection between a packet network and a traditional telephone network.

■ Gateways: Handle the translation of audio between a SCN and a packet network. The media gateway uses MGCP to report events (such as off-hook or dialed digits) to a call agent.

■ Call Agent: Exercises control over the operation of a gateway. The call agent uses MGCP to tell the gateway

■ What events should be reported to the call agent

■ How endpoints should be connected

■ What signals should be implemented on endpoints

MGCP also allows the call agent to audit the current state of endpoints on a gateway. Figure 5-16 shows an MGCP environment with all three components.

MGCP Components

Figure 5-16 MGCP Components

Cisco voice gateways can act as MGCP gateways, and Cisco Unified Communications Manager acts as an MGCP call agent.

MGCP Gateways

Using Cisco IOS Software, voice gateways can be configured as MGCP gateways. Cisco Unified Communications Manager acts as an MGCP call agent, controlling the setting up and tearing down of connections between the endpoints in a VoIP network and end-points in the PSTN, while managing all dial-plan related configuration elements.

In the case of MGCP, calls are routed via route patterns using Cisco Unified Communications Manager, not by dial peers on the gateway. The gateway voice ports must be configured for proper signaling. However, no dial peers exist for MGCP except when a router is using Cisco Unified SRST for fallback.

MGCP supports both residential and trunking gateways.

■ Trunking gateway: A trunking gateway (TGW) provides an interface between PSTN trunks and a VoIP network. A trunk can be a DS0, a T1, or an E1 line. Examples of TGWs include access servers and routers.

■ Residential gateway: A residential gateway (RGW) provides an interface between analog (RJ-11) calls from a telephone and a VoIP network. The interfaces on a residential gateway might terminate a POTS connection to a phone, a key system, or a PBX. Examples of RGWs include cable modems and Cisco 2600 Series routers.

MGCP gateway connections can be point-to-point or multipoint. A point-to-point connection is an association between two endpoints with the purpose of transmitting data between these endpoints. Data transfer between these endpoints can take place after this association is established for both endpoints. A multipoint connection is established by connecting the endpoint to a multipoint session. Connections can be established over several types of bearer networks:

■ Transmission of audio packets using the RTP and UDP over an IP network.

■ Transmission of audio packets using ATM adaptation Layer 2 (AAL2), or another adaptation layer, over an ATM network.

■ Transmission of packets over an internal connection, such as a time-division multiplexing (TDM) backplane or the interconnection bus of a gateway. This method is used, in particular, for "hairpin" connections that are connections that terminate in a gateway but are immediately rerouted over the telephony network.

Note For point-to-point connections, the endpoints of a connection could be in separate gateways or in the same gateway.

Creating a call connection involves a series of signals and events that describe the connection process. Each event causes signal messages to be sent to the call agent, and associated commands are sent back. That information might include indicators such as the off-hook event that triggers a dial-tone signal. These events and signals are specific to the type of endpoint that is involved in the call. MGCP groups these events and signals into packages.

MGCP Call Agents

A call agent, or MGC, represents the central controller in an MGCP environment, as depicted in Figure 5-17.

MGCP Call Agent

Figure 5-17 MGCP Call Agent

A call agent exercises control over the operation of a gateway and its associated end-points by requesting that a gateway observe and report events. In response to the events, the call agent instructs the endpoint what signal, if any, the endpoint should send to the attached telephone equipment. This requires a call agent to recognize each endpoint type it supports and the signaling characteristics of each physical and logical interface that is attached to a gateway.

A call agent uses its directory of endpoints and the relationship each endpoint has with the dial plan to determine appropriate call routing. Call agents initiate all VoIP call legs.

Basic MGCP Concepts

The basic MGCP concepts are as follows:

■ MGCP calls and connections: Allow end-to-end calls to be established by connecting two or more endpoints

■ MGCP control commands: Fundamental MGCP concept that allows a call agent to provide instructions for a gateway

■ Package types: Fundamental MGCP concept that allows a gateway to determine the call destination

MGCP Calls and Connections

End-to-end calls are established by connecting two or more endpoints. To establish a call, the call agent instructs the gateway that is associated with each endpoint to make a connection with a specific endpoint or an endpoint of a particular type. The gateway returns the session parameters of its connection to the call agent, which in turn sends these session parameters to the other gateway. With this method, each gateway acquires the necessary session parameters to establish RTP sessions between the endpoints. All connections that are associated with the same call will share a common Call ID and the same media stream. Figure 5-18 illustrates the setup and teardown of an MGCP call.

At the conclusion of a call, the call agent sends a DeleteConnection (DLCX) request to each gateway.

MGCP Control Commands

MGCP packets are unlike what you find in many other protocols. Usually wrapped in UDP port 2427, the MGCP datagrams are formatted with white space, much like you would expect to find in TCP protocols. An MGCP packet is either a command or a response.

A call agent uses control messages to direct its gateways and their operational behavior. Gateways use the control messages in responding to requests from a call agent and notifying the call agent of events and abnormal behavior.

Calls and Connections

Figure 5-18 Calls and Connections

There are eight command verbs.

Two verbs are used by a call agent to query the state of a media gateway:

■ AuditEndpoint (AUEP): This message requests the status of an endpoint. The call agent issues the command.

■ AuditConnection (AUCX): This message requests the status of a connection. The call agent issues the command.

Three verbs are used by a call agent to manage an RTP connection on a media gateway.

(A media gateway can also send a DLCX when it needs to delete a connection for its self- management.)

■ CreateConnection (CRCX): This message instructs the gateway to establish a connection with an endpoint. The call agent issues the command.

■ DLCX: This message informs the recipient to delete a connection. The call agent or the gateway can issue the command. The gateway or the call agent issues the command to advise that it no longer has the resources required to sustain the call.

■ ModifyConnection (MDCX): This message instructs the gateway to update its connection parameters for a previously established connection. The call agent issues the command.

One verb is used by a call agent to request notification of events on the media gateway and to request a media gateway to apply signals:

■ NotificationRequest (RQNT): This message instructs the gateway to watch for events on an endpoint and specifies the action to take when they occur. The call agent issues the command.

One verb is used by a media gateway to indicate to the call agent that it has detected an event for which the call agent had previously requested notification (via the RQNT command verb):

■ Notify (NTFY): This message informs the call agent of an event for which notification was requested. The gateway issues the command.

One verb is used by a media gateway to indicate to the call agent that it is in the process of restarting:

■ RestartInProgress (RSIP): This message notifies the call agent that the gateway and its endpoints are removed from service or are being placed back in service. The gateway issues the message.

Next post:

Previous post: