How China’s Number Portability Works: Behind the Scenes of Mobile Number Transfer
This article explains the technical foundations of China's number portability service, covering regulatory background, MDN and IMSI structures, call and SMS routing changes, the centralized portability database, and the impact on developers who previously relied on number‑prefix detection.
Number Portability in China: Overview
On 11 November 2019, the Ministry of Industry and Information Technology issued the Number Portability Service Management Regulations, allowing nationwide number portability (NP) in China.
The regulation requires the four major operators—China Telecom, China Mobile, China Unicom, and China Broadcasting Network—to provide NP services without unjustified refusal or delay.
Operators released detailed NP rules on 14 November, entering a trial phase. Users can query NP eligibility by sending an SMS “CXXZ#Name#IDNumber” to 10086/10010/10001.
What Is Ported?
Number portability (NP) means the mobile directory number (MDN) or MSISDN remains unchanged when a subscriber switches operators. The MDN follows the E.164 format: CC + MAC + SN.
Components:
CC – Country code (e.g., 86 for China)
MAC – Mobile Access Code (identifies the original network, e.g., 186, 139)
SN – Subscriber Number (8‑digit, assigned by the operator)
The IMSI (International Mobile Subscriber Identity) also changes during NP. IMSI = MCC + MNC + MSIN, where MCC identifies the country, MNC the network (00 for China Mobile, 01/02 for China Unicom, 03 for China Telecom), and MSIN a 10‑digit subscriber identifier.
Call Flow Without and With Number Portability
In a traditional call, the Mobile Switching Center (MSC) determines the destination operator by analyzing the called party’s MDN. After NP, this analysis is unreliable, so a centralized Number Portability Database (CSMS) is introduced.
When a call is placed, the originating network queries the CSMS to find the current operator of the called number, then routes the call accordingly (no transfer, transfer to China Telecom, or transfer to China Mobile).
SMS Delivery After Portability
For user‑to‑user SMS, the same routing logic applies. For platform‑generated verification codes, the platform must query the CSMS; otherwise, messages may be sent to the subscriber’s former operator, causing delivery failures.
Since 2014, the Ministry has required basic telecom operators to forward verification‑code SMS across networks, largely solving this issue.
Impact on Developers
Many libraries (e.g., ChinaMobilePhoneNumberRegex) determine the operator by number prefix. After NP, such regexes become unreliable because the prefix no longer guarantees the current operator.
<code>^(?:\+?86)?1(?:3[0-2]|[578][56]|66)\d{8}$</code>Developers should avoid relying on prefix‑based operator detection and consider using the official number‑portability database when available.
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.