One of our customers 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 that this will help other folks who are looking for downloading no 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 a 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 window and simply use ‘ssh root@ccmip’ to log into a call manager publisher. After ssh you will get a prompt similar below:
admin:
Step#2 Setup an FTP server to put files from no server to an 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.
Subdirectories 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 the 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!
Cheers, Push
Hi there!
I’m trying to do this myself but get stuck at the first hurdle: the root password. Is the root account not disabled in some way? How did you get around this?
Cheers!
Mike.
Hi there!
I’m trying to do this myself but get stuck at the first hurdle: the root password. Is the root account not disabled in some way? How did you get around this?
Cheers!
Mike.
Hi Mike,
Sorry to hear that you are not getting the root prompt. Unfortunately Cisco has done very good job and root account is by default locked.
I got around this and posted it on the web re “how to get” root access to CCm but I got caught by “Cisco Police” and I had to remove that thread from my blog.
-push
Awesome blog yo! After reading this I’ll be sure to get the honeys… I am no longer anchored to the phone to listen to my favorite songs. 🙂
Do you think the songs are proprietary?
Ben
Your blog is good site
hapleng
Hi,
Can you help me in uploading MOH using CLI? When we use GUI we get the error find.java.sql.SQLException: A system error Occurred. We need a workaround for us to upload the new MOH. Thank you!
Pushkar…
Is there a way to upload a new source file to CCM without using the GUI?
Hi Derick,
Sorry for the late reply.
Yes there is a way to upload in CCM via web interface. In CCM look in the media resource column or where you have MOH server audio file. it allows to upload from that interface.
HTH
-Push
Hi,
Is there a way to directly SFTP a MOH file to a remote branch router for SRST MOH updates?
Thanks,
Craig
Hi Craig,
Multiple way to do bulk upload to remote routes:
1. If you’ve any NMS tool like Cisco works, any router management tool. use that
2. If you’ve no NMS tools, you need to write up a simple DoS or Unix shell (whaever you like) to upload the MOH file to remote routers. for this you need to enable FTP or SFTP on all routers and then schedule the dos batch file or unix shell script to upload.
3. Use EEM on all remote routers to pickup the image from the SFTP or FTP server.
I used EEM to do this that was really easy.
HTH
-Push
hi
im get this error
Invalid download directory specified.
directory is create but no file in it
Make sure your download directory is correct in the SFTP server.
that is what its saying 🙂
-Push
when I do this file transfer complete but nothing is in my sftp directory but a bunch of folders. NO files? What gives any ideas ?
Hi,
The easiest way is backing up the CUCM and extracting the wave files from the .tar file.
It worked for me.
Cheers,
Hamid
Great Post!
I’ve been wondering how to grab the SampleSourceAudio and this procedure works like a charm.
Thanks for Sharing.
Dude, filezilla has to be the wooooooooorrrrsssst piece of #(*U#() software ever. Anyhing zilla is unnecesarily complicated
I have used this procedure successfully for most files, but have problems with filenames that have a space in them. Do you know how to address this issue? or how to indicate a space? I have tried using a \ to indicate a special character and using ” and ‘ but have not found a solution to sftp transfer these files.
thanks,
Is there anyone who has the audio file for the music that cisco uses? I have driven myself nearly mad trying to find it!
Hi.
Access Denied in IP 4.2.2.2 protocol SFTP.
Server is shut down?
Why?
Option 2 is dead as of CUCM 8.5 and newer because the TAR files are encrypted and cannot be unzipped by anything other than the Cisco DRS Restore procedure.
Hi pftmaniac,
Actually u can unzip tar with DRS restore password 🙂
thanks for pointing out.
Thank yoou.
Very good procedure.
These are truly fantastic ideas in concerning blogging.
You have touched some good factors
here. Any way keep up wrinting.
Hi there,
thanks for the good guide. I managed to get my MOH Files as mentioned in Option 2 : USING CUCM BACKUP.
I got the Files froma CUCM 7 and now i want to upload these Files to a CUCM 9.
Whats the best way to do this?
I have the*.alaw.wav, *.g729.wav, *.ulaw.wav and the *.wb.wav File.
Which one and how do i upload them?
I used the GUI to upload it but when i want to choose the new i file i get the error message that the File was not found?
This blog was… how do I say it? Relevant!! Finally I’ve found something that helped me.
Thanks!
Hi. I know this is kinda old but i have to ask, How do i get the custom announcement uploaded to CUCM. I am unable to find that anywere
Kind regards.
Jón Ragnar
Good question. Noted I will lab it up and let you know.
always i used to read smaller articles that as well clear their motive, and that is also happening with this post which I am reading at this place.