06-05-2015 08:43 AM - edited 03-12-2019 10:16 AM
Below is the document explaining MGCP and trace and debug example.
MGCP
a) Server client model
b) Works best with single site
c) CUCM controls the port of the gateway
d) Dial plan completely administered on CUCM
e) MGCP overcomes the distributed configuration and administration problems inherent in the use of protocols such as H.323, as everything is managed on CUCM
f) MGCP is defined in RFC 3435
g) Another protocol used for the same purpose is Megaco, a coproduction of IETF (RFC 3525) and ITU (Recommendation H.248-1).
h) MGCP is an extension of the earlier version of Simple Gateway Control Protocol (SGCP)
i) 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.
For Q.931 backhauling, TCP port 2428 is used.
j) 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.
k) CUCM -- Q.931 backhaul -- Voice router MGCP -- Q.931 + Q.921 -- PSTN
l) Q.921 is basically for physical messages.Eg line code, framing, time slots
MGCP endpoint
S0/ds1-0/1@cisco.com
S0 – is the slot number that contains the voice module
ds1 – means that the trunk type is a DS-1, others include ds3, e1, and e3
-0 – is the port number within the slot
1 – identifies ISDN B-Channel number 1
cisco.com – is the hostname of the gateway, with its domain name appended.
A DS1 ISDN trunk is a 64 Kbps bearer channel used to transmit digitized voice or data traffic. These trunks, or B-channels, use a separate channel, the D-channel for call-control signaling. This mode of operation is known as out-of-band signaling, as opposed to in-band robbed-bit signaling, in which signaling is carried in the same channel as the voice or data traffic. One D-channel, or ISDN signaling link (ISDN-LNK), carries signaling messages for several B-channels, forming an ISDN signaling group (ISDN-SGR).
A B-channel may be a port on a MM710 series DS1 Media Module.
Two types of DS1 interfaces exist:
24 DS0 channels on a 1.544 Mbps link
31 DS0 channels + 1 framing channel on a 2.048 Mbps link
Q.931 backhaul important points:
a) Reliable TCP transport layer protocol
b) encapsulation of Q.931 signalling in the D channel of the ISDN TDM interface.
c) Backhauling carries the raw channel to CUCM
d) Gateway is still responsible for terminating the Q.921 layer 2 link access protocol - D channel (LAPD) signalling, but all of the Q.931 is sent to CUCM.
High Points:
a) When you use MGCP as the call agent in a VoIP environment, you need not configure static VoIP network dial peers.
b) Centralized dial plan configuration and gateway configuration on call manager.
c) Simple gateway IOS configuration.
As simple as adding 2 commands:
ccm-manager config server <ccm-manager IP>
ccm-manager config
d) Supports QSIG supplementary services with CUCM.
Architecture:
Media Gateway Controller (call agent) + Media gateway (converts media signals between circuits and packets) + Signalling gateway connected to PSTN
Cisco voice gateways can act as MGCP gateways, and Cisco Unified Communications Manager acts as an MGCP call agent.
MGCP supports both residential and trunking gateways:
MGCP gateway connections can be point-to-point or multipoint.
Basic MGCP Concepts
1) MGCP calls and connections
2) MGCP control commands
3) Package types
End-to-end calls are established by connecting two or more endpoints. All connections that are associated with the same call will share a common Call ID and the same media stream.
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.
A call connection involves a series of events and signals, such as off-hook status, a ringing signal, or a signal to play an announcement, that are specific to the type of endpoint involved in the call.
MGCP groups these events and signals into packages. A trunk package, for example, is a group of events and signals relevant to a trunking gateway. An announcement package is a group of events and signals relevant to an announcement server. These packages are enabled by using the mgcp package-capability command.
MGCP Call Flows
Phone connected on Gateway A is calling phone connected at gateway B.
1) Call agent sends a RQNT to gateway A, and asks gateway to wait for off-hook event. When it goes off-hook, call agent instructs the gateway to supply dial tone and asks the gateway to collect digits before it notifies call agent.
2) Gateways responds with RQNT response.
3) A user on gateway A goes off-hook and it provides a dial tone and collects digits. (as asked by RQNT in first message)
4) Gateway A sends a NTFY to the call agent to advise the call agent that a requested event was observed.
5) After confirming that call is possible based on dialed digits, call agent sends a CRCX to gateway A.
6) Gateway A sends CRCX response w/ SDP (IP address and UDP port)
7) Call Agent sends CRCX to gateway B. The call agent also embeds a RQNT that instructs the gateway about the signals and events it should now consider relevant.
8) Gateway B responds with SDP.
9) Call agent relays the information to gateway A in MDCX. + NTFY
RTP established
10) Now one of the endpoints goes on-hook.
11) Call agent sends DLCX to each gateway.
12) Gateway delete the connection and respond.
Configuring MGCP Gateways on router:
Configure MGCP on residential gateways (configured on dial peers instead of controller):
ccm-manager mgcp
mgcp
mgcp #mgcp call-agent 10.197.183.226 service-type mgcp \* specifying the call agent and service type
dial-peer voice 1 pots
dial-peer# application mgcpapp
dial-peer#port 1/0/0
exit
mgcp package-capability dtmf-package
Configure MGCP on trunk gateways (configured on controller):
ccm-manager mgcp \* command use if only using cucm
mgcp 4000
mgcp call-agent 10.197.183.226 4000 \* specifying the call agent and port no
controller t1 0/0/0
controller#framing esf
controller# ds0-group 1 timeslots 1-24 type none service mgcp \* creating chanellized time slots (DS0 for CAS, pri-group for CCS)
mgcp package-capability dtmf-package \* creating different packages.
Configure MGCP on trunk gateways (configured on controller):
ccm-manager mgcp
no ccm-manager fax protocol mgcp \* disable cisco fax relay
mgcp
mgcp #mgcp call-agent 10.197.183.226 service-type mgcp version 0.1 \*specifying the call agent and service type
mgcp package-capability fxr-package \* creating different packages.
mgcp package-capability rtp-package
mgcp fax-relay sg3-to-g3 \* configure fax machines to negotiate down to g3 speed
Few show commands:
show mgcp
show mgcp endpoints
show mgcp statistics
show ccm-manager
show voice port summary
debug voip ccapi inout
debug mgcp [ all | errors | events | packets | parser ]
Configuring MGCP Gateways on call manager:
1) Go to CM admin page --> Device --> Gateway and click ADD NEW.
2) Select Gateway type and click next. Then select protocol type. In our case, it is MGCP. Click Next.
3) Put in the domain name (hostname.domain name), CUCM group and Module in Slot 0,1 etc. Then click save.
(Note: Please take extra care here as many issues arrive because of bad names).
4) Now, select the Subunit 0, 1, 2 or 3. Eg Subunit 0 is VWIC2-2MFT-T1E1-T1. Hit save.
5) Finally, configure the endpoints. Configuring 0/0/0. Select the Device protocol (be it either Digital Access T1 - T1- CAS or Digital Access PRI - CCS).
6) Based on the config file you want, please configure the MGCP endpoint.
MGCP Gateway Verification
show isdn status :
HQ-1# show isdn status
Global ISDN Switchtype = primary-net5
ISDN Serial0/1/0:15 interface
dsl 0, interface ISDN Switchtype = primary-net5
Layer 1 Status:
ACTIVE
Layer 2 Status: \* To check Q.921 (LAPD) TEI = 0, Ces = 1, SAPI = 0, State = MULTIPLE_FRAME_ESTABLISHED signalling between provider and cisco router
Layer 3 Status:
0 Active Layer 3 Call(s)
Active dsl 0 CCBs = 0
The Free Channel Mask: 0x8000000F
Number of L2 Discards = 0, L2 Session ID = 4
Total Allocated ISDN CCBs = 0
Config examples:
E1 PRI config on router:
controller E1 0/3/0
framing crc4
linecode hdb3
pri-group timeslots 1-31 service mgcp
!
interface Serial0/3/0:15
isdn switch-type primary-4ess
isdn incoming-voice voice
isdn bind-l3 ccm-manager
!
ccm-manager mgcp
ccm-manager music-on-hold
!
mgcp
mgcp call-agent 10.197.183.226 2427 service-type mgcp version 0.1
mgcp rtp unreachable timeout 1000 action notify
mgcp modem passthrough voip mode nse
mgcp package-capability rtp-package
mgcp package-capability sst-package
mgcp package-capability pre-package
no mgcp package-capability res-package
no mgcp package-capability fxr-package
no mgcp timer receive-rtcp
mgcp sdp simple
mgcp rtp payload-type g726r16 static
E1 CAS config on router:
controller E1 0/3/0
framing crc4
linecode hdb3
ds0-group timeslots 1-31 service mgcp
Fractional T1/E1 Configuration on an MGCP Gateway
a) Not able T1 or E1 timeslots will be used.
b) "B channel maintenance status" setting in service parameter to block B channels from using in normal operation.
c) Five PRI endpoints can be configured to have B channels in maintenance status.
d) There will be no alteration in the XML file sent from CUCM to MGCP gateway, however, when call routed by CUCM, it would no that it has certain channels as "out of service" and won't use it for call routing.
Traces and Debug Analysis
Below is the example of traces and debug.
calling number: 1006 - SIP phone; IP 10.78.133.251
called number: 4200 - IP 10.78.133.250
time of call: 12:46 AM IST
Call flow:
SIP ip phone -- CUCM -- MGCP -- E1 Pri -- PSTN
1006
Debug analysis:
>> CRCX from CUCM to gateway
000807: May 31 01:09:17.187: MGCP Packet received from 10.197.183.226:2427--->
CRCX 375 S0/SU0/DS1-0/12@VXML-3945.cisco.com MGCP 0.1 \* CRCX "sequence no" "endpt id" MGCP "version"
C: D0000000012c90fb000000F500000003 \* call identification no
X: c
L: p:20, a:PCMU, s:off, t:b8
M: recvonly
R: D/[0-9ABCD*#]
Q: process,loop
<---
>> 200 ok from gateway to CUCM + SDP of the gateway
000808: May 31 01:09:17.191: MGCP Packet sent to 10.197.183.226:2427--->
200 375 OK
I: 4
v=0
c=IN IP4 10.197.183.234
m=audio 16390 RTP/AVP 0 100
a=rtpmap:100 X-NSE/8000
a=fmtp:100 192-194
<---
>> Receiving backhaul msg - Setup
000809: May 31 01:09:17.195:
cmbh_rcv_callback: <-- Receiving backhaul msg for Se0/0/0:15 :
| bk_msg_type = DATA_REQ
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 31
| Q.931 message type: SETUP
| Q.931 message = 0802000305A104038090A31803A9838C6C0600813130303670
>> Setup sent from Gateway to TELCO
000810: May 31 01:09:17.195: ISDN Se0/0/0:15 Q931: TX -> SETUP pd = 8 callref = 0x0003
Sending Complete
Bearer Capability i = 0x8090A3
Standard = CCITT
Transfer Capability = Speech
Transfer Mode = Circuit
Transfer Rate = 64 kbit/s
Channel ID i = 0xA9838C
Exclusive, Channel 12
Calling Party Number i = 0x0081, '1006'
Plan:Unknown, Type:Unknown
Called Party Number i = 0x80, '4200'
Plan:Unknown, Type:Unknown
>> Call proc from Telco to Gateway
000811: May 31 01:09:17.223: ISDN Se0/0/0:15 Q931: RX <- CALL_PROC pd = 8 callref = 0x8003
Channel ID i = 0xA9838C
Exclusive, Channel 12
>> Sending backhauled msg - Call proceeding
000812: May 31 01:09:17.223:
cmbrl_send_pak: --> Sending backhauled msg for Se0/0/0:15 :
| bk_msg_type = DATA_IND
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 10
| Q.931 message type: CALL PROCEEDING
| Q.931 message = 08028003021803A9838C
>> Alerting from Telco to Gateway
000813: May 31 01:09:17.227: ISDN Se0/0/0:15 Q931: RX <- ALERTING pd = 8 callref = 0x8003
Progress Ind i = 0x8188 - In-band info or appropriate now available
>> Sending backhauled msg - ALERTING
000814: May 31 01:09:17.227:
cmbrl_send_pak: --> Sending backhauled msg for Se0/0/0:15 :
| bk_msg_type = DATA_IND
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 9
| Q.931 message type: ALERTING
| Q.931 message = 08028003011E028188
>> MDCX from CUCM to gateway + SDP of 1006 phone
000815: May 31 01:09:17.227: MGCP Packet received from 10.197.183.226:2427--->
MDCX 376 S0/SU0/DS1-0/12@VXML-3945.cisco.com MGCP 0.1
C: D0000000012c90fb000000F500000003
I: 4
X: c
L: p:20, a:PCMU, s:off, t:b8
M: sendrecv
R: D/[0-9ABCD*#]
S:
Q: process,loop
v=0
o=- 4 0 IN EPN S0/SU0/DS1-0/12@VXML-3945.cisco.com
s=Cisco SDP 0
t=0 0
m=audio 17918 RTP/AVP 0 \* port no
c=IN IP4 10.78.133.251
<---
>> 200 ok for MDCX from gateway to CUCM
000816: May 31 01:09:17.227: MGCP Packet sent to 10.197.183.226:2427--->
200 376 OK
<---
>> Connect from Telco to Gateway
000817: May 31 01:09:19.767: ISDN Se0/0/0:15 Q931: RX <- CONNECT pd = 8 callref = 0x8003
Connected Number i = 0x80, '4200'
>> Sending backhauled msg - Connect
000818: May 31 01:09:19.767:
cmbrl_send_pak: --> Sending backhauled msg for Se0/0/0:15 :
| bk_msg_type = DATA_IND
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 12
| Q.931 message type: CONNECT
| Q.931 message = 08028003074C058034323030
>> Receiving backhaul msg - Connect Ack
000819: May 31 01:09:19.771:
cmbh_rcv_callback: <-- Receiving backhaul msg for Se0/0/0:15 :
| bk_msg_type = DATA_REQ
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 5
| Q.931 message type: CONNECT ACK
| Q.931 message = 080200030F
>> Connect Ack from gateway to Telco
000820: May 31 01:09:19.771: ISDN Se0/0/0:15 Q931: TX -> CONNECT_ACK pd = 8 callref = 0x0003
000821: May 31 01:09:26.587: MGCP Packet sent to 10.197.183.226:2427--->
NTFY 911799872 *@VXML-3945.cisco.com MGCP 0.1
X: 0
O:
<---
000822: May 31 01:09:26.587: MGCP Packet received from 10.197.183.226:2427--->
200 911799872
<---
>> Disconnect from Telco to Gateway
000823: May 31 01:09:30.079: ISDN Se0/0/0:15 Q931: RX <- DISCONNECT pd = 8 callref = 0x8003
Cause i = 0x8290 - Normal call clearing
>> Sending backhauled msg - DISCONNECT
000824: May 31 01:09:30.079:
cmbrl_send_pak: --> Sending backhauled msg for Se0/0/0:15 :
| bk_msg_type = DATA_IND
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 9
| Q.931 message type: DISCONNECT
| Q.931 message = 080280034508028290
>> MDCX from CUCM to gateway ( to disconnect the call)
000825: May 31 01:09:30.079: MGCP Packet received from 10.197.183.226:2427--->
MDCX 377 S0/SU0/DS1-0/12@VXML-3945.cisco.com MGCP 0.1
C: D0000000012c90fb000000F500000003
I: 4
X: c
M: recvonly
R: D/[0-9ABCD*#]
Q: process,loop
<---
>> 200 Ok from gateway to CUCM
000826: May 31 01:09:30.083: MGCP Packet sent to 10.197.183.226:2427--->
200 377 OK
<---
>> DLCX from CUCM to gateway
000827: May 31 01:09:30.083: MGCP Packet received from 10.197.183.226:2427--->
DLCX 378 S0/SU0/DS1-0/12@VXML-3945.cisco.com MGCP 0.1
C: D0000000012c90fb000000F500000003
I: 4
X: c
S:
<---
>> 200 ok from Gateway to CUCM
000828: May 31 01:09:30.099: MGCP Packet sent to 10.197.183.226:2427--->
250 378 OK
P: PS=642, OS=102720, PR=637, OR=101920, PL=0, JI=0, LA=24
<---
>> Receiving backhaul msg - RELEASE
000829: May 31 01:09:30.099:
cmbh_rcv_callback: <-- Receiving backhaul msg for Se0/0/0:15 :
| bk_msg_type = DATA_REQ
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 5
| Q.931 message type: RELEASE
| Q.931 message = 080200034D
>> Release sent from Gateway to TELCO
000830: May 31 01:09:30.099: ISDN Se0/0/0:15 Q931: TX -> RELEASE pd = 8 callref = 0x0003
>> Release comp sent from Telco to gateway
000831: May 31 01:09:30.107: ISDN Se0/0/0:15 Q931: RX <- RELEASE_COMP pd = 8 callref = 0x8003
>> Sending backhauled msg - RELEASE COMPLETE
000832: May 31 01:09:30.107:
cmbrl_send_pak: --> Sending backhauled msg for Se0/0/0:15 :
| bk_msg_type = DATA_IND
| bk_chan_id (slot:port) = 0:0
| Q.931 length = 5
| Q.931 message type: RELEASE COMPLETE
| Q.931 message = 080280035A
Trace analysis:
SIP phone; IP 10.78.133.251 CUCM 10.197.183.226 MGCP 10.197.183.234
Invite from SIP phone to CUCM
100 Trying from CUCM to SIP phone
Subscribe from CUCM to SIP gateway
200 ok from SIP phone to CUCM
Notify from SIP phone to CUCM - Subscription-State: active
200 ok from CUCM to SIP phone
Notify from SIPphone to CUCM with digits -- digits="2"
200 ok from CUCM to SIP phone
Refer from CUCM to SIPphone - <tonetype>DtOutsideDialTone</tonetype>
200 ok for refer
Refer from CUCM to SIPphone - <tonetype>Dt_NoTone</tonetype>
DD=4200
Name=S0/SU0/DS1-0@VXML-3945.cisco.com found
MGCPpn9D creating MGCPpn9cuser
AuConnectRequest(19697914,19697915)
180 Ringing from CUCM to SIPPhone + SDP of gateway
200 ok from CUCM to SIPphone + SDP of gateway
ACK from SIPphone to CUCM
Bye from CUCM to SIPPhone
Detailed traces can be found in the attached text document. It can be filtered using >> in notepad++.
GOOD LINKS:
https://supportforums.cisco.com/discussion/1004191
Regards,
Ronak Agarwal
Excellent document !
Regards
Lavanya
Thank you Lavanya!
Regards,
Ronak Agarwal
Hi,
Great Document
From the debug could you please explain when the q.921 exchange is takes place between Gateway and Telco?
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: