Adding new MoH MPEG3 using AXL ?

Version 1
    This document was generated from CDN thread

    Created by: Francois Leclair on 16-10-2010 03:57:49 AM
    Hi team,
     
    I'm wondering if it is possible using the CUCM APIs to add new MoH files to CUCM ?  Instead of the manual process that needs to be taken to place new music files on CUCM, customer would like to automate this task with an application.
     
    Is this possible ?
     
    Many thanks in advance,
     
    Francois

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: David Johle on 08-02-2012 04:05:20 PM
    I hate to sound like a "me too!" howeverI am also very interested in scripting the MoH file update process.  I inquired with TAC about such a possibility and was referred to the CDN.  I have yet to find anything promising in the API documents.  In fact, this thread is the only mention of programmatic MoH updating.

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: James Wagner on 08-02-2012 05:25:28 PM
    I would guess that the docs are going to have something in that would help.  I've never done it, so can't say for certain, but just a brief glance shows a AddMohAudioSourceReq object.  It naturally follows that there would be a method that would use this, but again I really don't know for certain.  (I'm brand new to AXL and just trying to be helpful. )

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: David Johle on 08-02-2012 06:04:21 PM
    I did see the MOH related calls in the docs, but they all seem to do with add/list/update/remove operations on the servers or sources themselves, nothing related to the files which contain the actual audio.  Maybe this has something to do with an inability for doing file transfers with AXL?  That's just a guess though.

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: David Staudt on 09-02-2012 11:21:54 AM
    Unfortunately there is not a designated API for uploading these files to UCM.  Once the files are there they can be managed via AXL, but uploading them must be done manually, or perhaps in a pinch (not supported) via scraping/mimicking the HTML UI pages functionality.

    Subject: RES: New Message from David Johle in Administration XML (AXL) - Administrat
    Replied by: Victor Castro on 09-02-2012 05:56:52 AM
    Hi All,

    How can I cancel my account or stop to receive e-mail from this forum, please?

    Thank very much.

    Att,
    Víctor Castro
    Desenvolvimento
    Wittel

    ¿Esta mensagem é endereçada exclusivamente à(s) pessoa(s) e/ou instituições acima indicadas e pode conter informações confidenciais, particulares ou privilegiadas. O uso dessas informações por pessoas não autorizadas está sujeito às penas da lei."
    "This message is intended only for the named person's and/or entity's use and may contain confidential, proprietary or legally privileged information. The misuse of the information contained herein is subject to legal penalties."

    De: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
    Enviada em: quarta-feira, 8 de fevereiro de 2012 19:05
    Para: cdicuser@developer.cisco.com
    Assunto: New Message from David Johle in Administration XML (AXL) - Administration XML Questions: RE: Adding new MoH MPEG3 using AXL ?

    David Johle has created a new message in the forum "Administration XML Questions":

    --------------------------------------------------------------
    I hate to sound like a "me too!" howeverI am also very interested in scripting the MoH file update process. I inquired with TAC about such a possibility and was referred to the CDN. I have yet to find anything promising in the API documents. In fact, this thread is the only mention of programmatic MoH updating.
    --
    To respond to this post, please click the following link:

    <http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5119257>

    or simply reply to this email.

    Subject: RES: New Message from James Wagner in Administration XML (AXL) - Administra
    Replied by: Victor Castro on 09-02-2012 05:56:53 AM
    Hi All,

    How can I cancel my account or stop to receive e-mail from this forum, please?

    Thank very much.

    Att,
    Víctor Castro
    Desenvolvimento
    Wittel

    ¿Esta mensagem é endereçada exclusivamente à(s) pessoa(s) e/ou instituições acima indicadas e pode conter informações confidenciais, particulares ou privilegiadas. O uso dessas informações por pessoas não autorizadas está sujeito às penas da lei."
    "This message is intended only for the named person's and/or entity's use and may contain confidential, proprietary or legally privileged information. The misuse of the information contained herein is subject to legal penalties."

    De: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
    Enviada em: quarta-feira, 8 de fevereiro de 2012 20:25
    Para: cdicuser@developer.cisco.com
    Assunto: New Message from James Wagner in Administration XML (AXL) - Administration XML Questions: RE: Adding new MoH MPEG3 using AXL ?

    James Wagner has created a new message in the forum "Administration XML Questions":

    --------------------------------------------------------------
    I would guess that the docs<http://developer.cisco.com/documents/25212/192390/8.5%281%29%20Cisco+Unified+CM+AXL+Schema+Reference?redirect=http%3a%2f%2fdeveloper.cisco.com%2fweb%2faxl%2fdocs%3fp_p_id%3ddoc_library_summary_portlet_WAR_doclibrarysummaryportlet_INSTANCE_DXka%26p_p_lifecycle%3d0%26p_p_state%3dnormal%26p_p_mode%3dview%26p_p_col_id%3dcolumn-1%26p_p_col_count%3d3> are going to have something in that would help. I've never done it, so can't say for certain, but just a brief glance shows a AddMohAudioSourceReq object. It naturally follows that there would be a method that would use this, but again I really don't know for certain. (I'm brand new to AXL and just trying to be helpful. )
    --
    To respond to this post, please click the following link:

    <http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5120584>

    or simply reply to this email.

    Subject: RES: New Message from David Johle in Administration XML (AXL) - Administrat
    Replied by: Victor Castro on 09-02-2012 05:56:53 AM
    Hi All,

    How can I cancel my account or stop to receive e-mail from this forum, please?

    Thank very much.

    Att,
    Víctor Castro
    Desenvolvimento
    Wittel

    ¿Esta mensagem é endereçada exclusivamente à(s) pessoa(s) e/ou instituições acima indicadas e pode conter informações confidenciais, particulares ou privilegiadas. O uso dessas informações por pessoas não autorizadas está sujeito às penas da lei."
    "This message is intended only for the named person's and/or entity's use and may contain confidential, proprietary or legally privileged information. The misuse of the information contained herein is subject to legal penalties."

    De: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
    Enviada em: quarta-feira, 8 de fevereiro de 2012 21:04
    Para: cdicuser@developer.cisco.com
    Assunto: New Message from David Johle in Administration XML (AXL) - Administration XML Questions: RE: Adding new MoH MPEG3 using AXL ?

    David Johle has created a new message in the forum "Administration XML Questions":

    --------------------------------------------------------------
    I did see the MOH related calls in the docs, but they all seem to do with add/list/update/remove operations on the servers or sources themselves, nothing related to the files which contain the actual audio. Maybe this has something to do with an inability for doing file transfers with AXL? That's just a guess though.
    --
    To respond to this post, please click the following link:

    <http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5120653>

    or simply reply to this email.

    Subject: RE: RES: New Message from David Johle in Administration XML (AXL) - Adminis
    Replied by: Simon Granger on 09-02-2012 06:31:29 AM
    Log into the forum, and select My Subscriptions and then unsubscribe from the actions menu.
     
    Anytime you post you will be re-subscribed.
     
    Thanks for the last 4 posts saying how do i unsubscribe!
     
     
     
     
    Hi All,

    How can I cancel my account or stop to receive e-mail from this forum, please?

    Thank very much.

    Att,
    Víctor Castro
    Desenvolvimento
    Wittel

    ¿Esta mensagem é endereçada exclusivamente à(s) pessoa(s) e/ou instituições acima indicadas e pode conter informações confidenciais, particulares ou privilegiadas. O uso dessas informações por pessoas não autorizadas está sujeito às penas da lei."
    "This message is intended only for the named person's and/or entity's use and may contain confidential, proprietary or legally privileged information. The misuse of the information contained herein is subject to legal penalties."

    De: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
    Enviada em: quarta-feira, 8 de fevereiro de 2012 21:04
    Para: cdicuser@developer.cisco.com
    Assunto: New Message from David Johle in Administration XML (AXL) - Administration XML Questions: RE: Adding new MoH MPEG3 using AXL ?

    David Johle has created a new message in the forum "Administration XML Questions":

    --------------------------------------------------------------
    I did see the MOH related calls in the docs, but they all seem to do with add/list/update/remove operations on the servers or sources themselves, nothing related to the files which contain the actual audio. Maybe this has something to do with an inability for doing file transfers with AXL? That's just a guess though.
    --
    To respond to this post, please click the following link:

    <http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5120653>

    or simply reply to this email.


    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: Dan-Anders Hook on 09-02-2012 07:44:15 AM
    Hi,

    Haven't tested (yet), but I think that files can be uploaded the same way as you can upload files to the TFTP server. Maybe not the prettiest way, but at least it can be done programmatically. See the thread referenced below for info on how to upload to the TFTP:

    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/1670066?_19_redirect=http%3a%2f%2fdeveloper.cisco.com%2fweb%2faxl%2fforums%2f-%2fmessage_boards%2fsearch%3f_19_searchCategoryId%3d1052601%26_19_keywords%3dtftp%26_19_breadcrumbsCategoryId%3d1052601%26_19_redirect%3dhttp%253a%252f%252fdeveloper.cisco.com%252fweb%252faxl%252fforums%252f-%252fmessage_boards%253f_19_mbCategoryId%253d1052601

    Dan

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: Dan-Anders Hook on 09-02-2012 02:00:58 PM
    I'm hoping Cisco will add functionality for file handling to some API later on. CUCM already has DIME for downloading trace files, and one way could be to enhance with upload/download capabilities for other files as well. It's painful to upload MoH-files on large clusters with many MoH-servers...

    Anyway, I looked into how this can be done by mimicking the UI and found a working solution. Here's an example using curl:

    (Hopefully I'll get the formatting/syntax correct in the post this time...)

    First we need to login and create a session cookie:
    1
    2curl -i -k -v -L -c cookie.txt -b cookie.txt -d appNav=ccmadmin -d j_username=administrator -d j_password=<password> https://192.168.0.10/ccmadmin/WEB-INF/pages/j_security_check



    Then we send the file "ToneOnHold.wav".
    1
    2curl  -v -H "User-Agent: Mozilla/5.0 (compatible; MSIE 9.0;)" -k -b cookie.txt -F file=@ToneOnHold.wav;type=audio/wav https://192.168.0.10/ccmadmin/mohAudioFileUpload.do


    CUCM is picky on the user agent. Leaving it to Curl default did not work.

    It is possible to repeat the send command several times (until the session expires).

    The cookie.txt must probably be deleted before running a second time. The reason both "-d" and "-c" is in there is that there is additional information added then the 302 is followed after login.

    This is not very clean (and as David stated, not supported). The detailed return value, provided you get 200 OK, is embedded in the HTML we receive upon completion. For example:

    1
    2<fieldset><legend>Status</legend><table summary='Page Status Information'><tr><td style='vertical-align: middle'><img id='status-info-img' alt='Informational Message' src='/ccmadmin/th
    3emes/VtgBlaf/Information24.gif'/></td><td id='status-info-txt' style='vertical-align: middle'>Upload successful</td></tr></table></fieldset>



    Cheers,

    //Dan

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: Dan-Anders Hook on 09-02-2012 05:15:46 PM
    David,

    Thanks, I thinks it's fun to dig into issues like that ;-)

    Regarding the audio files not being activated, maybe an AXL "doDeviceReset" (with soft restart) would help? I agree it may not be the best choice since it might restart all streams. Haven't tested, but I think it won't restart until the MOH-server is inactive. Which of course may never happen in a busy system... Anyway, just a thought.

    Cheers,

    Dan

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: David Johle on 09-02-2012 03:32:54 PM
    Dan,

    Thanks for posting up those cURL commands!
    I hadn't actually sat down and spent the time to sniff out all the traffic and come up with that, so this will save me the hassle.

    I'll get those going for easier automated updates to my MOH... well once I can get my "files uploaded don't take effect" issue resolved.  Which, on a side note, is an interesting issue...

    From what I understand, and have experienced in the past, the only requirement to update a MOH source with new audio content is to upload a new file with the same name to each of the cluster nodes (hence the desire for a simple way to programatically upload).  Well, in my case, it never updates for some reason, and my workaround is to delete and recreate the entire audio source as well.  I have a case opened already with TAC about it...starting to think it's a bug or something, but it's proving to be a real pain to figure out.

    Subject: RE: Adding new MoH MPEG3 using AXL ?
    Replied by: James Wagner on 09-02-2012 05:13:31 PM
    Very cool of you to figure out & post those curl commands - should come in handy in the future for more than just this application!

    David, this is just my gut instinct here and I don't know if it applies in the MOH realm, but simply replacing the files with one of the same name sounds to me like something that would require a reset of whatever feed the MOH system is using to stream the audio.