Twilio allows developers to easily integrate phone calls, SMS and more into using TwiML.
This project deploys a serverless function using Twilio serverless runtime as the provider. The function responds with TwiML instructions to forward the phone call to any overseas number.
Install Twilio Node.js Provider Plugin & Service Dependencies
npm i -g serverless
npm i
Set environment variables locally (Twilio account credentials can be found here).
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
MY_PHONE_NUMBER
Deploy directly with
sls deploy
Ensure the function responds with expected Twiml with
sls invoke -f forward-call
Expected response
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello...</Say><Dial>+441...</Dial></Response>
Configure phone numbers in Twilio Console selecting Function and this service
- fix github actions
- serverless docs on CI/CD
- Due to poor actions support from sls it's likely sensible to move to twilio-cli or host TwiML function on aws