08-26-2021 06:15 AM
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.
Solved! Go to Solution.
08-26-2021 11:53 AM
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.
08-26-2021 07:48 AM
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.
08-26-2021 08:08 AM
what happens is that I am programming it in java, that's why my question
08-26-2021 08:18 AM
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>
08-26-2021 09:03 AM
I'm looking for something like this, if you can.
another question, how would you send the audio through soapui or java? In what format
08-26-2021 09:18 AM
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.
You'd specify the file here, in the XML:
<sourceFile>?</sourceFile>
08-26-2021 10:45 AM
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?
08-26-2021 11:25 AM - edited 08-26-2021 11:25 AM
Quoting from the document I posted for you twice as a link:
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.
|
08-26-2021 11:53 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide