Interactive Voicemail
An interactive voicemail proxy for checking messages
Pre-requisites
Environment variables
This project requires some environment variables to be set. To keep your tokens and secrets secure, make sure to not commit the .env
file in git. When setting up the project with twilio serverless:init ...
the Twilio CLI will create a .gitignore
file that excludes .env
from the version history.
In your .env
file, set the following values:
Variable | Description | Required |
---|---|---|
MY_PHONE_NUMBER Your phone number true |
Function Parameters
/voicemail-proxy
is protected and requires a valid Twilio signature as well as the following parameters:
Parameter | Description | Required |
---|
/handle-user-input
is protected and requires a valid Twilio signature as well as the following parameters:
Parameter | Description | Required |
---|---|---|
Digits |
Automatically provided by Twilio | No |
SpeechResult |
Automatically provided by Twilio | No |
From |
Automatically provided by Twilio | No |
To |
Automatically provided by Twilio | No |
Create a new project with the template
- Install the Twilio CLI
- Install the serverless toolkit
twilio plugins:install @twilio-labs/plugin-serverless
- Initiate a new project
twilio serverless:init example --template=voice-ivr && cd example
- Start the server with the Twilio CLI:
twilio serverless:start
- Open the web page at https://localhost:3000/index.html and follow the instructions to test your application.
Deploying
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