joemcl / switchboard-twilio

This is a small CLI app to buy phone numbers from Twilio to use for a sms messaging service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switchboard-Twilio

"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.

Current Features

  • 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

Requirements

  • npm
  • jest
  • Node v10.7.0 +

Set up

Use npm to install requirements.

$ cd switchboard
$ 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]

Run

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>

Development

To run for development:

$ cd switchboard-twilio
$ npm link
$ switchboard

or

$ cd switchboard-twilio
$ ./bin/switchboard

Test

$ npm test

Other

This CLI app is based off this tutorial.

About

This is a small CLI app to buy phone numbers from Twilio to use for a sms messaging service

License:MIT License


Languages

Language:JavaScript 100.0%