On May 31, 2024, at 9:20 AM, Ben Kaufman via sr-users sr-users@lists.kamailio.org wrote:
Answered in order of easiest answer to most complex:
Does it start with a 0?
No. I've never encountered any US number requiring a prefix of "0" nor a US number being written that way.
US numbers are fixed lenght 11 digits?
The USA is in the North American Numbering Plan (NANP). This includes USA, Canada, much of the Caribbean (Cuba, Jamaica, Barbados for example), some US territories in the Pacific (Guam, American Samoa). The NANP's "Country Code" is 1. In the USA and Canada (I think the entirety of the NANP) this is followed with a 3 digit area code (National Destination Number) followed by a 7 digit subscriber number.
What is the usual representation of a 'local' US number?
There is no consistent answer. Consider that the oldest phone network is in the USA, and the unplanned initial growth and many historic regional governing bodies it varies massively. It has also changed greatly over time. GENERALLY speaking people will use the 11 digit number or the 10 digit number (without the "1" country code), but there's not a lot of rhyme or reason as to which is preferred in one case vs another.
It was mentioned previously, and requires libphonenumber, but the phonenum module is pretty decent for helping with NANP numbers and deciphering if one is let’s say US vs Canada vs Jamaica, etc.
Regards,
Fred Posner p: +1 (352) 664-3733 https://fred.tel