twilio-numbers

Bulk phone number management for Twilio applications

npm install twilio-numbers
4 downloads in the last month

Twilio Numbers

Bulk phone number management for Node.js Twilio applications.

Usage

Use along with the twilio module.

var TwilioNumbers = require('twilio-numbers')
  , TwilioClient = require('twilio').Client
  , config = require('./config')
  , numbers = new TwilioNumbers(config.twilio_sid, config.twilio_token, config.twilio_app_sid)
  , client = new TwilioClient(config.twilio_sid, config.twilio_token, config.twilio_host);

// Set up a phone using any available number beginning with area code '604'
numbers.getNumber({"PhoneNumber": "604*******"}, function(number, err) {
  if (err) throw err;
  var phone = client.getPhoneNumber(number);

  phone.setup(function() {
  ...
  // Rest of call is documented in the twilio package.
});

License

Licensed MIT. See LICENSE file.

Todo

  • Complete buyNumbers()
  • Complete deleteNumbers()
  • Store numbers in redis
  • Test using mocks
npm loves you