"Long" US phone numbers

Catalog of dial plans
Post Reply
MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

"Long" US phone numbers

Post by MikeTelis » Tue Sep 02, 2008 5:01 am

Howdy all,

some time ago I faced with a problem calling Citibank's toll-free number which is 1-888-CITIBANK. It turns so that, unlike PSTN, VoIP providers can't properly terminate calls to phone numbers longer than 7 digits ("CITIBANK" is 8-digit number). Regular telephone network just takes first 7 digits and ignores the rest.

This is true for both URI returned by ENUMLookup and VSP (at least, my VSP, Future-Nine, failed to connect this call).

I ended up "rounding" US phone numbers to 7 digits after area code. Corresponding Ruby:

Code: Select all

    when /(^1([2-9]\d\d)\d{7,7})/                    # North America
      @num = $1                                      # ignore everything after 7-dig phone number
$2 will contain area code; I use it to check whether it's toll-free (800, 888 etc) or something else.

Post Reply