Reputation: 123
I am doing a project in AWS IOT button. I have the code for more than one phone number receive these messages while clicking the button (single click, double click, long press) but also need to make receive calls at the same click but I tried using IFTTT to make calls but now I need to integrate the IFTTT with my existing lambda function. I am having the error which says it has different policies and role. So how could I make a function which sends SMS and call at a single click?
Upvotes: 1
Views: 263
Reputation: 123
For SMS and Phone call I have two lambda function. So I need to invoke a lambda function from another Lambda function.
var aws = require('aws-sdk');
var lambda = new aws.Lambda({
region: 'us-west-2' //change to your region
});
lambda.invoke({
FunctionName: 'name_of_your_lambda_function',
Payload: JSON.stringify(event, null, 2) // pass params
}, function(error, data) {
if (error) {
context.done('error', error);
}
if(data.Payload){
context.succeed(data.Payload)
}
});
You can find Doc here http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html
Upvotes: 1