Skip to content

twilio-samples/send-and-receive-sms-anonymously-csharp

Repository files navigation

About

This app shows how to build a an SMS relay to and from your phone using a Twilio number. Since the other party only sees your Twilio number, this effectively allows you to mask your phone number for privacy purposes.

Set up

Requirements

Local development

After the above requirements have been met:

  1. Clone this repository and cd into it
git clone [email protected]:twilio-samples/sms-anonymous-csharp
cd sms-anonymous-csharp
  1. Add necessary nuget packages.
dotnet add package Twilio
dotnet add package Twilio.AspNet.Core
dotnet add package Twilio.TwiML.Messaging
  1. Add your Phone Number

In the file SmsController.cs look for the variable myNumber and replace the placeholder with the number you wish to forward the SMS messages to.

  1. Build to install the dependencies
dotnet build
  1. Run the application
dotnet run
  1. Use ngrok or other tunneling service to expose your application to the internet

You will need to use ngrok or another tunneling service to allow Twilio to reach your running application. Use the following command, replacing the port number that's shown here with the port that your application is running on.

ngrock http http://localhost:5213
  1. Set your ngrok endpoint as a Webhook in the Twilio console. Remember to append /sms to the ngrok URL.

Resources

  • The CodeExchange repository can be found here.

Disclaimer

No warranty expressed or implied. Software is as is.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •