What is MGCP Protocol?
The full form of MGCP is the Media Gateway Control Protocol. To understand the MGCP protocol. In this tutorial, first, we will describe the signalling and media paths in a call. MGCP protocol provides specifications to control the media gateway. Next comes to mind, what is a media gateway and who controls it? The answer is Media Gateway is a device or node, which terminates the voice trunks in the telecom network. Voice trunks can be of multiple types e.g E1/T1, VoIP, ISDN, analog lines, etc. Call control is an application that handles the singling message for the call and sends the command to the media gateway over the MGCP protocol to reserve/release/modify the voice trunks using the MGCP protocol. There may be commands or events from Media Gateway to the Call Control.
Here we will explain in very simple terms the use of MGCP then we will discuss in detail the MGCP protocol. In another tutorial for the ss7 protocol, we have discussed the signalling flow for the Call control. Here we will discuss media gateway call flow during a call.
What is Media Gateway?
Media is a stream, which can be for voice, fax, etc. Media Gateway is a device with connects two streams in each direction. One direction is towards the calling number and the other towards the called number. During a call, the mobile device samples voice into a stream of data packets. Call originating exchange sends the packets to the media gateway and media gateway sends packets to the called exchange. Before sending any packet, a voice circuit is set up in each direction from the gateway.
Media Gateway does format conversion too. For example, a PSTN subscriber dials a number in the VoIP network. In this case, the media gateway does the conversion from PSTN (E1/T1) media format to the VoIP format and vice versa.
Example Call Flow for MGCP:
In this example, we will describe the signalling and corresponding handling and media gateway over MGCP.
The above example shows full call flow with signalling. Once call control receives a signalling message for the call, it reserves a media channel in the incoming direction. Then forwards the call message towards the terminating switching centre and reserves media channel in an outgoing direction. Once a call is answered, both channels are connected to each other. Connecting channels called switching. Once switching is done, both calling and called can listen to each other.
MGCP protocol specification:
Till now we have talked about the general use of MGCP protocol. Now here we will describe the exact protocol specifications. The specifications are in MGCP RFC. The communication between Call Control and Media Gateway is over UDP or TCP. MGCP uses standard port 2427 on media gateway and 2727 on-call control application. This means when a call control sends a request to the media gateway destination MGCP port is 2427, and when opposite, the destination MGCP port is 2727. The format of the command is the SDP protocol type.
MGCP protocol primitives:
To set up the call, both ends issues commands to each other. The following are the commands that are present in the MGCP protocol.
- End Point Configuration, call control issues this command to set coding standards for an endpoint for the call termination.
- Create Connection, call control sends this command to the media gateway to create a connection to terminate in an endpoint.
- Notification Command. Using this command, event types are set on the media gateway (MG) by the call agent. These are standard events that are carried in MGCP protocol from MG to a call agent. One example is DTMF.
- Notify Command. MG issue command to send events to the Call agent.
- Modify connection, for modifying an already-existing connection.
- Delete connection, for deleting a connection.