Uses Twilio Add-ons to block unwanted calls by checking the spam ratings of incoming phone numbers.
- A Twilio account - sign up here
- A Twilio phone number
- Spam filtering Add-ons (see below)
The following guide will help you to install Add-ons. You can access the Add-ons in the Twilio console here. The Spam Filtering Add-ons that are used on this application are:
Once you've selected the Add-on, just click on Install
button. Then, you will see a pop-up window where you should read and agree the terms, then, click the button Agree & Install
. For this application, you just need to handle the incoming voice calls, so make sure the Incoming Voice Call
box for Use In
is checked and click Save
.
This template by default accepts no additional parameters.
- Install the serverless toolkit
- Install the Twilio CLI
- Initiate a new project
twilio serverless:init sample --template=block-spam-calls && cd sample
- Start the server with the Twilio CLI:
twilio serverless:start --ngrok
- Set your incoming call webhook URL for the phone number you want to configure to
https://<your-ngrok-code>.ngrok.io/block-spam-calls
ℹ️ Check the developer console and terminal for any errors
Deploy your functions and assets with either of the following commands. Note: you must run these commands from inside your project folder. More details in the docs.
With the Twilio CLI:
twilio serverless:deploy
Make sure to update your incoming voice URL to your newly deployed Function URL.