I need to get the message from DynamoDB, with some dynamic arguments and show that message in the chat,
Attributes set using the Set Attribute flow in contact flow, are FirstName and LastName
I get this message from dynamoDB using Lambda function as "Hello $.Attributes.FirstName $.Attributes.LastName, thank you for calling" which I pass to the contact flow.
But the contact flow show the message in chat as it is, without replacing parameters with the actual names.
If I put the message directly in the contact flow it works fine, issue occurs if I get it from the Dynamo DB.
Anyone faced this issue before?
Related
I was wondering if anybody has ever experimented with this issue I'm having and could give me any input on the subject.
As it stands right now I'm trying to see if there is a way to grab a users input through the AWS Connect. I understand that there is already a "Get User Input" block in the GUI that is available for me to use, unfortunately it does not offer the fine grain control I am looking for with requests and responses from Lex.
Right now I am able to Post Content to Lex and get responses just fine, as well as output speech using Amazon Polly via my Lambda. This works great for things that do not require a user to have to give feedback for a question.
For example if a client asks
"What time is my appointment?"
and we give back
"Your appointment is for X at X time, would you like an email with
this confirmation?"
I want to be able to capture what the user says back within that same lambda.
So the interaction would go like so:
User asks a question.
Lambda POST's it to Lex and gets a response
Amazon Polly says the response - i.e: 'Would you like an email to confirm?'
Lambda then picks up if the user says yes or no - POST's info to Lex
Gets response and outputs voice through Polly.
If anybody has any information on this please let me know, thank you!
Why do you make so much complications to implement IVR system using Amazon Connect. I have done the complete IVR automated system to one of my biggest US banking client. Use the below procedure to achieve what you desire.
Build a complete interactive lex bot(So that you can avoid amazon poly & using lex post content api). It is advised to build each bot has only one intent in it.
In connect using "Get User Input" node map the lex bot which you have created earlier with the question to be asked "What time is my appointment?". Once this question has been played the complete control goes to lex and then you fulfilled your intent from lex side, you can come back to connect as like that.
Refer AWS contact center for the clear idea.
I am trying to make a contact flow in amazon connect, in basic terms it should;
"Do you need support" -> Person: "Yes" -> "What is your name?" Person: "John doe", it should save "john doe" and send it to a lamba. this is how the contact flow looks like;
this is the code of my lambda;
error in CloudWatch,
Lambda;
connect;
I have tried a couple of different settings and variables in order to send the right value with it, and this is what is set as of right now;
I think you are using the wrong attribute type when sending the firstname to the lambda. From the type drop down you should select either: User Defined and then use firstname as the key and the value or just select Lex Slots and reference the same value you do in your Set Contact Attributes block.
Also not familiar with Java Lambdas, but I do know connect sends your lambda a JSON object and it looks like you have input set as a string. May be worth looking into that.
It depends, take into account different things:
1- You have to authorize amazon connect to trigger the lambda function.
2- You could send the data to lambda in different ways, for example if you have data in the same ContactFlow but it comes for previous part of the flow or store and send directly to lambda, see the image:
This is how we receive tc_date
And this is how we receive tc_numero but we send to a lambda that encrypts and tc_numero lives in the flow and we called how I show you in first image
I've created a lex sms chatbot and published it to a Twilio SMS Channel. Within my java lambda fulfillment handleRequest function I receive 2 parameters: an Input object and a Context. Input has some type of system generated userId, but I need the phone number of the incoming sms message from Twilio.
I've configured Twilio to call Lex via webhook per these instructions:
http://docs.aws.amazon.com/lex/latest/dg/twilio-bot-association.html#twilio-bot-assoc-create-assoc
I'm using the system created webhook callback url between Lex and Twilio and would like to avoid writing my own Lex-Twilio go between with Gateway API and lambda if possible.
I think I'm missing a configuration in Twilio to send this to Lex maybe? I haven't setup any TwilML app or anything, just linked the SMS number to my webhook callback url for lex. Everything works fine except getting the incoming sms number.
UPDATE:
I exhausted all possibilities with my input object and context in my java lambda function. I guess there's no way to get at the payload from twilio in Java. I tried switching to an input stream handler but still only had the input format defined in the documentation here: http://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html
I had to bite the bullet and build my own gateway API and Node handler. It's just a layer that sits before lex and translates twilio into lex input format and vis versa on the response. It updates the userId with the incoming phone number.
This tutorial was very useful in doing this:
https://aws.amazon.com/blogs/ai/integrate-your-amazon-lex-bot-with-any-messaging-service/
It was a lot of work just to get one additional field, but It does provide me the flexibility to switch SMS providers in the future easier.
I am not sure as what exactly stopped you from getting the user phone number in your lambda function. You can always get sender phone number from 'userId' field from the input event in your lambda function. You can refer to the documentation to get more information.
Aws SQS giving different messages for the same parameters
So I posted a message using:
https://sqs.us-west-2.amazonaws.com/Otherinfo/?Action=SendMessage&MessageBody=Ola&MessageAttribute.1.Name=test1&MessageAttribute.1.Value.StringValue=Drizzy&MessageAttribute.1.Value.DataType=String
The important thing here is I want to get the messages based on their attributes. Then using postman I call for Receive:
https://sqs.us-west-2.amazonaws.com/Otherinfo/?Action=ReceiveMessage&MessageAttributeName.1=test1.*&WaitTimeSeconds=10
I even made it wait for response but then I keep getting different messages from the queue sometimes even when I make a mistake and enter a wrong attribute name I still get a response. I'm I doing something wrong here?
Is there any other messaging system like this that would work with AngularJS?
If I understand your question, it sounds like you are trying to filter the messages received based on your attribute parameters - that is not how they work.
The attribute parameters is a way of specifying which attributes of the selected records should be returned - it does not apply a filter to the messages and only return the messages that match.
You can't filter messages received - you ask for messages, SQS sends you messages - you can't control the order that you get them, or the selection criteria.
Update
Demo: http://jsbin.com/ogorab/311/edit
I'm trying to build a simple chat room that updates in realtime using Faye/Websockets. Messages are posted using regular REST, but there is also a subscription via Faye to /messages/created, which uses store.pushPayload to push the new messages.
Now the following scenario happens and I can see where it goes wrong but I have no clue how to solve it:
User submits chat message
ChatController handles the submit, calls createRecord with the chat message, and subsequently #save
The chat messages is instantly shown in the chat (triggered by createRecord). Note that no id has been assigned yet.
A REST request is send to the server
The server first publishes the message to Faye
The server responds to the REST request
Before the ajax call is resolved, a message has arrived at /messages/created
The message is again inserted in the view (it should be merged with the original message of course, but that one still hasn't been assigned an id)
The ajax call is resolved, and the id of the original message is assigned.
This results in duplicate messages, in the following order:
[message via createRecord, will resolve via ajax response]
[message inserted via pushPayload/Faye]
I hope you can understand so far. A solution would be to have Faye wait for the save call to resolve before pushing the payload. Unfortunately I don't have a reference to the record that is being saved (happens in a controller, faye subscription is set up in ApplicationRouter).
Also I would like this to work in a generic way:)
Finally found a solution for this, but other suggestions are still welcome.
Turns out that Store#didSaveRecord updates the id after the record is saved. By overriding this method (and then calling super, in that order), we can first check if a record for that id already exists:
App.Store = DS.Store.extend
didSaveRecord: (record, data) ->
# This will remove any existing records with the same id
#getById(record.constructor, data.id)?.unloadRecord()
#_super(record, data)