Open
Description
Describe the bug
Currently phone number buying is only guaranteed to work for US numbers. I was specifically trying to purchase Puerto Rican numbers when I saw a problem emerge.
To Reproduce
Steps to reproduce the behavior:
- Go to the phone numbers tab
- Click on the plus button to buy numbers and type in a non-us area code
- See the spinner indicating an attempt to buy but a failure
Expected behavior
We should allow the purchasing of all types of phone numbers.
Additional context
A few notes here:
- Switchboard is also only able to buy US numbers
- Some of the numbers I eventually bought through switchboard hacking were only able to text domestically. Maybe worth eventually adding a toggle for purchasing numbers that can only text internationally?
- Here is the code for searching for numbers. One note here is that when I spoke to a Twilio rep, they said that for puerto rican numbers, you can't use the
areaCode
key as part of the availablePhoneNumber resource. Instead I ended up needing to use thecontains
like this:
return client
.availablePhoneNumbers('PR')
.local.list({
contains: '<the-actual-digits-of-the-area-code>*******',
smsEnabled: true,
})
It'd be nice to find a way to write this code so that it is maximally versatile and not full of logic forks.