Reading of file and playing IVR

Document created by cdnadmin on Jan 25, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: Manas Varma on 14-01-2013 05:12:10 AM
Hi Guys,
  Does any one have a working script for reading the contents of the XML file present in the repository and then generating an IVR on teh basis of that. We are stuck here with this proposition and don't know how to move ahead with this. We are quite new to the CCX Editor and haven't had much experience on working with UCCX Scripts. Any help with this, will be highly appreciated. Thanks..

Subject: RE: Reading of file and playing IVR
Replied by: Joerg Wesely on 14-01-2013 05:50:11 AM
Hi, see attached a little example script. I currently have no test system available, so I couldn't test it, but the validation seems ok. Let's say you have a xml file in your document repository looking like the attached one named data.xml. This document can be accessed by creating a Document variable with the literal DOC[data.xml], let's call it sourceDoc. Note that the file has to be placed in the repository's folder with the default language configured in UCCX administration, usually en_US. To read the data, use the step "Create XML Document" with sourceDoc as source Document and a new Document variable xmldoc as output document. Now, xmldoc can be used in the "Get document data" step together with the XPath-Expression "//ccdata/promptname" to put the value from the promptname-tag, "announcement" in this case, into the String variable promptname. To use a prompt "announcement.wav" from the prompt repository, create a Prompt variable and use the "Set" step to give it the value P[promptname+".wav]. Now, you can use this Prompt variable in the "Play Prompt" step. I hope that helps Regards, Jörg