Brad Peczka's Blog $ cat /dev/random > /dev/blog

20Sep/102

MGCP Voice Gateway Configuration in CUCM

I always remember one of these commands when setting up an MGCP Gateway in CUCM - hopefully putting them here will help someone else in the future!

! Let's ensure the proper host and domain names are set
Router(config)#hostname VoiceGateway
VoiceGateway(config)#ip domain-name mydomain.com
! Enable MGCP
VoiceGateway(config)#mgcp
! Specify the IP Address of our Primary Subscriber
VoiceGateway(config)#mgcp call-agent 10.10.10.10
VoiceGateway(config)#ccm-manager mgcp
! Specify the IP Addresses of our backup CUCM Servers (Secondary Subscriber, Publisher)
VoiceGateway(config)#ccm-manager redundant-host 10.10.20.10 10.10.10.11
! Specify the TFTP Servers (used by CUCM to deploy XML Config files - most important!)
VoiceGateway(config)#ccm-manager config server 10.10.10.10 10.10.20.10 10.10.10.11
! Enable the XML Config Service
VoiceGateway(config)#ccm-manager config
! That's it!
VoiceGateway(config)#end

So now your Gateway is configured and will be polling the TFTP Servers for an XML configuration file. This file is generated once the Gateway is added in CUCM, is refreshed each time a change is made, and is pushed to the Gateway via TFTP whenever the config is applied or the Gateway is reset. To check the status of the config download, run the 'sh ccm-manager' command from the Gateway:

VoiceGateway>sh ccm-manager
MGCP Domain Name: VoiceGateway.mydomain.com
Priority        Status                   Host
============================================================
Primary         Registered               10.10.10.10
First Backup    Backup Ready             10.10.20.10
Second Backup   Backup Ready             10.10.10.11

Current active Call Manager:    10.10.10.10
Backhaul/Redundant link port:   2428
Failover Interval:              30 seconds
Keepalive Interval:             15 seconds
Last keepalive sent:            05:48:52 UTC Sep 20 2010 (elapsed time: 00:00:13)
Last MGCP traffic time:         05:48:52 UTC Sep 20 2010 (elapsed time: 00:00:13)
Last failover time:             11:50:58 UTC Sep 2 2010 from (10.10.10.10)
Last switchback time:           12:13:50 UTC Sep 2 2010 from (10.10.20.10)
Switchback mode:                Graceful
MGCP Fallback mode:             Enabled/OFF
Last MGCP Fallback start time:  10:10:28 UTC Sep 2 2010
Last MGCP Fallback end time:    11:51:15 UTC Sep 2 2010
MGCP Download Tones:            Disabled
TFTP retry count to shut Ports: 2

Backhaul Link info:
    Link Protocol:      TCP
    Remote Port Number: 2428
    Remote IP Address:  10.10.10.10
    Current Link State: OPEN
    Statistics:
        Packets recvd:   7382
        Recv failures:   0
        Packets xmitted: 6512
        Xmit failures:   0
    PRI Ports being backhauled:
        Slot 0, VIC 1, port 0
Configuration Auto-Download Information
=======================================
Current version-id: 1284616589-a3cd44fe-86bb-486f-a62e-a78bf2a71840
Last config-downloaded:00:00:00
Current state: Waiting for commands
Configuration Download statistics:
        Download Attempted             : 11
          Download Successful          : 11
          Download Failed              : 0
          TFTP Download Failed         : 0
        Configuration Attempted        : 6
          Configuration Successful     : 1
          Configuration Failed(Parsing): 0
          Configuration Failed(config) : 5
Last config download command: New Registration
FAX mode: cisco
Configuration Error History:
ccm-manager music-on-hold
end

Take note of the error count shown above. This Gateway had been configured beforehand, and started generating errors when attempting to download the XML Config. It turned out that the router already had the 'ccm-manager music-on-hold' statement applied, and so running a 'no ccm-manager music-on-hold' command was all it needed to complete a successful download.

Finally, another tip most people forget is that the MGCP Domain Name must match the Gateway Domain Name as configured in CUCM - if it's not the same, the Gateway won't register. Just a little thing to keep in the back of your mind as you're configuring your Gateways... good luck! :-)

23Aug/100

Disabling the CUCM Corporate Directory

Situation: You want to disable the Corporate Directory on your Cisco IP Phones - maybe you're like me, and have ~300 phones in places where people shouldn't be able to look up the Managing Director's direct line.

Solution: You come across this awesome little post from the Chesapeake Netcraftsmen, which says (amongst other things) to assign these phones a new Common Phone Profile, configure Services Provisioning to use a External URL, and then disable Enterprise Subscription on the Corporate Directory. Right?

... not quite. In a situation where the Corporate Directory is required on more phones than not, having to subscribe each phone to it is a pain in the proverbial. However, if you plug a dummy URL into the 'Directory' Data Location on your phone configuration, it also wipes out your Missed/Placed/Received calls directories. Cisco's website is unsurprisingly sparse on where this information is pulled from, and how to get it back if you're in my situation.

Dumping the Console Log on a phone shows that the phone requests a phoneservices.xml file upon boot, which lists the Services that the Phone is subscribed to. This file looks very similar to the format of the http://cucmpublisher:8080/ccmcip/xmldirectory.jsp file (which provides the Personal/Corporate Directory URLs), other than it doesn't actually have any URLs in it.

On a whim, I cooked up an XML file with similar contents to the phoneservices.xml file, hosted it on a test server, and pointed a test phone to this file via their 'Directory' URL. The phone reloaded, and the Missed/Received/Placed Calls directories were back in business. You can get a copy of the file here, or view the actual code after the break.