cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6731
Views
5
Helpful
17
Replies

UCCX Script step only works in Reactive Debug

tsuntken
Level 1
Level 1

Running UCCX 8.5 SU3 HA

I have a script in UCCX that makes a call to a Web Page so the Web Page can do some processing. I run a Create URL Document step and then a Create XML Document step.

My issue is that it is only working when I am Reactive Debugging. When I call the script without being in Reactive Debug it doesnt seem to make the call to the URL.

Ive turned up the UCCX tracing but cant see any errors in MIVR. I looked at the IIS logs (where the web page is that is being called) and I do not see the GET coming in when not Reactive Debugging. I do see it when I am Reactive Debugging.

I have verified that both UCCX servers are IN_SERVICE and I also verfied that my CRS Editor is connected to the MASTER. I have also re-uploaded the script several times and refreshed the application a few times. I also verified that I can ping the external IIS Web Server from the UCCX OS Administration page. I also up'ed the Timeout in the Create URL Step to 20000 to test it.

I attached a screen shot of my script... although I dont think the script is the issue since it works 100% of the time while in Reactive Debug but 0% of the time when not...

Any help or assistance in pointing in the right direcvtion would be greatly appreciated.

Thanks in advance!

Tom

2 Accepted Solutions

Accepted Solutions

I was able to put together a quick test and I encountered exactly the same issue that you describe above.  When running through the debug or reactive debugging the application, the reqest was shown in the web server log.  However, when I placed a call without reactive debugging, it would not make the request.  I was able to get the request to work every time by adding the Set step after my CreateXMLDoc step.  Not sure why it works, but it does.  I've encountered this before and this is what I have used to resolve it in the past.  Hope this helps.

Ed

View solution in original post

Anthony Holloway
Cisco Employee
Cisco Employee

For my specific UCCX version and environment, I have ran enough tests to know that:

1. If the URL is static, then the Editor preloads the URL contents when you save the script, and this is what the Engine uses for its value.  It does not pull fresh content from the web server.  Let me say that another way: UCCX does not make an HTTP request to the web server.

Additionally, when active or reactive debugging the script, the HTTP requests come from the PC in which you are running the Editor on.  Not from UCCX.  And it's never cached, it pulls it everytime.

Example of static URL:

Set url_doc = URL[http://10.10.10.10/home/]

2.  If the URL is dynamic, then the Editor, whether reactive or active debugging, while defer to UCCX to make the HTTP request.  UCCX will not cache the contents, and thus pull fresh data everytime.

Example of dynamix URL:

Set url_doc = URL["http://10.10.10.10/home/?uuid=" + (new Date()).getTime()]

The dynamic URL will have to be computed at runtime, everytime.  An example of the resulting URL from that is:

http://10.10.10.10/home/?uuid=1375475818865

With that knowledge, it looks like what's happening here is a simple matter of UCCX caching your URL, and not pulling it at runtime.  However, with that knowledge, I also see that you do have a dynamic URL, in that you are prepending the ANI to the URL string.  The only difference I can think of is that my code:

(new Date()).getTime()

Is causing some sort of internal difference in the way the URLs are handled, versus the variables you are prepending.

I was not using the Create URL Document step, I was simply using a URL document literal and casting it to a String to cause the request to trigger.

E.g.,

Set http_response = URL[http://10.10.10.10/home/]

Moving to a Create URL Document solution, I noticed that the above mentioned behavior changes, and that the HTTP request is not made by the editor pc, but instead is made by the node for which you refresh the application on.  E.g., I was logged in to my primary node when I refreshed the app, so then my web server logs showed the primary server making the request.  Even though my secondary node is actually the Engine Master right now.

So, how about trying to modify your Create URL Document step, add a new field, and name it:

uuid

and give it the value:

"" + (new Date()).getTime()

There is way more going on here than I ever thought, and I'm learning a lot, even if what I'm learning is that there's very little I know about how this works.  :/

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

View solution in original post

17 Replies 17

Anthony Holloway
Cisco Employee
Cisco Employee

I don't have the answer but I did want to say that you have done a great job troubleshooting this issue and presenting here on the forum for others to help you.  Nice job.  I don't see that level of quality everyday.  I hope you get an answer, and I'll keep an eye on the post to see how things develop.

One simple suggestion: Could you confirm whether or not the HTTP GET is leaving the server with the CLI command "utils network capture" and then also comfirm the same for the PC where you are doing the reactive debug?  Wireshark is a great tool for reviewing captures.  Thanks and good luck.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Thanks Anthony, I tried to make every attempt to figure it out before posting. I always fee the more information provided will help everyone save more time....

I am going to try the Utils... command now... thanks for the pointer..

villarrealed
Level 1
Level 1

Tom,

The CreateURLDocument step only performs the request after the data in the document is used.  When you access the document later in your script, the URL request should be made.  If you want to test this out, place a GetXMLDocumentData step immediately following your CreateXMLDoc step and you will see that the URL request is made when it gets to the GETXMLDocumentData step.

Ed

villarrealed wrote:

The CreateURLDocument step only performs the request after the data in the document is used.

I'm sorry, but this is incorrect.  The Create URL Document never performs the request.

villarrealed wrote:

...you will see that the URL request is made when it gets to the GETXMLDocumentData step.

This is also incorrect.  The Create XML Document step is the step which triggers the request, and Tom does have that step right below his Create URL Document step.  You can validate this in a debug, as the value of the variable used in the Create XML Document output will hold the contents of the XML document regardless if you use/execute the Get XML Document Data Step.

I will give you that you can semi-succesfully execute the Creat URL Document step with a malformed Document, and you wouldn't even know it until your execute the Get XML Document Data step.  It would be at the time you attempt to read from the XML document that you would get an exception about an invalid XML document.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Anthony,

You are correct, the CreateURLDoc step does not perform the URL request.  I should have stated that the request is performed when an action is performed on the document.  What I was trying to get across is that most people will expect the execution of the URL request at that step and it is not the case.  However, I don't believe that the CreateXMLDoc step will trigger the request.  Let me run a test in my lab and I'll post the resutls...right or wrong.

Ed

Correct, the Create URL Document step does not perform the request.

However, I don't feel that this is the problem Tom is facing, as he knows what a good request looks like, during a debug, it's the production phone call that's not working.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

The Create XML Docuement does work, but only in Debug mode.

If anyone has an alternate way to make the request I would be happy ot try that.

I did do some Wireshark captures today and the results were consistent... I only saw the request come over during a Reactive Debug or Debug (didnt have to be Reactive Debug).

I was able to put together a quick test and I encountered exactly the same issue that you describe above.  When running through the debug or reactive debugging the application, the reqest was shown in the web server log.  However, when I placed a call without reactive debugging, it would not make the request.  I was able to get the request to work every time by adding the Set step after my CreateXMLDoc step.  Not sure why it works, but it does.  I've encountered this before and this is what I have used to resolve it in the past.  Hope this helps.

Ed

villarrealed wrote:

I was able to get the request to work every time by adding the Set step after my CreateXMLDoc step

Very nice find!  I am curious though, since the request is being made at the Set step, which is after the Create XML Document step, does that fail the XML document output, or does it retroactively apply and still work?

There are several steps which you can take to trigger the HTTP request.  Casting the URL document to a string, as you have done, is one of them.

I would say that this sounds like a defect.  Are you two running similar versions of UCCX?  I am going to try the same in my lab on version 8.5.1.11002-22.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Anthony,

I did not look at the resulting XML document, but a separate Document varaible can be used if you don't want to affect the original XML document.  I'm going on the assumption that Tom really doesn't care about the output and he is just attempting to post data to a web site and he is only using the CreateXMLDoc step to have it trigger the URL request.  My lab is 9.0.2 and I know I have run into this in versions 7.x and 8.x.

Ed

I didn't even notice the section is titled "Write to Log"

I would also use the Set string_variable = url_document method too then.  It's quick and easy.  The trouble seems to be with both the Create XML Document step, and the differences between where the HTTP request is sourced from during a JTAPI call, and a debug session.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Anthony Holloway
Cisco Employee
Cisco Employee

I have definitive proof that an Active Debug generates the HTTP request from the PC you are using the editor on.

My Apache logs show my PC ip address every single time I debug my script.  More to come as this developes.  I will put together a full suite of tests, and have the results published in a bit.  I smell a defect in the air.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Anthony Holloway
Cisco Employee
Cisco Employee

For my specific UCCX version and environment, I have ran enough tests to know that:

1. If the URL is static, then the Editor preloads the URL contents when you save the script, and this is what the Engine uses for its value.  It does not pull fresh content from the web server.  Let me say that another way: UCCX does not make an HTTP request to the web server.

Additionally, when active or reactive debugging the script, the HTTP requests come from the PC in which you are running the Editor on.  Not from UCCX.  And it's never cached, it pulls it everytime.

Example of static URL:

Set url_doc = URL[http://10.10.10.10/home/]

2.  If the URL is dynamic, then the Editor, whether reactive or active debugging, while defer to UCCX to make the HTTP request.  UCCX will not cache the contents, and thus pull fresh data everytime.

Example of dynamix URL:

Set url_doc = URL["http://10.10.10.10/home/?uuid=" + (new Date()).getTime()]

The dynamic URL will have to be computed at runtime, everytime.  An example of the resulting URL from that is:

http://10.10.10.10/home/?uuid=1375475818865

With that knowledge, it looks like what's happening here is a simple matter of UCCX caching your URL, and not pulling it at runtime.  However, with that knowledge, I also see that you do have a dynamic URL, in that you are prepending the ANI to the URL string.  The only difference I can think of is that my code:

(new Date()).getTime()

Is causing some sort of internal difference in the way the URLs are handled, versus the variables you are prepending.

I was not using the Create URL Document step, I was simply using a URL document literal and casting it to a String to cause the request to trigger.

E.g.,

Set http_response = URL[http://10.10.10.10/home/]

Moving to a Create URL Document solution, I noticed that the above mentioned behavior changes, and that the HTTP request is not made by the editor pc, but instead is made by the node for which you refresh the application on.  E.g., I was logged in to my primary node when I refreshed the app, so then my web server logs showed the primary server making the request.  Even though my secondary node is actually the Engine Master right now.

So, how about trying to modify your Create URL Document step, add a new field, and name it:

uuid

and give it the value:

"" + (new Date()).getTime()

There is way more going on here than I ever thought, and I'm learning a lot, even if what I'm learning is that there's very little I know about how this works.  :/

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hi Anthony

     I'm facing the same issue, it works in debug mode not in production. Below is how I call this. Any help will be much appreciated

thanks

Karthik

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: