Gateway Configuration Best Practices (MGCP, H323, SIP)

PS – original post by duzceli1979

Gateway Configuration Best Practices (MGCP, H323, SIP)

MGCP GW with CUCM:

If a GW is configured to be a MGCP controlled GW, the configuration is pretty basic. It only terminates ISDN layer 2 messages aka Q.921. Layer 3 ISDN aka Q.931 messages are backhauled to CUCM over TCP (port 2428). There is no need to configure dial peers etc. Nearly everything is controlled by CUCM.

Attention: If you configure the GW also as SRST (e.g. Branch GW), dial-peer settings, voice translation rules etc. must be configured in order to function in case of a CUCM connectivity failure.

There are two ways to configure the MGCP gateway:

1) Obtaining the config file from CUCM:

This can be achieved via the command => ccm-manager config server [IP of TFTP_Server]

There are some caveats which are very important to know. First, it configures the whole T1/E1 PRI channels (23 or 30). Fractional use of PRI can not be done. Second, if you make some configuration changes or even advanced settings, apply the command above will override the config to the basic.

How-to-configure:

At the GW:

!
! VWICs need this command at the beginning to activate the type of the card
! Most cases this already done
!
card-type [E1 or T1]
!
! Configure the switchtype and clocking
!
network-clock-participate wic 0
!
ccm-manager config server [IP of TFTP_Server]
!

At CUCM:

Go-to the Devices and Gateway. Add a new GW as MGCP-Gateway. Following settings are downloaded with the “ccm-manager config server” command:

2) Configuration without the config file from CUCM

Configuration should be done in the same order as below. There is no DNS dependency in the communication between GW and CUCM, as long as IP addresses are used. Be careful when obtaining the domain name of GW. This is normally the hostname of the GW. You can also verify it in the output of “sh ccm-manager” command.

How-to-configure:

At the GW:

! VWICs need this command at the beginning to activate the type of the card
! Most cases this already done
!
card-type [E1 or T1]
!
! Configure the switchtype and clocking
!
isdn switchtype primary-ni
network-clock-participate wic 0
!
controller [E1 or T1] 0/0/0
pri-group timeslots 1-3 service mgcp
framing esf
linecode b8zs
!
! Voice-Port and Serial Interface has been created after controller configuration
! T1 = x/x/x:23 and E1 = x/x/x:15
! All other ISDN commands will be set at CUCM
!
interface serial 0/0/0:23
isdn bind-l3 ccm-manager
!
mgcp call-agent [IP of Call_Agent]
mgcp dtmf-relay voip codec all mode out-of-band
mgcp
mgcp bind control source-interface [IP of Loopback]
mgcp bind media source-interface [IP of Loopback]
ccm-manager mgcp
ccm-manager redundant host [IP of Redundant_Call_Agent]
!
! If this GW is also used as SRST GW
!
ccm-manager fallback [IP of GW]
!

At CUCM:

Go-to the Devices and Gateway. Add a new GW as MGCP-Gateway.

Configure the interface by clicking on E1/PRI image.

There is no need to configure the details on the following section on the page. This is already done at the GW.

Reset the GW on CUCM and you will see the GW registered with CUCM. Done!
Verification:

sh isdn status
sh ccm-manager

Caveats:

1) After the configuration is done and the ISDN status is still not “MULTIPLE FRAME ESTABLISHED”, then re-issue the bind command in the serial interface:

no isdn bind-l3 ccm-manager
isdn bind-l3 ccm-manager

2) There is a known defect in IOS that can cause the MGCP GW to register with another address then the one used in the bind statements. This only happens the first time the MGCP GW registers after the bind statements have been issued. The defect causes the GW to use the address of the interface closest to the CM. To check if this has happened look at the IP address that the GW have registered with in CM.

If this happens use the below commands:

no mgcp
no mgcp bind media source interface loopback0
no mgcp bind signal source interface loopback0
mgcp bind media source interface loopback0
mgcp bind signal source interface loopback0
mgcp
H323 GW with CUCM:

GW Configuration:

!
! VWICs need this command at the beginning to activate the type of the card
! Most cases this already done
!
card-type [E1 or T1]
!
! Configure the switchtype and clocking
!
isdn switchtype primary-ni
network-clock-participate wic 0
!
controller t1 0/0/0
pri-group timeslots 1-3
framing esf
linecode b8zs
!
! Voice-Port and Serial Interface has been created after controller configuration
! T1 = x/x/x:23 and E1 = x/x/x:15
!
interface serial 0/0/0:23
no ip address
encapsulation hdlc
isdn switch-type primary-qsig
isdn incoming-voice voice
no cdp enable
isdn outgoing display-ie
!
! Configure the H323 gateway, binding to the loopback interface
!
interface loopback 0
h323-gateway voip interface // Tells the router that this interface should be enabled for H323 packet processing
h323-gateway voip bind srcaddr [IP of Loopback0] // Sets the source address of H323 packets
!
! Define codec preferences
!
voice class codec 1
codec preference 1 g711alaw // For the sites in Europe
codec preference 2 g711ulaw
codec preference 3 g729r8
!
! Create a voice class, using the minimal timeout value to switch from one call leg
! to next one. This is required for redundant call legs to CUCM
!
voice class h323 1
h225 timeout tcp establish 1
!

! Dial-peer to match incoming call leg
!
dial-peer voice 1 pots
incoming called-number .
direct-inward-dial
port 1/0:1
!
! Two dial-peers (redundancy) to send calls to CCM
! Enable no vad on these dial-peers and also dtmf-relay
!
dial-peer voice 2 voip
destination-pattern 3…
voice-class codec 1
voice-class h323 1
session target ipv4:10.1.21.39
dtmf-relay h245-alphanumeric
ip qos dscp cs3 signaling
no vad
!
dial-peer voice 3 voip
preference 1
destination-pattern 3…
voice-class codec 1
voice-class h323 1
session target ipv4:10.1.21.38
dtmf-relay h245-alphanumeric
ip qos dscp cs3 signaling
no vad
!
! Configure the outgoing dial-peers
!
dial-peer voice 101 pots
description ===> PSTN – US National Calls
destination-pattern 1[2-9]..[2-9]……$
port 0/1/0:15
forward-digits all
!
dial-peer voice 102 pots
description ===> PSTN – US Local Calls
destination-pattern [2-9]……$
port 0/1/0:15
forward-digits all
!
dial-peer voice 103 pots
description ===> PSTN – International Calls
destination-pattern 011T
port 0/1/0:15
!
dial-peer voice 911 pots
description ===> Emergency Calls
destination-pattern 911
port 0/1/0:15
forward-digits all

Verification:

sh isdn status
sh gateway
sh dial-peer voice summary
debug isdn q931
debug voice dialpeer all // The statement to look for in the output is MATCHED
debug voip ccapi inout

CUCM Configuration:

This is pretty straight-forward. Go-to the Devices and Gateway. Add a new GW as H323-Gateway. Do not forget to mark “Redirecting Number IE Delivery – Inbound / Outbound” and Display IE Delivery check boxes.

It is recommended to do the digit manipulation at the GW and send 4 digits (interpreted as directory numbers) to CUCM. In case of SRST, digits manipulations are necessary at the GW and doing it before will make your life easier.

Configuring H225 Timer for Redundant Call Legs to CUCM:

When setting up redundant H323 dial peers for sending calls from a H323 gateway to publisher and subscriber, set the H225 timeout to < 10 seconds. If its more than 10 seconds, Q931 timer will expire and will do a call disconnect. If timeout is not set, the router waits 40 seconds to hunt between two dial-peers that have same pattern with preference numbers in order.

Call Survivability:

When the signaling channel between an H323 gateway and CUCM is lost, the RTP stream is disconnected after an H.225 keep alive timeout
The H.323 gateway detects a connection failure with CUCM through the use of H.225 keep alive timeouts
When the no h225 timeout keepalive command is configured and the H225 TCP session is lost, active TDM-to-IP calls are preserved but IP-lo-IP calls are disconnected
To keep IP-lo-IP calls active (Cisco Unified Border Element configuration), disable media inactivity detection by adding the call preserve command.
voice service voip
h323
h225 timeout keepalive
!
voice service voip
allow-connections h323 to h323
voice class h323 1
h225 timeout tcp establish 2
h225 timeout setup 2
call preserve

At CUCM:

Change these service parameters and restart CCM service:
Allow TCP Keepalive for H323 = False
Allow Peer to Preserve Call = True
H323 Fast start

When using H.323 fast start one of the H.225 setup messages includes a FastStart element with a list of capabilities and supported codec options. The other gateway responds by including a FastStart element in one of it’s messages – indicating it’s capabilities and the codec it has selected. This allows media transmission to begin quicker, instead of having to wait for an H.245 capabilities exchange.
Fast Start does not have to be configured, it is enabled by default in IOS and if one of the gateways does not support it will fall back to the legacy behavior. Note that if configuring outbound Fast Start on CUCM a Media Termination Point (MTP) will be required:

CUCM configuration – H323 gateway consideration
Click on required MTP check box, if outbound fast start call require
Wait for far end h245 terminal capability set – it depends upon what we are doing. For CUBE it is not required, since CUBE does not support it.
Enable outbound fast start – Only require if you asked to enable faststart calls
SIP GW with CUCM:

GW Configuration:

!
! VWICs need this command at the beginning to activate the type of the card
! Most cases this already done
!
card-type [E1 or T1]
!
! Configure the switchtype and clocking
!
isdn switchtype primary-ni
network-clock-participate wic 0
!
controller t1 0/0/0
pri-group timeslots 1-3
framing esf
linecode b8zs
!
! Voice-Port and Serial Interface has been created after controller configuration
! T1 = x/x/x:23 and E1 = x/x/x:15
!

interface serial 0/0/0:23
no ip address
encapsulation hdlc
isdn switch-type primary-qsig
isdn incoming-voice voice
no cdp enable
isdn outgoing display-ie
!
! Bind signaling and media to the most reliable interface – loopback
!
voice service voip
sip
bind all source-interface loopback 0
!
! Set the SIP INVITE timer to the lowest possible setting
!
sip-ua
timer trying 100
!
! Dial-peer to match incoming call leg
!
dial-peer voice 1 pots
incoming called-number .
direct-inward-dial
port 1/0:1
!
! Two dial-peers to send calls to CCM (Sub and Pub)
! Add the session protocol statement
!
dial-peer voice 2 voip
destination-pattern 3…
session target ipv4:10.110.1.12
session protocol sipv2
!
dial-peer voice 3 voip
preference 1
destination-pattern 3…
session target ipv4:10.110.1.11
session protocol sipv2
!
! Configure the outgoing dial-peers
!
dial-peer voice 101 pots
description ===> PSTN – US National Calls
destination-pattern 1[2-9]..[2-9]……$
port 0/1/0:15
forward-digits all
!
dial-peer voice 102 pots
description ===> PSTN – US Local Calls
destination-pattern [2-9]……$
port 0/1/0:15
forward-digits all
!
dial-peer voice 103 pots
description ===> PSTN – International Calls
destination-pattern 011T
port 0/1/0:15
!
dial-peer voice 911 pots
description ===> Emergency Calls
destination-pattern 911
port 0/1/0:15
forward-digits all

Verification:

sh isdn status
sh sip service
sh dial-peer voice summary
debug ccsip messages
debug isdn q931

CUCM Configuration:

The configuration is similar to an H323 gateway in IOS, however the configuration in CUCM is for a trunk, rather than a gateway. On the CUCM, navigate to Device and Trunk. Add a new SIP trunk with SIP device protocol. Do not forget to mark “Redirecting Number IE Delivery – Inbound / Outbound” check boxes.
Troubleshooting ring-back issues to and from PSTN:

Always include the following commands in your outgoing dial-peers:

progress_ind setup enable 3 (fixes if PSTN caller does not hear a ring-back)
progress_ind alert enable 8 (fixes if IP phones does not hear a ring-back from PSTN)

http://voiceonbits.com/2010/08/05/troubleshooting-ringback-issues-h323/

http://duzceli1979.blogspot.com/2011/08/gateway-configuration-best-practices.html?showComment=1420862091913#c1645746175800403156

Advertisements
Posted in Cisco R&S | Leave a comment

Using Expect Scripting for Cisco Devices

////// Code was written by: Adeolu Owokade

#!/bin/sh
# \
exec tclsh “$0″ ${1+”$@”}
package require Expect
# ###########################################################
# This simple Expect script will login into Cisco IOS devices
# and execute SNMP commands
# ###########################################################

# Define variables
set username “cisco”
set password “cisco”

# Define all the devices to be configured (separated by spaces)
set devices “192.168.56.100 192.168.12.2”

# Main loop
foreach device $devices {
puts “Processing device: $device”;

# Open a telnet session to device. I use Plink.exe to telnet
# because I find that normal telnet may not work or in case
# you don’t have telnet enabled on your system. Plink is the
# command line client of Putty. You can download plink from:
# http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
spawn plink -telnet $device

# Perform authentication to login into device
# My device configuration does not require enable password
# so I will be placed in privilege EXEC mode (#) not USER mode (>)
expect “Username:”
send “$username\r”

expect “Password:”
send “$password\r”
expect “#”

# Enter global configuration mode
send “conf t\r”
expect “(config)#”

# Send SNMP configuration
send “snmp-server community SNMP_COMM\r”
expect “(config)#”
send “snmp-server host 192.168.56.2 SNMP_COMM\r”
expect “(config)#”

# Return to privilege EXEC mode
send “exit\r”
expect “#”

# Exit Telnet session
send “exit\r”
expect eof

}

source: http://resources.intenseschool.com/using-expect-scripting-language-to-automate-cisco-configuration-tasks/

Posted in Cisco R&S | Leave a comment

MPLS and EIGRP, going the Distance, (Admin Distance).

http://blog.ine.com/2010/07/19/mpls-and-eigrp-going-the-distance-admin-distance/

Posted in Cisco R&S | Leave a comment

Cisco Catalyst 3750 QoS Configuration Examples

Link | Posted on by | Leave a comment

Configuring MGCP

Link | Posted on by | Tagged , | Leave a comment

TFTD32 Manual Cisco Phone firmware upgrade

Link | Posted on by | Leave a comment

ANI based call blocking

Link | Posted on by | Leave a comment