Any way to record Amazon Connect Contact Flow with Lex interaction? - amazon-lex

I have a working Lex bot inside a Contact Flow to prompt the caller with a series of questions. We have a requirement to have the entire interaction audio recorded. Per the documentation, https://docs.aws.amazon.com/connect/latest/adminguide/set-up-recordings.html, the recording does not start until after an agent (a.k.a. the softphone) answers the call. Since we're not using a softphone, is there any other alternative to getting a full recording of the Contact Flow interaction with Lex?
I see that the contact flow has logging and Lex has Conversation Logs where parts of the interaction are stored in separate objects and audio files, however, per our requirements we must have a single audio recording of the entire interaction.

The only thing I can think of is stitching the recordings from the Lex Conversation logs and the call recording together after the fact.
It looks like the recordings of the Lex utterances are stored in folder with the ContactID of the call as part of the object name. For example...
aws/lex/BOTID/ALIASID/VERSION/LANGUAGE/9c8b2dd7-736c-4b41-9d80-df6d774f4538/2943f259-fa34-4ccd-9128-03bccbeff0e3-ut-0.wav
and that first guid is the contactid for the call.
So you could have a lambda triggered on the Connect call recordings s3 bucket that then searches for the utterance wav files based on the contactid and then combines them with the actual callrecording.
Not ideal, but I don't think there is a simple solution.

Related

Options for combining multiple Amazon Lex bots

I work in a large enterprise where multiple teams are developing Lex bots (on separate accounts). Each bot supports a different domain or application,. In some cases, it would be nice for a single user interface to ask a question without needing to know which bot to ask. Is there a way to federate bots, or to forward un-recognized intentions to 'backup' bots?
I feel like what I really want to do is treat each bot as a skill is treated in Alexa, except I'm in the position (through entitlements) to know which 'skills' would be appropriate for a given user.
The answer here is that you would need to develop a custom application that delivers a user's input to each of your company's array of bots.
You'd need to look at the NLU Confidence score from each Bot's response to decide which response is the most accurate to return to the user. Would also be worthwhile keeping some state in your app to remember which Bot the user is currently interacting with and defaulting to that Bot for successive user inputs. Should you reach a point where the confidence score is low, it might present a signal to you to test the user's input across the other Bots.
What you'll need to be aware of here is that your costs will increase with each additional Bot that you add. So, assuming you have 5 area-specific Bots, one inbound message from your user could result in 5 Lex calls. As you start moving into significant volumes of interactions, this could start proving to be an obstacle.
An alternative would be to use a custom fallback intent to invoke a Lambda function that calls your Bot orchestration function. Assuming that you're able to find the correct Bot to handle the user's query, you'd need to remember that so succesive messages now get routed to that Bot.

For voice tasks in Twilio Flex, how do I get the current conference ConferenceSid?

I can see that for all the voice interactions, behind the scenes flex is using its voice API to create a conference between caller and worker. How do I obtain the created ConferenceSid after the task has been selected and reserved?
What I would like to do is simply Get the value upon connecting.
I can see a very long and not so pretty way of getting it, which is by running a twilio function that iterates over every conference, making additional requests to see the participants. But that seems way to complex to me.
I can see in the logs that the conference friendly is being printed
ConferencesState handleConferenceUpdate WT5d0800a3ce8724fd55cf89841c48XXX
Is there anyone who can help here?
UPDATE:
#philnash below answered the question exactly.
Twilio developer evangelist here.
There seems like a couple of ways to get hold of the Conference SID in a Flex interaction.
First, the task that your worker accepts has a number of attributes that are set by Flex and relevant for the type of task it is. For a voice call, you will find a conference key, which has an object including the sid as well as entries for the participants.
Secondly, I found that the <TaskCanvas> component in the UI is passed a context that includes a conference object. That object then has a source property which expands to an object with a conferenceSid property, as well as other properties, including a participants list.
Does that point you in the right direction?

Setting up call enqueueing and forwarding using Twilio Studio

I was recently trying to use the Twilio Studio to set up an IVR system to route the calls to the correct numbers based on the selected user input. I was able to create the following workflow and it works fine.
Here I am able to split the call based on user's input via keypad or voice and direct the call to the corresponding number. I am also able to track the number of times a user has pressed an invalid input and disconnect the call after a specific number of invalid inputs. It's all working fine.
Now I am trying to enqueue the calls so that users will stay in a queue while the agent is busy. I also want to forward the calls to a specif number and if that number does not pick or reject, call another number. This helps me to make sure that the calls are not missed. I also added a call forwarding option with recording enabled. But when I try to play the recording, it says an application error occurred.
I have been trying to contact support regarding the documentation or examples fo the above requirements, but it's very hard to get a reply as I don't have paid support enabled. Can anyone suggest good documentation with an example to handle my requirements.
Twilio developer evangelist here.
For queueing calls and then having more than one number called you should take a look at TaskRouter. It turns calls into tasks that can be assigned to workers via a workflow and can definitely handle your need to dial more than one person. You can then send your call into the workflow from Studio using the enqueue widget.
As for your recording issue, can you provide more detail? How did you add the call forwarding with recording option? How did you try to play the recording? Was there any more detail in the Twilio Debugger?

Save to OneDrive from ERP

We want to save documents to individual OneDrive Folders.
Currently:
User "Tim" generates a customer overview (Last visits, Revenue etc.) in our ERP-Sytem from Customer "TomCompany" and it will be automatically saved in an FTP-Folder. He's now able to have a look on this file at customers site with Good Reader on his iPad.
Plan:
First step: The customer overview should be saved directly to OneDrive, instead of an FTP-Folder.
Second step: Every Sales Person has his own OneDrive account, so it should be saved to his own account with user-Parameters etc. (which is not a Problem to manage in our ERP-API).
The question is: Is it possible to connect to OneDrive from a different System like ERP. "SaveFileToOneDrive with Authentication"
You can 'connect' to OneDrive through the given API with JavaScript.
Here is an example: https://dev.onedrive.com/sdk/js-v7/js-picker-save.htm .
You can now add the 'Save to OneDrive' button on every page you need it.
If not noticed yet, some examples for the API: https://dev.onedrive.com/sample-code.htm
Hope this helps you to solve your (for me still unknown) problem ;-)
I implemented own windows live API because of I found some problems with standard live api. It is based on REST API so there is layer with objects (file, folder, etc...) and each object has some equipment (i.e. file has method for upload and download file). Second layer is for communication with server side and object layer send requests into second layer which send it into server. Server sends response and second layer return this response into object layer.
I implemented onedrive function mainly because of I developed application which uploads some files into onedrive.
So it is very simple to use it. I describe it on webpage https://wlivefw.codeplex.com/
You can sign as user which onedrive want to use by connection object. Then you will need folder id where you want to create new file. Then you create file object with parent_id set to folder id, name (is required) and description (optional). And now you call File.Create(file object which you created, Stream object - data of origin file, OverWriteOption - if you want to overwrite file if exists or not or create with new name, and progress handler - delegate to method which you want to invoke when progress changed).
File uploading is implemented by BITS protocol, so you can upload file greater than 60MB. File is uploaded by fragment so if fragment uploading fails you can very easy send this fragment again - in exception when uploading fails is delegate to continue method which continue upload from last successfull fragment.
I would like to improve this library so library is free to use as well as source code. Please if you will expand this library send me your changes and I will build new version, etc... Thank you and I hope it is usefull.

Pubnub many private chats in ios

I am developing an ios app like Tinder. Users can chat only in private 1:1.
Should I have to open one channel for every single "match"? Is this the correct design pattern for this case study? What about performance if i have one channel per "match".
*Match" is when a user matches to another and can start a private chat.
If one person can have multiple matches, you can ask PubNub client to open separate channel for each nothing person. So, when you have two matching persons, you take some unique identifiers from both of them and using known algorithm create unique name of the channel for which both clients will subscribe to communicate.
One channel for whole application - really bad idea, because of possible massive flow of data, which for most of subscribers will be useless, because consumer is one of other subscribers.
Yes, the best approach is that every "match" should have it's own channel on which both participants publish/subscribe to communicate. PubNub has no limit on channels (nor does it charge based on channels), so this shouldn't create a performance or cost issue.
To add access control to the "match" channel (if you want to ensure no one else can access that channel), use PubNub Access Manager, documented here: http://www.pubnub.com/docs/javascript/tutorial/access-manager.html (use dropdown to change programming language)
If you want to provide chat history, so that the two participants can see messages from previous chat sessions, enable PubNub Storage & Playback, and use the PubNub.History() API, documented here: http://www.pubnub.com/docs/javascript/overview/storage-playback.html
If you want to see when those two participants are connected to the Match channel, use PubNub Presence, documented in the same place.

Resources