How to download music-on-hold (MOH) file from CCM5x 6X 7X server

One of the our customer was upgrading his CCM from 5 to  6 but wanted a fresh install of CCM6.x music on hold server (MOH). He installed CCM6 but didn’t have any clue of how to download the MOH file from the older server and put in the new server.

Therefore, he called the EXPERT [of courese me] for help. I never did this in the past so, I had to dig through google and fouund the solution for him and that really worked. I thot this will be helpful to the folks who are looking for downloading a moh file from ccm5/6/7 servers.

Its as easy as drinking a beer in a BAR.

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  fane 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).

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

Thats 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
fi

#
# 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——————-

Push

CCIE voice#21569
blog: pushkarbhatkoti.wordpress.com


About this entry