"Hello, operator? Could I buy some phone numbers please?"
This is a small CLI app to buy and release phone numbers from the Twilio API to text from. This project was built to specifically add phone numbers to a Twilio Messaging Service used by Spoke.
- Buying Phone Numbers by area codes in (available) quantities up to 100
- Associating purchased numbers with a messaging service, friendly name and voice url upon purchase
- Releasing Phone Numbers by 1
- npm
- jest
- Node v10.7.0 +
Use npm to install requirements.
$ cd switchboard-twilio
$ npm install
You'll also need to set up environment variables via export or a .env file (based on .example.env):
$ export ACCOUNT_SID=[account sid]
$ export AUTH_TOKEN=[auth token]
$ export SMS_APP_SID=[sms messaging service sid]
$ export FRIENDLY_NAME=[friendly name added in twilio]
$ export VOICE_URL=[voice url added to number in twilio]
To buy phone numbers, example:
$ switchboard buy --area_code 617 --quantity 2
To release a phone number (with number formatted like example), example:
$ switchboard release --phone_number 5555555555
To release all the phone numbers associated with a messaging service:
$ switchboard wipe --all
If you need help:
$ switchboard help <command>
To run for development:
$ cd switchboard-twilio
$ npm link
$ switchboard
or
$ cd switchboard-twilio
$ ./bin/switchboard
$ npm test
This CLI app is based off this tutorial.