2

Lambda を Twilio のバックエンドとして使用することはできますか?

Lambda から Twilio を呼び出すことはできますが、発信者から「1 を押してください」などの情報を取得する必要があります。サーバーを作成できますが、Lambda 関数を呼び出すことはできますか? (Lambda を呼び出せないことはわかっています)。

これが私がやりたいことの例です。

exports.handler = function(event, context) {
  resp.say('bienvenue ', {
    voice:'alice',
    language:'fr-FR'
  });
  resp.say('helloo', {
    voice:'woman',
    language:'fr-FR'
  });
  .gather({
   method:"GET",
   finishOnKey:'*',
   action : 'serveur_backend',
   timeout: "10"
  }, function() {
   this.say('presse 1 to ****  ', {
   voice:'alice',
   language:'fr-FR'
  });

  var l = "<Response>"+S(resp.toString()).between('<Response>', '</Response>').s+"</Response>";
  var URL = "http://twimlets.com/echo?Twiml="+encodeURIComponent(l);
  console.log(URL);
  client.calls.create({
    url:   URL,
    to: "+**********",
    from: "+*********"
//    timeout: "10"
//    callback
  }, 
  function(err, call) { console.log("appel lancé");
   process.stdout.write(call.sid);
    console.log(call.sid);
  context.done(null,  " have a nice day ");
  });
4

1 に答える 1