mobi / telephone_number

Phone number validation for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discrepancy between libphonenumber and mobi / telephone_number

tamarm opened this issue · comments

Hi,
We are working with Australia, and inside libphonenumber (libphonenumber.appspot.com) we see that this australian number is mobile - 0460 441 216
While on your demo is seems to be invalid
This is causing our product to not support these numbers

Can you confirm how you are validating this number? Are you using the Ruby gem or are you using the API on the demo site?

Thank you for the super quick response!
I tried both the ruby gem and the API on the demo site, and both provide this wrong answer.
(BTW, I am using gem version 1.3.5 as I can't upgrade higher due to ruby language version)

The demo site is a bit behind, but I can confirm 1.4.6 considers 0460441216 a valid mobile number. In the event you cannot upgrade past 1.3.5, we do support an override file for you to override validations.

I would recommend overriding your mobile pattern for Australia to the value below until you can upgrade.

/483[0-3]\d{5}|4(?:[0-3]\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[0-27-9])\d{6}/

Hope this helps!

Thank you so much for all your help!!