https://github.com/binzcodes/twilio-serverless-ivr
Forward calls to wherever I am in the world, at local rates.
https://github.com/binzcodes/twilio-serverless-ivr
Last synced: 26 days ago
JSON representation
Forward calls to wherever I am in the world, at local rates.
- Host: GitHub
- URL: https://github.com/binzcodes/twilio-serverless-ivr
- Owner: binzcodes
- Created: 2022-01-29T20:51:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-31T03:31:08.000Z (over 1 year ago)
- Last Synced: 2025-01-27T11:18:22.743Z (over 1 year ago)
- Language: JavaScript
- Size: 518 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless & Twilio - IVR
[Twilio](https://www.twilio.com) allows developers to easily integrate phone calls, SMS and more into using [TwiML](https://www.twilio.com/docs/glossary/what-is-twilio-markup-language-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](https://www.twilio.com/docs/voice/tutorials/call-forwarding) to any overseas number.
## Install
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](https://twilio.com/console/)).
- `TWILIO_ACCOUNT_SID`
- `TWILIO_AUTH_TOKEN`
- `MY_PHONE_NUMBER`
## Deploy
Deploy directly with
`sls deploy`
Ensure the function responds with expected Twiml with
`sls invoke -f forward-call`
Expected response
```xml
Hello...+441...
```
Configure phone numbers in [Twilio Console](https://console.twilio.com/) selecting Function and this service
## TODO:
- fix [github actions](https://github.com/marketplace/actions/serverless)
## Further reading
* [github.com/twilio-labs/serverless-framework-integration](https://github.com/twilio-labs/serverless-framework-integration).
- [serverless docs on CI/CD](https://www.serverless.com/framework/docs/guides/cicd/running-in-your-own-cicd)
- Due to poor actions support from sls it's likely sensible to [move to twilio-cli](https://www.twilio.com/blog/an-introduction-to-ci-cd-for-twilio-functions-using-github-actions) or host TwiML function on aws