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

German 7-digit mobile numbers not passing plausibility check #440

Closed
goalaleo opened this issue May 29, 2019 · 5 comments
Closed

German 7-digit mobile numbers not passing plausibility check #440

goalaleo opened this issue May 29, 2019 · 5 comments

Comments

@goalaleo
Copy link

Using phony (2.17.3)

What I did

Generate German 7-digit international mobile phone numbers using the ffaker gem

numbers = 1000.times.map { FFaker::PhoneNumberDE.international_mobile_phone_number }

select numbers that don't pass Phony.plausible? number

numbers.select{ |n| !Phony.plausible?(n, cc: '49') }

What happened

Got a list of numbers that didn't pass the check

["+49 152 0328061",
 "+49 167 2847803",
 "+49 152 7160988",
 "+49 152 1768999",
 "+49 167 2647471",
 "+49 152 1480110",
 "+49 157 0542530",
 "+49 152 7383060",
 "+49 152 0353657",
 "+49 167 2872760",
 "+49 152 1481294",
 "+49 152 0338204",
 "+49 157 0677249",
 "+49 157 0163940",
 "+49 167 2626864",
 "+49 167 2631411",
 "+49 152 1979633",
 "+49 167 2886901",
 "+49 157 0687130",
 "+49 152 7591227",
 "+49 152 2021312",
 "+49 152 2573559",
 "+49 157 0383297",
 "+49 167 2349262",
 "+49 152 2713833"]

What I expected to happen and why

Expected to get an empty list. I didn't find any obvious difference between the numbers that passed the check, and the numbers that didn't

@floere
Copy link
Owner

floere commented Jun 3, 2019

@goalaleo Hi Leo! Thanks for the issue – can you please try again with the latest gem and let me know the status there? (2.18.2)

@floere
Copy link
Owner

floere commented Jun 3, 2019

I tried it myself – interesting, will have to look into it!

@floere
Copy link
Owner

floere commented Jun 3, 2019

Ok, got it. The reason is that these are all numbers with 4 digit NDCs. In the Phony germany.rb file they are as follows:

mobile_4digits = [
'1520', # Vodafone
'1521', # Lycamobile
'1522', # Vodafone
'1570', # vistream
'1527', # E-Plus
'1672', # Dolphin Telecom
]

Add a digit, and they will pass. Now we'll have to figure out whether FFaker::PhoneNumberDE.international_mobile_phone_number or Phony is correct here.

@floere
Copy link
Owner

floere commented Jun 3, 2019

According to https://en.wikipedia.org/wiki/List_of_dialling_codes_in_Germany, I'd wager it's Phony. I'm closing this, but please reopen, if you disagree, or if you have some info on this issue 😊

@floere floere closed this as completed Jun 3, 2019
@goalaleo
Copy link
Author

goalaleo commented Jun 3, 2019

@floere I have entered the rabbit hole of german mobile phone numbers...

After doing some googling and coming across varying number range tables for german mobile phone numbers, I've come to believe that the current implementation is not conclusive.

I tried to find the official documents defining the possible number ranges, and found this page on the Bundesnetzagentur (Federal Network Agency) website, which contains some useful documents such as the...

The latter document is quite recent, and contains 4 digit number ranges 151x that are not listed in the germany.rb file, which is why I think that the current implementation is inconclusive.
In my opinion, trying to mirror all the assigned number blocks as a list based on the latter document is a poor strategy. It's just a matter of time before a new block is assigned, and the lib is out of date.

Maybe passing all numbers that meet the criteria of the numbering plan (first document) should be considered plausible? ?

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

2 participants