简体   繁体   中英

How to send sms and call at a time using aws IOT button?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM