Skip to content

Commit

Permalink
Added comments to the hello-voice.js file so that it's more comprehen…
Browse files Browse the repository at this point in the history
…sive
  • Loading branch information
sbrij001 committed Sep 8, 2024
1 parent b8ea2fc commit f4b997f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hello-voice/functions/hello-voice.protected.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/*
* hello-voice.protected.js
* This file contains an AWS Lambda function handler that generates a Twilio Voice Response. When triggered, it creates a TwiML response that instructs Twilio to speak "Hello World" to the caller.
*/

// This is an AWS Lambda function handler for a Twilio Voice Response
exports.handler = function (context, event, callback) {
// Create a new TwiML VoiceResponse object
const twiml = new Twilio.twiml.VoiceResponse();
// Add a 'Say' verb to the TwiML response, which will speak the text 'Hello World' to the caller
twiml.say('Hello World');
// End the function by calling the callback with the generated TwiML response
callback(null, twiml);
};

0 comments on commit f4b997f

Please sign in to comment.