Skip to content

Update relay-sms.protected.js with comments #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions masked-number/functions/relay-sms.protected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/*
* Masking your phone number for SMS Forwarding and Responding
*
* Description:
* This function acts as a message-forwarding service
* If the message comes from the user, it forwards the message to another number.
* If it comes from someone else, it forwards it to the user.
*
* Contents:
* 1. Initialize Client and Response
* 2. Sender Check
* 3. Extracting Recipient and Message
* 4. Sending the Message
* 5. Handling Messages from Other Senders
*/

/*
* 1. Initialize client and response
*
* Here you can initialize a Twilio client (client) to interact with Twilio's API.
*
* A twiml object is created to generate TwiML (Twilio Markup Language) responses,
* which are instructions that tell Twilio how to respond to an incoming message.
*/

// Defines the main function handler for the Twilio Function.
exports.handler = async function (context, event, callback) {
const client = context.getTwilioClient();
const twiml = new Twilio.twiml.MessagingResponse();
Expand Down
Loading