Monday, September 17, 2007

MGCP Short Overview/ MGCP FAQ

RFC MGCP: RFC2705

If you are keen to learn about VoIP protocols the MGCP Protocol is the easiest one to start. The RFC is little bit complex but if you learn 5-6 times you will start understanding it. The important points of the protocols are mentioned below.

Media Gateway Control Protocol (MGCP) is used for controlling telephony gateways from external call control elements called media gateway controllers or call agents.

MGCP assumes a call control architecture where the call control intelligence is outside the gateways and handled by external call control elements. The MGCP assumes that these call control elements, or Call Agents, will synchronize with each other to send coherent commands to the gateways under their control. MGCP is, in essence, a master/slave protocol, where the gateways are expected to execute commands sent by the Call Agents.

It has three main componenets : endpoints, gateways and call agents.

MGCP Commands


  • CreateConnection
  • ModifyConnection 
  • DeleteConnection
  • NotificationRequest
  • Notify
  • AuditEndpoint
  • AuditConnection
  • RestartInProgress

MGC --> MG CreateConnection: Creates a connection between two endpoints; uses SDP to define the receive capabilities of the paricipating endpoints.

MGC --> MG ModifyConnection: Modifies the properties of a connection; has nearly the same parameters as the CreateConnection command.

MGC <--> MG DeleteConnection: Terminates a connection and collects statistics on the execution of the connection.

MGC --> MG NotificationRequest: Requests the media gateway to send notifications on the occurrence of specified events in an endpoint.

MGC <-- MG Notify: Informs the media gateway controller when observed events occur. MGC --> MG AuditEndpoint: Determines the status of an endpoint.

MGC --> MG AuditConnection: Retrieves the parameters related to a connection.

MGC <-- MG RestartInProgress: Signals that an endpoint or group of endpoints is take in or out of service.


The first four commands are sent by the Call Agent to a gateway. The Notify command is sent by the gateway to the Call Agent. The gateway may also send a DeleteConnection. The Call Agent may send either of the Audit commands to the gateway. The Gateway may send a RestartInProgress command to the Call Agent.

All commands are composed of a command header, optionally followed by a session description. All responses are composed of a response header, optionally followed by a session description. Headers and session descriptions are encoded as a set of text lines, separated by a carriage return and line feed character (or, optionally, a single line-feed character). The headers are separated from the session description by an empty line.

MGCP uses a transaction identifier to correlate commands and responses. Transaction identifiers have values between 1 and 999999999. An MGCP entity cannot reuse a transaction identifier sooner than 3 minutes after completion of the previous command in which the identifier was used.
The command header is composed of:

1) A command line, identifying the requested action or verb, the transaction identifier, the endpoint towards which the action is requested, and the MGCP protocol version,
2) A set of parameter lines, composed of a parameter name followed by a parameter value.


The command line is composed of:

1) Name of the requested verb.
2) Transaction identifier correlates commands and responses. Values may be between 1 and 999999999. An MGCP entity cannot reuse a transaction identifier sooner than 3 minutes after completion of the previous command in which the identifier was used.
3) Name of the endpoint that should execute the command (in notifications, the name of the endpoint that is issuing the notification).
4) Protocol version.

These four items are encoded as strings of printable ASCII characters, separated by white spaces, i.e., the ASCII space (0x20) or tabulation (0x09) characters. It is recommended to use exactly one ASCII space separator.

Transaction Identifiers

MGCP uses a transaction identifier to correlate commands and
responses. A gateway supports two separate transaction identifier
name spaces:

a transaction identifier name space for sending transactions, and

a transaction identifier name space for receiving transactions.

At a minimum, transaction identifiers for commands sent to a given
gateway MUST be unique for the maximum lifetime of the transactions
within the collection of Call Agents that control that gateway.


Security requirements in MGCP ( uses IPSec )

If unauthorized entities could use the MGCP, they would be able to
set-up unauthorized calls, or to interfere with authorized calls.

Expectation is that MGCP messages will always be carried over secure
Internet connections, as defined in the IP security architecture as
defined in RFC 2401,using either the IP Authentication Header,
defined in RFC2402, or the IP Encapsulating Security Payload,
defined in RFC 2406.


MGCP initial is version known as SGCP.