<div dir="ltr">All good info Mike, and thank you for the conversation!<div><br></div><div>The Content-Length header is in fact missing from the server response.</div><div><br></div><div>Interestingly, when I add a content length header, the browser/client now "completes" the transaction at the first 10 second delay.</div><div><br></div><div><div><div><img src="cid:ii_k612qx996" alt="image.png" style="margin-right: 0px;"><br></div></div></div><div><br></div><div><div><img src="cid:ii_k612syxk7" alt="image.png" style="margin-right: 0px;"><br></div></div><div><br></div><div><div><div><img src="cid:ii_k612qgek5" alt="image.png" style="margin-right: 25px;"><br></div></div></div><div><br></div><div><br></div><div>So, we now have a working solution for Matt, where he doesn't need the Trigger Application step.  Rather, he simply needs to set the Content-Length header.  Sorry!  ;)</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 30, 2020 at 11:46 AM Norton, Mike <<a href="mailto:mikenorton@pwsd76.ab.ca">mikenorton@pwsd76.ab.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-CA">
<div class="gmail-m_-5886066746223608543WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">An HTTP conversation ending is not necessarily the same thing as the TCP connection closing. Often they are, but that is not a safe
 assumption. If you are waiting for the TCP connection to close, then really you’re waiting for the wrong thing. You can tell the HTTP conversation is done when as many bytes of content have come in as was specified in the content-length header. Either party
 could close the TCP connection at that point, if it wants.<br>
<br>
Firefox would know that, of course. So it sounds like maybe the server does not send a content-length header, or is indeed sending the initial bit of content then waiting.<br>
<br>
If you can do the request with HTTP 1.0, it might be worth seeing if that gives different server behaviour. Otherwise I guess it is workarounds on the Cisco side or a custom HTTP client implementation.<br>
<br>
-mn<br>
<br>
<u></u><u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> Anthony Holloway <<a href="mailto:avholloway%2Bcisco-voip@gmail.com" target="_blank">avholloway+cisco-voip@gmail.com</a>>
<br>
<b>Sent:</b> January 30, 2020 10:01 AM<br>
<b>To:</b> Norton, Mike <<a href="mailto:mikenorton@pwsd76.ab.ca" target="_blank">mikenorton@pwsd76.ab.ca</a>><br>
<b>Cc:</b> Matthew Loraditch <<a href="mailto:MLoraditch@heliontechnologies.com" target="_blank">MLoraditch@heliontechnologies.com</a>>; <a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<b>Subject:</b> Re: [cisco-voip] HTTP Response for HTTP Triggered Script<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Thanks for adding to the conversation Mike.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I did some testing and, here is the script I am testing with:<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><img width="391" height="89" style="width: 4.0729in; height: 0.927in;" id="gmail-m_-5886066746223608543_x0000_i1025" src="cid:16ff79f19d64cff311" alt="image.png"><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If I open up the dev tools in FF, the browser is spinning the whole 20sec, and there is no status code next to the request. (not a very exciting screenshot):<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><img width="1915" height="138" style="width: 19.9479in; height: 1.4375in;" id="gmail-m_-5886066746223608543_x0000_i1026" src="cid:16ff79f19d65b16b22" alt="image.png"><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But then once the 20 seconds expire and the script ends, the browser fully loads the page and now shows the 200 status code, plus some timing details:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><img width="1903" height="217" style="width: 19.8229in; height: 2.2604in;" id="gmail-m_-5886066746223608543_x0000_i1027" src="cid:16ff79f19d7692e333" alt="image.png"><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If I get timings out of Fiddler, it looks like this (where we can see the 10 second gaps between sending the request, server starts to respond, server finishes response):<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<blockquote style="margin-left:30pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ACTUAL PERFORMANCE</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">--------------</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ClientConnected: 10:25:10.973</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ClientBeginRequest: 10:25:11.158</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">GotRequestHeaders: 10:25:11.158</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ClientDoneRequest: 10:25:11.158</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">Determine Gateway: 0ms</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">DNS Lookup: 0ms</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">TCP/IP Connect: 0ms</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">HTTPS Handshake: 0ms</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ServerConnected: 10:25:10.986</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";background:rgb(255,242,204)">FiddlerBeginRequest: 10:25:11.158 <--- Fiddler passing the client's request to the server</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ServerGotRequest: 10:25:11.158</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ServerBeginResponse: 10:25:21.161</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";background:rgb(255,242,204)">GotResponseHeaders: 10:25:21.162 <--- Fiddler receives HTTP response Headers</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";background:rgb(255,242,204)">ServerDoneResponse: 10:25:31.163 <--- Fiddler receives the connection close from server</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ClientBeginResponse: 10:25:31.163</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ClientDoneResponse: 10:25:31.163</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">Overall Elapsed: 0:00:20.005</span><u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">And if I use Postman to try and set the Connection header to close, the server does not honor it (and from my research, it does not have to), and so it still takes 20 seconds to close the connection.  Interestingly, in Postman, I can see
 the response Headers after 10 seconds, but it does not render a body until after 20 seconds.  So the Send HTTP Response is actually sending headers and body content, but the client is not rendering any body content until the request is complete.  Contrast
 that with FF, which shows no header/status code until the full 20 seconds expires.  Each client is coded a little different I guess.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I did do some testing with wireshark, but either my skills in it are too limited to show anything of more value than what I already knew, or the app simply wont show anything new and exciting beyond what I already gathered.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">In short, it would seem as though the server is in ultimate control of closing the connection, and I just don't see how we can affect that, other than executing the End step.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Perhaps Cisco should have included a toggle in the Send HTTP Response step to also close the connection?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Jan 29, 2020 at 6:15 PM Norton, Mike <<a href="mailto:mikenorton@pwsd76.ab.ca" target="_blank">mikenorton@pwsd76.ab.ca</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="color:rgb(31,73,125)">I know nothing about UCCX, but from an HTTP perspective, the problem does not quite make sense as described.<br>
<br>
If the HTTP server is “spitting back some HTML” then it had to have also spit back a status code. The status code is in the HTTP response headers before the content. Content cannot possibly have come without a status code.<br>
<br>
Perhaps your developer is waiting for the TCP session to close (which is not the same thing as an HTTP response ending), but neglected to request that HTTP keep-alive not be used? In HTTP 1.1, keep-alive is the default. If the server supports keep-alive but
 the requestor does not want it, then the request needs to have “Connection: close” in the headers.<br>
<br>
-mn</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> cisco-voip <<a href="mailto:cisco-voip-bounces@puck.nether.net" target="_blank">cisco-voip-bounces@puck.nether.net</a>>
<b>On Behalf Of </b>Matthew Loraditch<br>
<b>Sent:</b> January 28, 2020 6:06 AM<br>
<b>To:</b> <a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<b>Subject:</b> [cisco-voip] HTTP Response for HTTP Triggered Script</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Got the following comment from the developer who is writing an app that will queue a call via http trigger:</span><u></u><u></u></p>
<p class="MsoNormal"><i><span lang="EN-US">It seems like the MobileApp integration is accepting my request, spits back some HTML, but the HTTP request remains open until the queued call is answered.</span></i><u></u><u></u></p>
<p class="MsoNormal"><i><span lang="EN-US"> </span></i><u></u><u></u></p>
<p class="MsoNormal"><i><span lang="EN-US">Ideally, that HTTP request would be closed with a successful HTTP status code (e.g. HTTP 200) when the call was queued, so that I can report back to the user
 that they can wait for a callback. </span></i><u></u><u></u></p>
<p class="MsoNormal"><i><span lang="EN-US"> </span></i><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I understand his problem, but I see no way  of fixing it. The send http response command doesn’t seem to have any settings but the doc sent back. Is this normal
 behavior or can I do something with the doc being sent back to make it work?</span><u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

</blockquote></div>