Skip to content

Bug: Can't buy puerto rican numbers with phone number buying #1754

Open
@ibrand

Description

@ibrand

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:

  1. Go to the phone numbers tab
  2. Click on the plus button to buy numbers and type in a non-us area code
  3. 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 the contains 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Admin UI/UXArea: Admin experience of using SpokeA-twilioArea: SMS providers and specific-to-twilio issuesC-bugType: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions