Posts Tagged ‘how to download moh file from cisco call manager 5x 6x 7x’

One of  our customer was upgrading  CUCM version 5x cluster to version 6x. They wanted a fresh install of CCM6.x cluster cluster and were wondering how to get the old MOH file from CUCM v5x cluster so that they can put it on the new CUCM v6 cluster. Therefore, they contact an expert [of resource me] for help. The fact was that I never did this in the past. I had to dig through google and  the solution for him and that really worked. I thot this will help other folks who are looking to downloading moh file from cucm 5/6/7 servers. Trust me on this, it’s a piece of cake, there are 2 ways to do this:

OPTION#1 – USING CUCM OS CLI:

Step#1: SSH to CCM 5/6/7x publisher
Unfortunately, there is no way we can pull MoH file via GUI interface. The only way I know is via CLI. You can use putty.exe if you are a windows  fan or I use Ubuntu so i just open a terminal windows and simply use ‘ssh root@ccmip’ to log into call manager publisher. After ssh you will get a prompt similar below:
admin:

Step#2  Setup a FTP server to put  file from moh server to a ftp server.
Setup a SFTP server. I use SSHD as a SFTP server. For windows you can download filezilla sftp server from below url:http://filezilla-project.org/
Create a username and password in sftp. We will use this username and password in step #$

Step#3  List MOH related filesin the call manager
Use a command called “file list activelog mohprep/*” to list all moh files in the mohprep directory.
You will see output similar to below:
admin:file list activelog mohprep/* ← note * means all files
SampleAudioSource.alaw.wav
SampleAudioSource.g729.wav
SampleAudioSource.ulaw.wav
SampleAudioSource.wb.wav
SampleAudioSource.xml
CiscoMOHSourceReport.xml

Step#4 Download the moh files to a SFTP server
Use a command called “file get activelog mohprep/filename”to download above listed file(s), here is an example:
admin:
file get activelog mohprep/ SampleAudioSource.alaw.wav
Enter SFTP server IP: 4.2.2.2 ← SFTP server IP
Enter SFTP username: test
Enter SFTP password: test
That’s all, your file is transferred to the FTP Server and you can use GUI interface to put the file to a new/other call manager publisher.
————————snippet————————-
admin:file list activelog mohprep/*
CiscoMOHSourceReport.xml                SampleAudioSource.alaw.wav
SampleAudioSource.g729.wav              SampleAudioSource.ulaw.wav
SampleAudioSource.wb.wav                SampleAudioSource.xml
dir count = 0, file count = 6
admin:
admin:
admin:file list activelog mohprep/*
CiscoMOHSourceReport.xml                SampleAudioSource.alaw.wav
SampleAudioSource.g729.wav              SampleAudioSource.ulaw.wav
SampleAudioSource.wb.wav                SampleAudioSource.xml
dir count = 0, file count = 6
admin:
admin:file get
file get activelog
file get inactivelog
file get install
file get tftp

admin:file get active
admin:file get activelog ?
Syntax:
file get activelog file-spec [options]
file-spec   mandatory   file to transfer
options     optional    reltime months|weeks|days|hours|minutes timevalue
abstime hh:mm:MM/DD/YY hh:mm:MM/DD/YY
match regex
recurs

admin:file get activelog mohprep/SampleAudioSource.xml
Please wait while the system is gathering files info …done.
Sub-directories were not traversed.
Number of files affected: 1
Total size in Bytes: 606
Total size in Kbytes: 0.5917969
Would you like to proceed [y/n]? y
SFTP server IP: 172.16.16.111
SFTP server port [22]:
User ID: push
Password: ********
Download directory: /home/push

This is the script when you add moh file and that gets replicated to all nodes:

[root@ccm5 bin]# more moh_do_backup.sh
#!/bin/bash
# moh_do_backup.sh script will make a tar ball for backup targets
# SYNOPSIS
# moh_do_backup.sh <log path> <status file path> <target node>
# Checking parameters
if [ $# -lt 3 ]
then
echo “Usage: $0 <log path> <status file path> <target node>”
exit 1
fi

LOGFILE=$1
STATUS_FILE=$2
NODE=$3

echo “0”  > $STATUS_FILE
echo “Starting MOH backup” >> ${LOGFILE}
sudo -u root /bin/tar cvfpP – /usr/local/cm/sftp/mohprep/* 2>>${LOGFILE} | sudo
-u drfuser ssh drfuser@${NODE}

RESULT=$?

if [ $RESULT -gt 0 ]
then
echo “MOH: Backup failed ($RESULT)”  >> ${LOGFILE}
exit 106
f#
# update status file to 100%
echo “100” > $STATUS_FILE

echo “MOH: Finished backup” >> ${LOGFILE}
exit 0

[root@ccm5 bin]#
[root@ccm5 bin]#
—————————–end of snippetts——————-

OPTION 2 : USING CUCM BACKUP:

This is probably easier option than the Option#1. One of my blog reader shared this option with me. Now I am wondering this would have been probably the easiest way. Thanks  Hamid (from orangehat.ca ) for sharing this.
Step#1
– Login to CUCM DR option and backup CUCM to a sFTP server. It will push CUCM backup to sFTP server in .tar.gz file.
Step#2 – Extract the backup (.tar.gz) file and look for the MoH file. Bingo…. there you go, your catch , the MOH file.

I hope this will help someone!