Search code examples
asterisksipfreeswitchpbxasteriskami

looking for a way to determine if the phone number i'm calling is a cell phone or not


Im looking for a way to determine if the phone number I'm calling is a cell/mobile phone or not since it is not allowed to automatically dial those type of numbers.


Solution

  • This will vary depending on where the number is from. If the number is part of the North American dial plan, what you were looking is for an LRN dip. For a given number (NPA-NXX-YYYY) the NPA-NXX is purchased by a provider, that provider then specifies if that phone number is a land or mobile number, what rate center it is in, geographic information, etc. The problem is that about 30% of numbers are ported between providers. And LRN look up is the full NPA-NXX-YYYY provider lookup.

    This leaves the following two possible solutions:

    1. You buy the NPA-NXX database AND you have to purchase porting updates
    2. There are several services out there that allow you to programmatically look up who the current provider is for a phone number. Twilio, thinq, etc. this allows you to pay on a per look up basis instead of buying the full database.

    Which solution you choose will depend on the volume that you decide to pass through. If you do the look up and plan to call the number often, you can include LRN information in the SIP messages that would help providers with the routing.