Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile french phone number in "070..." to "072..." are not valid #20

Closed
ghost opened this issue Dec 19, 2017 · 1 comment
Closed

Mobile french phone number in "070..." to "072..." are not valid #20

ghost opened this issue Dec 19, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 19, 2017

Hello,
A typical french mobile phone number starts with 06 or 07 and has 10 digits.
I noticed though that awesome-phonenumber believes that phone numbers with 10 digits that start with "070", "071" or "072" are not valid. I'm not sure why that is.
Is there an actual official rule in the french phone system that make these numbers invalid, or is it an error in awesome-phonenumber ?

Example :

import PhoneNumber from 'awesome-phonenumber';
const pn1 = new PhoneNumber("0710000000", "FR");
console.log(JSON.stringify(pn1.toJSON()));
// This one is not valid :
// {
//   "number": {
//     "input": "0710000000",
//     "international": "+33 7 10 00 00 00",
//     "national": "07 10 00 00 00",
//     "e164": "+33710000000",
//     "rfc3966": "tel:+33-7-10-00-00-00",
//     "significant": "710000000"
//   },
//   "regionCode": "FR",
//   "valid": false,
//   "possible": true,
//   "canBeInternationallyDialled": true,
//   "type": "unknown",
//   "possibility": "is-possible"
// }
const pn2 = new PhoneNumber("0730000000", "FR");
console.log(JSON.stringify(pn2.toJSON()));
// While this one is :
// {
//   "number": {
//     "input": "0730000000",
//     "international": "+33 7 30 00 00 00",
//     "national": "07 30 00 00 00",
//     "e164": "+33730000000",
//     "rfc3966": "tel:+33-7-30-00-00-00",
//     "significant": "730000000"
//   },
//   "regionCode": "FR",
//   "valid": true,
//   "possible": true,
//   "canBeInternationallyDialled": true,
//   "type": "mobile",
//   "possibility": "is-possible"
// }

Thanks in advance !

@ghost ghost changed the title Mobile french phone number in "070..." to "072..." are considered not valid Mobile french phone number in "070..." to "072..." are not valid Dec 19, 2017
@ghost
Copy link
Author

ghost commented Dec 20, 2017

After some tests, I realized the error directly comes from libphonenumber. I'm closing this issue.

@ghost ghost closed this as completed Dec 20, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants