cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1897
Views
0
Helpful
8
Replies

Music Hold On AXL

Sebastian74842
Level 1
Level 1

Hi,

How can I upload a file to create a music on hold? I am using the java api.
if you can help me, thank you.

1 Accepted Solution

Accepted Solutions

While you can manipulate MOH sources using AXL as shown above, actual management of the MOH .wav files themselves cannot be done via API (as far as I know) - you must use the admin web UI to upload/delete them.

View solution in original post

8 Replies 8

npetrele
Cisco Employee
Cisco Employee

You don't need Java or AXL to upload music on hold files. Here's all you need to know about Music On Hold, how to upload files, what file format you need, etc.

 

https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/admin/12_5_1/featureConfig/cucm_b_feature-configuration-guide-1251/cucm_b_feature-configuration-guide-1251_chapter_0110101.html

 

what  happens is that I am programming it in java, that's why my question

That's a rather complex way of doing things that are otherwise very simple.  But here's what I can tell you.

First, you need to know how to program AXL requests with Java.  Here's a sample for you:

 

https://developer.cisco.com/docs/axl/#!hello-world-with-java

 

The AXL request you're looking for is updateMohAudioSource.  See the XML sample below, taken from SoapUI. I recommend testing everything with SoapUI before you try Java. Once you have it working in SoapUI, then you can start coding the same request in Java using the SoapUI XML as a guide.  (SoapUI is a free testing tool for Soap - you can get it here: www.soapui.org)

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/12.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:updateMohAudioSource sequence="?">
         <!--You have a CHOICE of the next 2 items at this level-->
         <uuid>?</uuid>
         <sourceId>?</sourceId>
         <!--Optional:-->
         <newName>?</newName>
         <!--Optional:-->
         <sourceFile>?</sourceFile>
         <!--Optional:-->
         <multicast>?</multicast>
         <!--Optional:-->
         <mohFileStatus>?</mohFileStatus>
         <!--Optional:-->
         <initialAnnouncement uuid="?">?</initialAnnouncement>
         <!--Optional:-->
         <periodicAnnouncement uuid="?">?</periodicAnnouncement>
         <!--Optional:-->
         <periodicAnnouncementInterval>30</periodicAnnouncementInterval>
         <!--Optional:-->
         <localeAnnouncement>English United States</localeAnnouncement>
         <!--Optional:-->
         <initialAnnouncementPlayed>?</initialAnnouncementPlayed>
         <!--Optional:-->
         <isExternalSource>?</isExternalSource>
      </ns:updateMohAudioSource>
   </soapenv:Body>
</soapenv:Envelope>

I'm looking for something like this, if you can.

 

https://github.com/CiscoDevNet/axl-java-samples/blob/master/src/main/java/com/cisco/axlsamples/addPhone.java

 

another question, how would you send the audio through soapui or java? In what format

 

I've pretty much exhausted all that I can tell you.  If you want to do something like the addPhone example, check out how it was done here:

 

https://github.com/CiscoDevNet/axl-java-samples

 

There are different ways of using Java with AXL. The first example I cited is the simplest way, because it just uses Java to send and receive XML via SOAP:

 

https://developer.cisco.com/docs/axl/#!hello-world-with-java

 

Your sample from Github is the more difficult way, and it isn't something I can teach in a communities forum.

 

This link that I provided earlier tells you all you need to know about audio format.  You don't send audio through SoapUI or Java, you use SoapUI or Java to upload an audio file. 

 

https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/admin/12_5_1/featureConfig/cucm_b_feature-configuration-guide-1251/cucm_b_feature-configuration-guide-1251_chapter_0110101.html#CUCM_TK_UE3C01A0_00

 

You'd specify the file here, in the XML:

 

         <sourceFile>?</sourceFile>

 

 

 

it's okay.
I am confused when uploading an audio.
If I want to upload an audio called "audio.wav", how can I upload it? Do I have to change it to xml format? or to another format?

Quoting from the document I posted for you twice as a link:

 

Upload Audio File for Music On Hold

Use this procedure if you want to upload customized audio files that you can make available as Music On Hold audio streams.

Procedure


Step 1

From Cisco Unified CM Administration, choose Media Resources > MOH Audio File Management.

Step 2

Click Upload File.

Step 3

Click Choose File and browse to the file you want to upload. Once you've selected the file, click Open.

Step 4

Click Upload.

The Upload Result window shows the result of the upload. The uploading procedure uploads the file and performs audio conversions to create codec-specific audio files for MOH. Depending on the size of the original file, processing may take several minutes to complete.

Step 5

Click Close to close the Upload Result window.

Step 6

Repeat this procedure if you want to upload additional audio files.

Note 

When you import an audio source file, Cisco Unified Communications Manager processes the file and converts the file to the proper formats for use by the Music On Hold server. Followoing are examples of valid input audio source files:

  • 16-bit PCM .wav file

  • Stereo or mono

  • Sample rates of 48 kHz, 44.1 kHz, 32 kHz, 16 kHz, or 8 kHz

Note 

MOH audio source files do not automatically propagate to other MOH servers in a cluster. You must upload an audio source file to each MOH server or each server in a cluster separately

While you can manipulate MOH sources using AXL as shown above, actual management of the MOH .wav files themselves cannot be done via API (as far as I know) - you must use the admin web UI to upload/delete them.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: