This is an example masked communicaiton application that demonstrates how build it by using Conversations API and Programmable Voice.
This application supports masking communicaitons between SMS, WhatsApp, and voice participants
- Twilio Account
- 1 or more Twilio phone numbers (either bought or verified) to mask SMS and voice communications
- Node.js v14 or higher
- ngrok if running a local server
- Copy .env.template to .env
- Set your account sid and auth token in the corresponding variables
- Set NUMBER_POOL to an array of phone number(s) e.g.
NUMBER_POOL=["+19255551111","+19257775555"]
- If using ngrok, start ngrok for port 9000
ngrok http 9000
- Configure your phone number's inbound call handler with the url https://your_ngrok_server/proxypoc/inboundCall
- Install the app dependency packages
npm install
- Start your npm server
npm start
This application provides an endpoint to create a conversation for participants to communicate and a landing page to simplify getting started.
- Navigate your browser to http://localhost:9000/
- You will see the configured phone numbers and a section titled Create a new proxy session
- Enter the numbers of two participant that you wish to connect anonymously
- Click Submit
- A JSON string is presented which contains an array of the participants added to the conversation. Each participant will have a messaging_binding.proxy_address. This is the address that the participants will send and receive numbers to and from
- Have participant A send a message to their proxy_number
- Participant B should receive the message from the Participant A's proxy_number
- You can also have participant A call the proxy_number. This should set up a call to Participant B and participant B should see Participant A's proxy phone number
The sessions endpoint accepts one or more addresses. It creates a Conversation, finds a Proxy number for each participant and adds them to the conversation
This endpoint receives inbound call events. It will query Twilio Conversations for a matching participant address and connect the other participant to the caller
The number chooser included is a simple algorithm that picks a number from NUMBER_POOL that isnt used by the given participant's address.