How to Create IP paramater for alexa skill that uses lambda? - aws-lambda

I am creating a lambda based Alexa skill, and I need to input an IP address for a server that changes for every user that installs the skill. I know there is an account linking option but I need the IP of the server be inputted when the skill is installed.
How do I do that? and how do I pass those parameters to the lambda function?
Thanks ahead.

So this "IP adress for a server" where should it come from?
You could ask the user in the first skill invocation for the ip
read about intents and slots. The slot should be of type number (https://developer.amazon.com/en-US/docs/alexa/custom-skills/implement-the-built-in-intents.html)
how to know it's the first call? Save userId and a counter for skill invocations
how to save? I suppose you run your backend on AWS lambda than you could use a dynamoDB. There is quite a nice feature. Read about the PersistanceAdapter. You can store unique featueres per user (https://developer.amazon.com/en-US/docs/alexa/alexa-skills-kit-sdk-for-nodejs/manage-attributes.html). In your case you would need to set (setPersistentAttributes ) and save two attributes. The counter and the ip address.
Or do you need in written form? You could generate an id for the alexa skill userId, let alexa speak the id and the user use this id:
log in in your webpage with this unique id
configure/add an ip address
now your skill backend can lookup the ip adress for the userId

Can you initiate the linking request from that external server to the skill instead? Look at the App to App linking feature.
https://developer.amazon.com/en-US/docs/alexa/account-linking/app-to-app-account-linking-starting-from-your-app.html

Related

How to get the "from address" from the user in spring boot

`how to get the from address from the user? As we know that the from address has been given by app id which we get from email of individual user who needs to be host the message. This will only be a one way communication and i need two way communication that is whoever can send mail to anybody.
I have tried to make one way of communication ie., one user can send to many receipient.
I need many to many form of email sending.

AirBNB style email masking service implementation with AWS Lambda

I am building a small service application where users can cloak their email addresses using the service. Users who register to the website will have a unique email address to communicate with. I have tried to implement this relay service but i am stuck implementing it.
What i have tried
Catch all the emails coming for the domain with SES receiving rules and saving to the s3 bucket
Trigger lambda function to retrieve the original address of the designated user by calling an api call providing the email address user wanted to contact.
After a successful call the api call returns the original (unmasked) email address for lambda to forward the email to
Question: Is this an overkill when dealing with 1000s of emails handled like this ? Is there any way that you had implemented such as this ?
*AirBnB style communication

identifying a Skype user using the bot -c#

I'm building a Skype bot using Microsoft's framework and I want to recognize the users.
can anyone give suggestions on how to do it? The users should be recognized in order to give them authorization for tasks the bot preforms so it must be something that never changes and can be stored on a database.
The only thing I saw was "ServiceUrl".
thanks!
You can get the unique user id like below:
var userId = Context.Activity.From.Id;
This will always give you the user ID of the channel they reside on. In your case it will be their Skype ID.

Phrase lists supplied by the backend per-user for Botframework

I have a backend service where users can create and name rooms and devices. I'd like to integrate with Cortana and allow users to interact with their devices using Cortana. I created a bot that is hosted on my backend and added Cortana as a channel. I also integrated the bot with my OAuth 2 server so I know which user is interacting with the bot.
I trained my LUIS model with phrases like "turn on light in the bathroom", "turn off all lights", etc.
My issue: each user can name rooms and devices as they want. I do not know in advance which rooms and which devices are going to be configured in the service. When I get the request in my bot, I can find all devices for the user. The list is fixed at that point and could be used as a phrase list - only devices in the list are allowed to be in the request.
Which brings me to my question: is it possible to modify the phrase list on per-user basis? Or configure a URL from which the most recent phrase list could be retrieved before the request is processed by LUIS? Basically all I need is to avoid getting a request to turn on light in the "living room" while there is no living room configured by the user in the system and instead it should have been "dining room" (this is just a simple example, in the real world it would be more complex).
I know there is LUIS REST API that can be used to dynamically modify the configuration, but:
1) it is not on per-user basis
2) it requires re-building and re-publishing the LUIS model
I believe the Connected Home skills solve that somehow by discovering all devices connected to the service, but I haven't found any APIs I could use to solve the issue in my skill.
Edit:
I am looking for a functionality like this:
Cortana Connected Home
After linking the Hue account Cortana knows which devices the user has and at that point the voice recognition can be smart and try to map the spoken words to an actual device name.
Firstly, the phrase list feature can help LUIS recognize intents and entities, it will affect on that whole LUIS app. As far as I know, there are not concept of per-user basis phrase list feature in LUIS.
Secondly, LUIS app support 5,000 items per phrase list, if the number of your app system rooms (or devices) name does not exceed the limit, you can add all rooms’ name in a phrase list (and add all devices’ name in another phrase list).
Besides, you can also try this approach: when users can create and name rooms and devices, you can map information about user with rooms&devices and store the map information in a external store, such as a database etc. And if you pass query to LUIS, LUIS would help detect the intent and the entity(or entities or empty entities list), if there are not any entity in entities list, you can query records of rooms’ name from that external store and prompt the user for selecting a room.
Code snippet:
//query records of rooms’ name from that external store
//then prompt user for select a room
PromptDialog.Choice(
context: context,
resume: ChoiceReceivedAsync,
options: options,
prompt: "Hi. Please Select the Room :",
retry: "Please try again.",
promptStyle: PromptStyle.Auto
);
Test result:

How do I verify an email address is real and in use using the Sender Policy Framework

From what I've been reading the SPF can be used to validate email addresses by sending commands (rather than an actual email) such as HELO. I've managed to pick up a basic grasp of the policy but I can't get my head around how I'd go about solving the following problem:
I've got a number of email addresses attached to contacts in a CRM system and I'd like to find out if the email addresses are valid and still in use.
Currently we're using a REST Web Service (http://emailinspector.co.uk/) which returns "Ok" (if its ok... duh), "Bad" (if its not valid or not in use) or "Unknown". For Unknown, you are also provided some notes on why it came back with that, i.e. you are told if the Mailbox is full or if its a well known DEA.
I'd like to be able to program a script that can replicate this functionality and from what I've worked out it should use the Sender Policy Framework to do this? The problem is I don't know how I'd go about returning such precise information for "Unknown" email addresses.
Ideas and thoughts?
Actually SPF is just a text record, with some "hints" to let you know if an IP address or mail server is "allowed/Authorized" to send email for that domain. It doesn't tell you anything about an individual email address in that domain..
for example
[doon#qix:~] host -t txt labratsoftware.com
labratsoftware.com descriptive text "v=spf1 a -all"
The SPF record for one of my domains says that only the a record for the domain is authorized to send email for labratsoftware.com, and that if it doesn't come from that IP then it should be rejected (-all).
So the best you can do with SPF is tell that a received email came from an authorized host, and then use that information to help decide if you want to reject it or not.
The best way To test the validity of an email address you have, is to email it, and see if it bounces. You can use options like VERP (http://en.wikipedia.org/wiki/Variable_envelope_return_path) to automate the bounce handling. You can also try and connect to the MX records listed for the domain and try to deliver a message that way. Some Mail servers support verify (But most admins disable this to prevent information leakage). You can use RCPT TO to see if the server accepts it, but even if it does , you have no way of knowing if it will actually make it to their INBOX. My guess is that is what the API you are currently using is doing. And unknown are just ones that either don't answer, greylist, etc.

Resources