MGCP Call Flows

MGCP Call Flows

This section illustrates a few typical call flows with an explanation of the semantics of each message. The call flows are presented in order of increasing complexity. Note that the call flows presented here are shown as an example for illustration purposes. An implementation for a particular vendor of MGCP might follow a different call flow.

Basic MGCP Call Flow

A simple point-to-point call is set up using two different commands: CreateConnection and ModifyConnection.

Figure shows a call flow for a call setup between two endpoints. The endpoints are assumed to be on different gateways, and the MGC controls both the gateways. Only the relevant portions of the messages are shown in the figure. The originating side and a terminating side of this two-party call are labeled with suffixes Orig and Term, respectively. Messages in the figure are labeled numerically, and the corresponding label is referenced in the explanation that follows. Of course, the labels are not part of the MGCP messages.

Basic MGCP Call Flow

  1. The call agent sends an initial CRCX to the GW-Orig and specifies endpoint S1/DS1-0/1. The connection mode is set to recvonly. This setting indicates to the GW-Orig that the endpoint should receive media from the IP network but not send media to the IP network. This is necessary because the call agent has not set up the connection on GW-Term and hence does not know the session description at that end.

  2. GW-Orig responds with a 200/OK indicating that the connection was created successfully and providing a local session description (encoded per SDP specification). This session description includes the local IP and port ( and 11111) that the gateway has opened to receive RTP streams. SDP also indicates that the codec being used is G.711µ-law (denoted by RTP/AVP 0).

  3. The call agent then sends a CRCX to endpoint S1/DS1-0/1 on GW-Term. The session description received from GW-Orig is included in the RemoteConnectionDescriptor of this CRCX, and the mode is set to sendrecv.

  4. GW-Term responds with a 200/OK and includes its own session description in the response.

  5. The call agent passes the SDP of GW-Term to GW-Orig in a MDCX command and changes the connection mode to sendrecv.

  6. After GW-Orig executes the MDCX command and responds with 200/OK, call setup is complete and RTP streams flow between GW-Orig and GW-Term.

Trunking GW-to-Trunking GW Call Flow

The call flow discussed in the preceding section showed you that setting up connections using MGCP is fairly straightforward. However, the call flow does not tell you how and why the call agent decided to set up the connection between those two endpoints. In real life, the call agent learns about this from external signaling. A typical example is an SS7 trunk terminating on the call agent. In such a case, the SS7 messages trigger the actions of the call agent.

Figure shows the interaction between SS7 messages and MGCP.

Trunking GW-to-Trunking GW Call Flow

An initial address message (IAM) [1] comes in to the call agent on an SS7 trunk. This action triggers the call agent to analyze the IAM and decide how to handle it by consulting its local configuration. The local configuration (or an external database lookup) tells the call agent to set up a call between the two endpoints ep-orig and ep-term on the gateways GW-Orig and GW-Term.

The call agent sends two CreateConnection messages [2] and [4] that are similar to the call flow illustrated in Figure. After PSTN-term seizes the line, it sends an SS7 ACM [7] message to the call agent. Then the call agent sends an MDCX [8] to GW-Orig. Notice that the ConnectionMode is now set to recvonly. This is because, at this point, only the ringing tone needs to flow back to the originating side. The originating side cannot send audio yet.

After the terminating phone is picked up, PSTN-Term sends an ANM [11] message to the call agent. This triggers the call agent to send an MDCX to GW-Orig setting the mode to sendrecv. This completes the setup of gateways for two-way audio.

 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows