cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1800
Views
3
Helpful
14
Replies

UCCX 8.x XML file from Statistics

g_wallace
Level 1
Level 1

                   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

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

14 Replies 14

Jonathan Schulenberg
Hall of Fame
Hall of Fame

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.

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

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.

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.

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.

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.

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.

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

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.

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?

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.

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

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.

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