Crossposted from https://lemmy.blahaj.zone/post/48779421

I’m writing a program that can find info about a phone number. One problem appears to be that Google’s phone number library doesn’t provide enough info. For instance, take this number: +1 (613) 745-1576. My iPhone correctly says “Ottawa, Ontario, Canada”, while Google’s library doesn’t return the city? How does my iPhone pick this up but not Google’s own library? Is this provided by cell carriers? Is it something with the 745 block? If so, where can I find this info?

  • Shimitar@downonthestreet.eu
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    22 hours ago

    No idea how it works in Canada… But phone prefixes (745) definitely identifies an area, which might cover more than one town/city. Inside that phone area, there is no real way to understand where the phone line is located geographically. Either you have access to a bigger database where each line is recorded (carrier, I guess?)

    Over here for example, phones start with 1 on nord-west and grow to 9 in south east .

    The number of digits of the prefix also is very important. 1 is a 2 digits prefix (11,12,13…) While 2 and 6 are 1 digit prefixes . Depending on how big was expected to be the area it originally covered

    So, there is no specific global rule, and each prefix cover an arbitrary area.

    That basic idea is that back in time of mechanical switchboards, each number will close a specific mechanical switch to connect phisical lines all the way to the area you wanted. And the last 6 or 7 digits selected one final line. I mean phisical wire! So basically that created a phisical single connected wire from your phone to the receiver phone. Over hundreds of km.