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

Add support for Pakistan 326 code (update metadata) #110

Closed
aikikode opened this issue May 2, 2022 · 2 comments
Closed

Add support for Pakistan 326 code (update metadata) #110

aikikode opened this issue May 2, 2022 · 2 comments

Comments

@aikikode
Copy link

aikikode commented May 2, 2022

Current version of the library does not support [Pakistan (PK) code 326]:
The code

package main

import (
    "fmt"
    libphonenumber "github.com/nyaruka/phonenumbers"
)

func main() {
    parsedPhoneNumber, _ := libphonenumber.Parse("0325-0000000", "PK")
    fmt.Println(parsedPhoneNumber, libphonenumber.IsValidNumber(parsedPhoneNumber))
    parsedPhoneNumber, _ = libphonenumber.Parse("0326-0000000", "PK")
    fmt.Println(parsedPhoneNumber, libphonenumber.IsValidNumber(parsedPhoneNumber))
}

Provides:

country_code:92 national_number:3250000000  true
country_code:92 national_number:3260000000  false   // should be true

(https://en.wikipedia.org/wiki/Telephone_numbers_in_Pakistan) - only the codes from 320 to 325 according to PhoneMetadata.GetMobile() being:

national_number_pattern:"3(?:[014]\\d|2[0-5]|3[0-7]|55|64)\\d{7}" possible_length:10 example_number:"3012345678"

Looks like the metadata is outdated from the official Google library, e.g. see the query for the same phone number "0326-0000000" with sample google service where IsValidNumber(): true: https://rawgit.com/googlei18n/libphonenumber/master/javascript/i18n/phonenumbers/demo-compiled.html
image

and current library: https://phonenumbers.temba.io/ where is_valid: false
image

@aikikode
Copy link
Author

aikikode commented May 2, 2022

Hi @rowanseymour, I see you already merged #111 to add this support, thank you! Do you plan to do a new release/tag for this library with this change?

@aikikode
Copy link
Author

aikikode commented May 2, 2022

Resolved by #111 (v1.0.75)

@aikikode aikikode closed this as completed May 2, 2022
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

1 participant