Blog·Craft·

A dead number parses fine

Phone validation checks the numbering plan. HLR adds assignment and reachability status, which answer different questions.

A disconnected number can still have the right length, a real area code, and a valid prefix. It can pass validation even though calling it gets you nowhere.

That is the difference between /phone and /hlr. The first checks the number against the numbering plan. The second adds status information about the line.

Here are the fields that matter in this HLR response, with the other network fields omitted:

GET /hlr/+13102858000

{
  "phone": "+13102858000",
  "valid": true,
  "country": "US",
  "live": true,
  "connected": null
}

valid says the number passes validation. live says the status result identifies it as assigned to a subscriber. connected says whether the handset was reachable when checked. Those last two are separate because an assigned number can belong to a phone that is switched off.

In this example, assignment is known and reachability is not. Landlines commonly return that combination. A mobile result can include both answers, but either field can be null when the check did not establish it. Recent results can be reused, so this is not a promise that a phone is reachable at the instant your request arrives.

Numbers outside North America can also return roaming and mobile network details. For cleaning a phone list, start with live. A number passing valid alone tells you much less than it seems.