×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

UCCX 8.x XML file from Statistics

Answered Question
Dec 15th, 2013
User Badges:

                   I am currently working on creating an XML file from stats in the CSQ's. Based upon what I have read, due to the file being updated quite often, I believe I have 3 choices:


1) Write/overwrite to the customer directory (havent figured this one out), also thought about trying to update it in the /default/webapps/ROOT folder as I can have an app on the phone look directly there (like this one, dont know if possible).

2) Write the xml file to an external server where it is retrieved (believe to be my best option, havent figured this out either)

3) Quit


I have written the script, transformed it properly (I believe) but unable to write anywhere


The script and xml template are attached, although the script (after the stats collection) may be in a tattered state. Any help would be greatly appreciated, thank you.


Platform is uccx 8.0.2 (was on 7.02, 8.02 is a necessary interim hop to 8.6)

License is Premium

Correct Answer by Gergely Szabo about 3 years 8 months ago

Hi,

OK, let's do it this way: remove the last three steps - (Set, Set, Write) and place a Send HTTP Response step as the last step (well, I mean, before the End step), with Document = statsData.

Then insert a Set HTTP Contact Info step before the Send HTTP Response step, click the Headers tab, then the Add... button. We'll need the following headers:

Name: "Content-Type", Value: "text/xml" - so the IP phone knows it's not plaintext but XML;

Name: "Refresh", Value: "3" - for 3 seconds.

Save it, refresh it, create an application for it, add a HTTP Trigger, then use the http://:9080/

G.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (2 ratings)
Loading.
Jonathan Schulenberg Mon, 12/16/2013 - 03:08
User Badges:
  • Super Bronze, 10000 points or more
  • Cisco Designated VIP,

    2017 IP Telephony

Can you help us understand what you're trying to do with the XML file? I must confess that I'm confused why you would need to write this if you're just going to store it locally on the CCX server; any of the AEF scripts could just use Get Reporting Statistics step to retireve the data themselves.


  1. If you're going to store to the file system, you need to get the folder path you're allowed to write to. Use a Set step and set a String variable to System.getProperty(“uccx.customer.dir”)  I caution you that this folder is not backed up or replicated between the HA nodes and nor do you have an option to delete things from within the script, only the CLI.
  2. This is a a Send HTTP Response step though you must do the work to preapre the data; see the Step Reference Guide starting on page 92.
  3. You could store the individual data points, or even the entire Document variable into a session with a known Mapping ID that another script could retrieve from.
  4. You could upload to the Doc Repo; however, this is not good for high-frequency I/O; TAC has pointed me to a hashmap when I ran into Java heap issues due to the frequency. In other words, we changed the script to only hit the Doc Repo if it couldn't find the hashmap in an active session.



Please remember to rate helpful responses and identify helpful or correct answers.

g_wallace Mon, 12/16/2013 - 04:05
User Badges:

Jonathan,


I need the xml file for a CUCM application. The customer likes to view their stats on the phone. If Icould write via script to the  /default/webapps/ROOT folder this wouldnt be an issue.


Never found a page 92 on the step reference guide (they are numbered 3-4, 5-2, etc)

Not sure that #3 would help me for what I am trying to do

This would likely be a high frequency script (as far as updates go), so 4 probably wouldnt be good

Gergely Szabo Mon, 12/16/2013 - 04:17
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

Hi, you can easily create a HTTP application (I mean, a UCCX application, with a HTTP trigger). You can take the stats, create the XML on the fly, and then serve it up. All in one application. This might work well in a relatively small call center.

If you need something more sophisticated, and asked me, then I would create a minimalistic web server with an Apache HTTP server (or if you insist, IIS); then do the following: create a HTTP application in UCCX that saves the information on to the filesystem of this web server periodically (perhaps triggered by a cron job or something similar) and serve up this XML to the phones from the web server's local file system. This does not put (almost) any load on the UCCX, as calculations and I/O operations are done only once in a while, but hundreds or even thousands of phones would be able to access the information using our little web server.

G.

g_wallace Mon, 12/16/2013 - 04:34
User Badges:

This may work well, there are only about 50 agents on this uccx system. Just tested the transform from my xml template though and I get nothing...somewhat perplexing.

Gergely Szabo Mon, 12/16/2013 - 04:41
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

Hi,

can you please explain in detail what you mean by "I get nothing". Did you try reactive debugging? Does the value of the statsData variable change?

Also, I noticed the template XML file contains expressions like this: %expression% but the Keyword Transform Document step looks for expression (without %'s). It's not a technical problem, but expect the result XML contain % after the transformation, too. Like %12% or %applepie% - I guess this is not your intention.

G.

g_wallace Mon, 12/16/2013 - 05:00
User Badges:

I do a stepthrough and I get 0's (which is a system not in production yet, this is an upgrade from a 7.x uccx) which I expect, just the transform document (when I write it) gives me nothing (a 0 byte file, which when i open is empty). I thought I needed the "%" signs to denote the variable placeholders.

Gergely Szabo Mon, 12/16/2013 - 05:16
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

OK, this way: when doing the reactive debug, do you see the value of statsData changing from DOC[] to BIN[something] and then TEXT[something] when you reach the only Set step in your script (I am looking at the script you posted the other day).

G.

g_wallace Mon, 12/16/2013 - 06:58
User Badges:

Finally got a file to write the proper data to the customer directory. The "%" signs are not there and the variables are. Now the problem I have is accessing the "Customer" directory directly (even possible) to retrieve the xml file. I know there are some other ways with Java to push to a web server, but I am not a Java person at all.


Should I try to write the file elsewhere (within the repository) and push from there...somehow. I am happy the file wrote but now am faced with getting it to where it needs to be.


I did see the satus go from "DOC[] to BIN[xx], problem was I wrote over it in the next step with an unnecessary assignment

Gergely Szabo Mon, 12/16/2013 - 07:21
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

Hi,

well, it depends on what you want to do. You can create an HTTP application sitting on the UCCX server, reading the already prepared XML file from the customer directory and send it back.

Or, the other way, forget the UCCX customer dir and save the XML with the script that creates it - on a separate server. Again, it's up to you, what kind of protocol you would like to use: Samba (Windows share), SFTP, FTP - or, you can even save that XML in a database.

I can help you with both approaches.

G.

g_wallace Mon, 12/16/2013 - 07:34
User Badges:

Any benefits on one over the other? I am leaning towards the HTTP application on the uccx server. Also needsing some auto refresh...would that change thoughts on the method?

Gergely Szabo Mon, 12/16/2013 - 07:51
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

Hi,

well, I would choose a completely different approach (firing SQL commands periodically, or even setting up a monitoring session with UCCX CTI, compile the information into a nice and neat XMLish thing the Cisco IP phone can understand - but all this requires a separate server. A very minimalistic one, but it's not an all-in-one solution).


I understand this is a relatively small call center, I guess 50 agent phones asking for stats from time to time won't kill the UCCX. So I'd say it's alright to go with the HTTP application approach.


Auto refresh is easy, as the IP Phone understands the HTTP refresh header. But just to save cycles, I wouldn't go over 3 seconds.


G.

g_wallace Mon, 12/16/2013 - 08:13
User Badges:

So what do I need to do to make this happen. Should I upload my updated script? New script (StatsSub.aef) has been uploaded.

Correct Answer
Gergely Szabo Mon, 12/16/2013 - 08:33
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

Hi,

OK, let's do it this way: remove the last three steps - (Set, Set, Write) and place a Send HTTP Response step as the last step (well, I mean, before the End step), with Document = statsData.

Then insert a Set HTTP Contact Info step before the Send HTTP Response step, click the Headers tab, then the Add... button. We'll need the following headers:

Name: "Content-Type", Value: "text/xml" - so the IP phone knows it's not plaintext but XML;

Name: "Refresh", Value: "3" - for 3 seconds.

Save it, refresh it, create an application for it, add a HTTP Trigger, then use the http://:9080/

G.

g_wallace Mon, 12/16/2013 - 08:54
User Badges:

Thank you Gergely, this has done exactly what I needed. Five stars to you!

Actions

This Discussion

Related Content