twilio / twilio-node

Node.js helper library
MIT License
1.4k stars 509 forks source link

FaxEnabled option doesn't work #280

Closed philefstat closed 7 years ago

philefstat commented 7 years ago

Version: 3.6.1

Code Snippet

TWILIO_TEST_TOKEN = 'foo'
ACCOUNT_SID = 'bar'

const client = require('twilio')(ACCOUNT_SID, TWILIO_TEST_TOKEN)

client.availablePhoneNumbers.list({}, (err, data) => {
  for (let entry of data) {
    faxNumAvailable(entry.countryCode, entry.country)
  }
})

let faxNumAvailable = (countryCode, country) => {

  client.availablePhoneNumbers(countryCode).local.list({
    faxEnabled: true
  }, function(err, data) {
    if(err) {
      console.log(country)
      console.log("Error " + err.status)
    }
    if (data && data[0]) {
      console.log(country)
      console.log(data[0].capabilities)
    } else {
      console.log(country)
      console.log('unavailable')
    }
  })
}

Exception/Log

...
Cyprus
{ voice: true, SMS: false, MMS: false, fax: false }
Philippines
{ voice: true, SMS: false, MMS: false, fax: false }
Canada
{ voice: true, SMS: true, MMS: true, fax: false }
Dominican Republic
{ voice: true, SMS: false, MMS: false, fax: true }
Estonia
{ voice: true, SMS: false, MMS: false, fax: true }
Puerto Rico
{ voice: true, SMS: true, MMS: false, fax: false }
Panama
{ voice: true, SMS: false, MMS: false, fax: true }
Luxembourg
{ voice: true, SMS: false, MMS: false, fax: false }
Brazil
{ voice: true, SMS: false, MMS: false, fax: true }
Malta
{ voice: true, SMS: false, MMS: false, fax: true }
Croatia
{ voice: true, SMS: false, MMS: false, fax: false }
France
{ voice: true, SMS: false, MMS: false, fax: true }
...

Steps to Reproduce

  1. Add your Account SID + auth token to the code snippet above
  2. Run the code snippet

(Works fine if you use smsEnabled: true or one of the other ones but not for fax.

jmctwilio commented 7 years ago

Great catch! We'll work on getting this fixed soon.

codejudas commented 7 years ago

This is released in 3.9.0