How do I change agents in a Dialogflow CX Avaya integration for two different agents in a subdialog? - dialogflow-cx

I have two Dialogflow agents, each one has been tested and working independently. Now I want to be able to call agent1, then pass the caller to agent2, do more processing, then pass the caller back to agent1 with the new data that agent2 had collected.
I want to leverage the Avaya-provided technology as much as possible.
Avaya Experience Portal v8.1.1
Google Dialogflow CX agents
I've tried this with a vxml subdialog (using Avaya's default/sample apps as reference) but I can't figure out how to change agent1's Conversation Profile Automated Agent string to instead be the one for agent2.
I've also thought about using one of the dialogflow API's but haven't used them before so not sure their capabilities.
Is a plain phone transfer an option in this case? Not sure how the data would get passed if I did.
Here's the form of my vxml code:
<form id="invokemainmenu">
<property name="com.avaya.asr.vendor" value="dialogflowasr"/>
<subdialog name="dialogflowapp" src="http://localhost/mpp/misc/dialogflowapp/AuthIVR811.vxml">
<param name="calledAsSubDialog" value="true"/>
<param name="sipInfoFromParent" expr="session.connection.protocol.sip"/>
<filled>
<!-- once the subdialog has been filled(completed and returns), we pass control to a different form -->
<goto next="#invokeagent2"/>
<form id="invokeagent2">
<property name="com.avaya.asr.vendor" value="dialogflowasr"/>
<subdialog name="dialogflowapp" src="http://localhost/mpp/misc/dialogflowapp/AuthIVR811.vxml">
<param name="calledAsSubDialog" value="true"/>
<param name="sipInfoFromParent" expr="session.connection.protocol.sip"/>
<filled>
<!-- process data here? -->
<prompt bargein="false">
<audio src="http://localhost/mpp/misc/dialogflowapp/prompts/test/DialogflowFinished.wav"/>
</prompt>

Related

Cordova : How to diagnose ajax not working for UWP (windows store) application

I have a simple Cordova application, where when built, and running as a Windows UWP application, has ajax calls are somehow being blocked my work network.
I have asked this many times before, but thought would try to reword, as have never got any solutions.
The application ajax calls work fine on my home machine, or whats seems to be most other networks. When it works, I can see all the output in Wireshark
When on my work machine, connected to our work Network, I see absolutely nothing in Wireshark. If I point to a server running on localhost, the app does work (but I see nothing in Wireshark, but perhaps this is because it is localhost)
If I run the app outside of the UWP container, ie I just run on the same machine, on the same network, but via the desktop browser (as you do for Cordova to debugging), it also works fine.
So it appears to be blocked before it even gets to the Network, as we see nothing in Wireshark at all, so this rules out host not reachable, CORS etc as it hasn't even been sent to the server.
I can run this in debug via Visual Studio, and I run the following test code...
document.addEventListener('deviceready', callUrl, false);
function callUrl() {
console.log('callUrl');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
var DONE = 4; // readyState 4 means the request is done.
var OK = 200; // status 200 is a successful return.
console.log(xhr.readyState);
if (xhr.readyState === DONE) {
if (xhr.status === OK)
console.log(xhr.responseText); // 'This is the returned text.'
} else {
console.log('Error: ' + xhr.status); // An error occurred during the request.
}
}
xhr.open('GET', 'https://httpbin.org/get');
xhr.send(null);
};
onreadystatechangeis called twice, with xhr.readyState first 2 and then 4.
status is always 0.
How can I diagnose what is blocking this?? I have absolutely no idea. This is something low level, but how to see what? I have also looked through Windows Event logs, but can find nothing.
The Ajax call just returns 0 with a blank description. Our Network administrator just says there is something wrong with my app (I have tried multiple Cordova apps, including just basic test apps)
Thanks in advance for any help.
[EDIT1]
In response to the comment from #Xavier, all I have in my AppxManifest.xml (that I extracted from my built .appxupload file) is
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
There is some documentation on the capabilities here, where we have the following (right at the bottom of the page)..
The following capabilities are unavailable when deploying your Remote Mode application to the Windows Store:
Enterprise Authentication (enterpriseAuthentication)
Shared User Certificates (sharedUserCertificates)
Documents Library (documentsLibrary)
Music Library (musicLibrary)
Pictures Library (picturesLibrary)
Videos Library (videosLibrary)
Removable Storage (removableStorage)
Internet client/server (internetClientServer) - note that internetClient is still permitted
Private network client/server (privateNetworkClientServer)
I am not sure were we even set these in Visual Studio (config.xml), but also the above seems to be saying some of these can't be used?
Should the internetClient be enough (I only want to call out to a server as a client, not act as a server).
Also, this seems to be enough to work on most Networks except for my Work..
[EDIT2]
In response to the reply on the CSP...
There is a discussion on this here. The test Cordova app I created in Visual Studio does have this :
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
Surprisingly, I don't see this in my Ionic index.html, but perhaps this is because it is using the white list plugin?
My Ionic application has the following in the config.xml
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="http://localhost:8080/*" />
....
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
It would be great if the ajax even had some error saying it was something to do with CSP if that is what it is, but we just get nothing.
Once again, it is weird that the problem only occurs on my work network (either on cable or our WIFI). If I run the exact machine (e.g. a Surface tablet)over another connection (e.g. tether it to my phones cell), then all works as expected. So it must be some setting to do with the network (or firewall maybe), which also I find strange as surely I would at least then see something in Wireshark.
Would be great to be able to "debug into" the ajax call, and see where it is failing.
[EDIT 3]
After reading one of the comments, I used fiddler to see if I could see anything, which I do...
It even reports 200 (which is not correct), my request still fails.
According to this, you need to request the privateNetworkClientServer capability in order to communicate with a local network.
Note that this capability only works if you app is configured for local mode (your app will be rejected from the store if using this capability in remote mode).
To enable local mode, you need to set <preference name="WindowsDefaultUriPrefix" value="ms-appx://" /> in your cordova config.xml.
Note that local mode might lead to other issues, as you cannot use e.g. inline scripts in local mode (CSP violation)

Gmail contextual gadget doesn't appear after GAM SDK Test install

I cannot manage to see a contextual gadget in Gmail after Test Install Flow in Google Apps Marketplace SDK.
These are the steps I took to create the project, logged as a domain administrator:
create Google Apps console project
create OAuth2 client
enable GAM SDK
configure the SDK page with COB extension:
Extractor Url: google.com:HelloWorld
GadgetUrl: URL of gadget spec
Extractor param name: Test
Extractor param value: .*
Scopes: Mail - Subject Line, Mail - Message Body
I didn't add any additional Oauth2 scopes than the userinfo.email and userinfo.profile that are already there, and the Universal Navigation link is just a file that redirects to Gmail( since I am trying a very simple variant of the project to see if I can get it to work ).
I press Test Install flow, I am asked to give permissions in a Oauth combined window, I am redirected to my Universal navigation link, then Gmail. The app appears in the Google Apps Admin control panel and seems to have installed successfully, it is ON for all domain users.
I tried Gmail with different domain users, cleared cache, logged out and back in to Gmail, I am probably missing a configuration somewhere.
This is the gadget spec:
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Title" description="Desc" author="" author_email="" author_location="" scrolling="false" height="20">
<Require feature="dynamic-height"/>
<Require feature="google.contentmatch">
<Param name="extractors">
google.com:HelloWorld
</Param>
</Require>
</ModulePrefs>
<Content type="html" view="card">
<![CDATA[
<script type="text/javascript">
<!-- Fetch the array of content matches. -->
matches = google.contentmatch.getContentMatches();
var matchList = document.createElement('UL');
var listItem;
var extractedText;
for (var match in matches) {
for (var key in matches[match]) {
listItem = document.createElement('LI');
extractedText = document.createTextNode(key + ": " + matches[match][key]);
listItem.appendChild(extractedText); matchList.appendChild(listItem); }
}
document.body.appendChild(matchList);
gadgets.window.adjustHeight(100);
</script>
]]>
</Content>
</Module>
Couple of suggestions -
Use the nocache option to force your Gmail UI to update. Use this link - https://mail.google.com/mail/u/0/?nogadgetcache=1#inbox
Try as a different account on the domain. I've seen some cases where the "developer/admin" inbox takes time to update

Windows Media Player - 500 Internal Server Error

Hi my application is MVC, have a view with windows media player, it plays on my local host but not on the hosting server, MIME is set up correct.
Here is my script:
<object codebase="http://www.apple.com/qtactivex/qtplugin.cab"
classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<param name="url" value="../../Video/1.wmv"/>
<embed src="../../Video/1.wmv"
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed>
</object>
I tried same script in a simple HTML file, it worked well on the server.
I get 500 Internal Server Error (shown in Fiddler). Any suggestions.
Try using a helper:
<param name="url" value="#Url.Content("~/Video/1.wmv")" />
<embed src="#Url.Content("~/Video/1.wmv")"
This will ensure that a correct url to the video file is generated. In this example I suppose that you have a Video sub-directory and the file is inside this directory.
As far as the 500 error is concerned, I suppose it is not related to the code snippet you have shown. Try looking at the server's EventLog where unhandled exceptions are traced.

How does it happen Azure web role entry point and .aspx page handler are run in different processes?

I'm playing with this Azure web role sample. It contains a class derived from RoleEntryPoint and a .aspx page that contains a button click handler.
I test it in Azure Emulator. I put the following code (taken from here)
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
in both role OnStart() and the button click handler. When role OnStart() is invoked it happens to run in WaIISHost.exe under MachineName\\MyLogin account and when button handler code is invoked it happens to run in w3wp.exe under MachineName\\NETWORK SERVICE account. That's surprising.
Why are these pieces of code from the same role project run inside different processes and under different accounts? Can I change that?
David is correct. In addition to that, you can turn off this behavior and run everything in the hostable web core (as it worked before SDK 1.4). You just need to comment out the "Sites" section in the services definition like in the example below:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="aExpense.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="aExpense" vmsize="Medium">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="HttpsIn" endpointName="HttpsIn" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
<Setting name="DataConnectionString" />
<Setting name="allowInsecureRemoteEndpoints" />
</ConfigurationSettings>
With Windows Azure v1.3 and beyond, a Web Role takes advantage of the full IIS, rather than Hosted Web Core. IIS runs in a separate appdomain.
See this blog post from the Windows Azure team for the gory details.

Asp.Net Webforms security - breaks app moving to .Net 4

I've moved an application from WebForms in .Net 3.5 to .Net 4. The only change was to the web.config to remove the 3.5 extensions, since they are part of .Net 4 now.
I have the following applet tag (Persists software JUpload control) in a site securied using FormsAuthentication and a custom principal:
<APPLET
id="UploadCtl"
CODE="persits.transfer.gui.UploadUI.class"
ARCHIVE="JUpload.jar"
WIDTH="99%" HEIGHT="200"
NAME="JUpload" MAYSCRIPT="yes"
>
<PARAM NAME="cabbase" VALUE="JUpload.cab" />
<PARAM NAME="UseSockets" VALUE="false" />
<param name="DNDOverrideEnabled" value="true" />
<PARAM NAME="ShowTransferButton" VALUE="false" />
<PARAM NAME="AllowAddFiles" VALUE="true" />
<param name="AllowRemoveFiles" value="true" />
<param name="UploadURL" value="/site/manageDocumentsPost.aspx" />
<param name="FinalURL" value="/site/manageDocuments.aspx" />
<PARAM NAME="DebugInformation" VALUE="true">
<param name="MaxFileSize" value="2500" />
<PARAM NAME="Cookie1" VALUE="ASP.NET_SessionId=<% =SessionId %>">
<PARAM NAME="Cookie2" VALUE="<%=FormsCookieName %>=<%=FormsCookieValue %>">
</APPLET>
Basically the control will post to the url specified in UploadURL. The two cookie parameters are there to ensure that the user's SessionId and FormsAuthTicket are sent by the upload applet when doing the post.
As I stated, this works perfectly in .Net 3.5 (CLR 2.0). Moving to .Net 4, CLR4, what seems to happen is that the request for /site/ManageDocumentsPost.aspx gets redirected to the logon page, and the control then displays this assuming the upload went fine. The post page never actually executes it's code though (and the post should return nothing, thus causing the control to ask for the FinalUrl).
Using Fiddler I can see that the manageDocumentsPost causes a redirect, and this redirect has a different Asp.Net SessionId.
Any ideas what might have changed to cause this? More importantly, any ideas to get it functioning again?
Thanks
Andy
Ok, I figured out how to get this working.
previously I was storing the principal in session, and loading in the AquireSessionState event.
Now I store the principal in the cache during logon and write some information into the ticket to allow me to locate it in the cache.
In the AuthenticateRequest event, if the user is authenticated I can easily find the actual principal and get it from the cache. For some reason though the control causes this event to fire unauthenticated, but the session and formsauthcookie are both present in the request. I decrypt the auth cookie, and then use the information in the ticket to find the principal again.
In this way the user is authenticated by the end of the event handler, and everything can proceed normally.
Hope that helps someone else.

Resources