Retrieving Music On Hold (MOH) Files from CUCM

Author
William Bell
Vice President, Solutions and Products

Recently I was working with a customer that wanted to ensure that remote sites that used SRST enabled routers had access to the same corporate Music On Hold (MoH) audio file whether they were in SRST mode or not.  Unfortunately, they did not have an electronic version of the MoH audio file readily available.  I found a way to download the MoH file from the existing CUCM cluster for distribution.

{readmore}

With CUCM 5.x and later, you no longer use the TFTP service to distribute MoH files to the MoH servers.  Instead, you have to upload the MoH files to the publisher node and any subscriber nodes that are used as MoH servers.

Files can be uploaded using the CCMAdmin portal on each node that requires the file.  However, you cannot download the files already on the server from the CCMAdmin page.  Instead, you have to use the CLI to download the file.

Preparation

You must have a SSH client (to remote terminal to the CUCM node) and you need to have an SFTP server available.  NetCraftsmen recommends either Titan or copSSH on Windows based systems and openSSH on *nix systems.  Titan is a package that must be purchased while copSSH is a port of cygwin and openSSH for Windows systems.

Procedure

  1. Connect (using SSH) to the CUCM node that has the MoH audio server role or the publisher node.
  2. To list the music files use the command: file list activelog mohprep.
  3. You will see a list of MoH files in various formats (ulaw, alaw, g729, etc.). Identify the file(s) you would like to download.
  4. Retrieve the file using the command: file get activelog mohprep/<filename>
    1. You can use specific filename: e.g. mohprep/mymohfile.ulaw.wav
    2. You can use a mask: e.g. mohprep/*.ulaw.wav

During the file retrieval process you will be asked to specify a SFTP server, SFTP user ID, and location.  Keep in mind that the file will be retrieved using the following convention:

/<location specified by user>/<ip or server name>/<date/time stamp>/mohprep/<file(s)>

From here you can edit and/or distribute the files as is required to suit your needs.  In my case, I used TFTP to upload them to the SRST router flash and then configured the SRST router to use the appropriate file.

10 responses to “Retrieving Music On Hold (MOH) Files from CUCM

  1. Hi William,

    This is a little off topic from your original post, but it is relative to MOH. I have a customer that is transitioning to CallManager. They have several different departments and want different MOH for each one so they will be multicasting audio source files. We want to be able to update the MOH files by dropping new audio of the same filename into the audio translator. The problem is that the IPVMS service does not recognize the new audio file unless the Admin goes into the MOH Server and updates the audio source file there. Is there any way to have the new audio begin playing as soon as it is translated. We would like to find a way to do this without Admin intervention. I believe a stop/restart of the IPVMS service did not start the new audio. Can you assist?

  2. Steve,

    Good question. I am assuming your customer is using a Windows based CM system (e.g. 4.1(3)) since you are using the audio translator. There are a few moving parts to MOH on CM 4.x. When you copy files to the audio translator service folder (c:program filesciscomohdropmohaudiosourcefilesher) the audio translator service is doing a few things. First, it takes the source file and creates multiple copies in various codecs. These files are copied to the c:program filescisco ftppathmoh folder. Second, it creates an XML file in the .. ftppathmoh folder.

    However, the MOH server does not use the files in the .. ftppathmoh folder to play out its music. It uses the .wav files in the c:program filesciscomoh folder. In the normal scenario, when you update/load a new audio source, the file is serviced by the TFTP server to the MOH server and everything works as you desire.

    I am not sure what your objectives are but I am assuming you would like either an automated method to update the MOH files or, at a minimum, a method where you can do an update quickly without "refreshing" each audio source. In this case, you could try the following:

    1. copy the source audio files to c:program filesciscomohdropmohaudiosourcefileshere as you normally would
    2. after the codec files are created, STOP the TFTP Service on all TFTP servers and STOP the IPVMS services on all MOH servers
    3. copy the appropriate wav files (e.g. *.ulaw.wav) from your c:program filescisco ftppathmoh folder (on one of the tftp servers) to your c:program filesciscomoh folder on your MOH servers
    4. Restart the TFTP service
    5. Restart the IPVMS service

    The reason you have to stop the IPVMS service is because if you try to copy a file to the c:program filesciscomoh folder while IPVMS is running you will get a sharing violation. The reason you have to stop the TFTP service is because the TFTP services files from cache and not directly from the file system (unless you have modified the appropriate service parameter). So, if you were to stop IPVMS, copy the files, and then start IPVMS (without restarting TFTP) the "old" MOH file will be rewritten to the ..ciscomoh folder.

    It also doesn’t work if you restart IPVMS and TFTP without copying the files. The IPVMS service doesn’t know that it should pull a new MOH file. I was surprised by this myself, but I tested it out and I got consistent results.

    Now, this method isn’t perfect as there is still a piece missing. Recall that the MOH translater will create an XML file. In that XML file you will find two child nodes: LowDateTime and HighDateTime. These fields are what triggers the "audio source update" message in CCMAdmin. They trigger this message when the time stamps in the XML file don’t match the time stamps recorded in the SQL database MOHAudioSource table.

    Finally, I must put a disclaimer on all of this. I did test this procedure out on a 4.1.3 cluster in my lab and it performed consistently each time but your mileage may vary. In addition, this method is [u][b]not [/b][/u]approved by Cisco Systems as far as I know. I also don’t use this method on production systems so I can’t provide any guarantees to how well this would work in production. Basically, [b][i]do this at your own risk[/i][/b] and make sure you keep backups of the audio source files just in case.

    Regards,
    Bill

  3. Hi William,
    Thanks for the instructions. We went ahead and tried to download Cisco Call Manager’s default audio file to modify according to your procedure above. All seemed to go well, except that the actual audio file, SampleAudioSource.ulaw.wav did not download. The directories were created (i.e. //mohprep) but no file. Any ideas? Thanks.

    Mark

  4. Hey Mark,

    I tried to duplicate your results in my lab. I tested on 6.1.1, 6.1.2, 6.1.3, and 7.1.3 CUCM clusters. I also tried different "file get" commands. I was not able to duplicate the issue. Since you were able to create the folder structure but not the file, I thought the issue may be permissions related.

    I am not sure what OS your SFTP server is running. I am using Windows Server. I found that I could duplicate the issue you describe easily if I modified the "Create Files/Write Data" permission on the target folder/path for the SFTP user account. After modifying the permissions, I could create folders but the files were not copied. The CUCM did not kick out an error at the console either.

    I am not as well versed on file/folder permissions on *nix systems (I know the basics of chmod). I know that you can restrict file writing access but I am not sure if there is a way to allow a user account to write/create a folder structure but at the same time restrict them from creating files.

    Anyway, right now it seems like you may have a permissions issue of some sort. Have you been able to download other files from the CUCM system using the same SFTP user and same root folder path on the SFTP server?

    Regards,
    Bill

  5. Hi, we just want one of the sites to play a certain file, I uploaded that to routers flash configured as SRST but it is not playing the file i uploaded. I was wondering what are the steps of making this work properly regardless the fact of SRST or not. Thanks

  6. Sam,

    If I follow, you wish to play MoH from a branch router during normal (non-SRST) operation. Instead of laying out the steps here check out the SRST Administration guide (http://www.cisco.com/en/US/docs/voice_ip_comm/cusrst/admin/srst/configuration/guide/srs_moh.html).

    While it is in the SRST guide and you need SRST licensed and configured on the branch router, the admin guide lays out a method that you can use during non-SRST (normal) operation.

    HTH. – Bill

  7. Hi am not able to copy the .wav file to core FTP mini-sftp-server. After entering required commads it says "download directry"- I tried with everything it says "invalid download director" what should I do and what are the settings. Any help would be appreciated. Antony

  8. Antony,

    If I follow you, you are getting an error at the console when you are attempting a download and that the error is related to the target directory on your SFTP server. If you are trying to download to the "root" of your SFTP directory then you may want to try the path: ./ instead of /. I am taking a wild guess here, so if I am way off base, I apologize.

    If you could post the output from your CLI session, that would help.

    HTH.

    Regards,
    Bill

  9. Hi,
    I have added the a music-on-hold file with the right settings on Call Manager 8.6 but doesn’t have any luck with the music, it is quite. I have tried with different bit rate like 48, 32, 16 khz and restarting the IP media service without any luck. When I select the default sample media on phone’s line settings, it plays the sample music. Anybody has any idea how to resolve this issue?

Leave a Reply