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

[Nigeria Mobile Support]: Fixed parsing of Nigerian mobile numbers #243

Merged
merged 1 commit into from Apr 9, 2015

Conversation

tpena
Copy link
Contributor

@tpena tpena commented Apr 9, 2015

References:
[1] Mobile Telephony Number Allocation (Nigerian Communications Commission)
http://www.ncc.gov.ng/index.php?option=com_content&view=article&id=113&Itemid=102
[2] National Numbering Plan (Nigerian Communications Commission)
http://www.ncc.gov.ng/index.php?option=com_docman&task=doc_download&gid=92&Itemid=
[3] Telephone numbers in Nigeria (Wiki)
http://en.wikipedia.org/wiki/Telephone_numbers_in_Nigeria
[4] ITU Nigeria
http://www.itu.int/dms_pub/itu-t/oth/02/02/T020200009C0001PDFE.pdf

According to the aforementioned references, the area codes for GSM numbers are 3 digits long with the subscriber part having 7 digits. This means the previous match rule
match(/^(702\d)\d+$/) >> split(3,4) was incorrect as this would allow an 11-digit national number which is not given by any of the specifications. Also, the ranges
700-709, 800-809, 810-819, and 900-909 have been allocated for mobile numbers as outlined in [1].

Fixed up parsing of mobile numbers according to the [1] and extended both the plausibility specs as well as the country specs

References:
[1] Mobile Telephony Number Allocation (Nigerian Communications Commission)
    http://www.ncc.gov.ng/index.php?option=com_content&view=article&id=113&Itemid=102
[2] National Numbering Plan (Nigerian Communications Commission)
    http://www.ncc.gov.ng/index.php?option=com_docman&task=doc_download&gid=92&Itemid=
[3] Telephone numbers in Nigeria (Wiki)
    http://en.wikipedia.org/wiki/Telephone_numbers_in_Nigeria
[4] ITU Nigeria
    http://www.itu.int/dms_pub/itu-t/oth/02/02/T020200009C0001PDFE.pdf

According to the aforementioned references, the area codes for GSM numbers are 3 digits long with the subscriber part having 7 digits. This means the previous match rule
match(/^(702\d)\d+$/)    >> split(3,4) was incorrect as this would allow an 11-digit national number which is not given by any of the specifications. Also, the ranges
700-709, 800-809, 810-819, and 900-909 have been allocated for mobile numbers as outlined in [1].

Fixed up parsing of mobile numbers according to the [1] and extended both the plausibility specs as well as the country specs
floere added a commit that referenced this pull request Apr 9, 2015
[Nigeria Mobile Support]: Fixed parsing of Nigerian mobile numbers
@floere floere merged commit 44ac25b into floere:master Apr 9, 2015
@floere
Copy link
Owner

floere commented Apr 9, 2015

Excellently compiled pull request. Many thanks! :)

@floere
Copy link
Owner

floere commented Apr 9, 2015

Released in 2.12.10.

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

Successfully merging this pull request may close these issues.

None yet

2 participants