Skip to content

Number portability and integrations between operators

B2Bnetwork team · · 7 min

IT in telecom

In brief

Number porting is a process in which several systems at several operators must change the state of the same number in agreement: the new operator accepts the request, the current one verifies it, both agree on a date, the network switches the number, and routing at all the other operators starts sending calls to the new network. From the IT side it is an asynchronous integration with a state machine, deadlines counted in business days, and many rejection paths, which has to be tested together with BSS, the network, and fraud safeguards.

How a number port works

In the European Union, the right to keep a number when changing provider stems from the European Electronic Communications Code (Directive 2018/1972, Article 106). The directive requires that the process be led by the new provider and that the number be activated within one business day of the date agreed with the customer. The details of the procedure in Poland are set by national electronic communications law and the Office of Electronic Communications (UKE); here we describe only the logic of the process, common to operators' systems.

A simplified flow:

  1. Request at the recipient. The customer signs a contract with the new operator (the recipient) and names the number to be ported.
  2. Query to the donor. The recipient's system sends the request to the current operator (the donor).
  3. Verification. The donor checks that the customer's data matches and whether there are any obstacles, then confirms or rejects the request with a stated reason.
  4. Agreeing the date. The operators set the day and the cutover window.
  5. Cutover. The donor ends the service, the recipient activates the number in its network.
  6. Routing update. Information about the port goes to a central database, and the other operators update how they route calls and SMS to that number.

Each step has its deadline, and each rejection comes back as a message with a reason code.

A state machine instead of a list of fields

A porting request is best modeled in the system as a state machine: submitted, sent, confirmed, rejected, scheduled, cutover in progress, completed, canceled. Every transition has a condition, an author, and a date. This approach gives three benefits:

  • No illegal transitions. A rejected request cannot move to cutover, even if a late confirmation arrives.
  • A full audit trail. In a complaint you can see who changed the state, when, and with which message.
  • Deadline monitoring. Every state has a timer, and exceeding a deadline raises an alarm before it turns into a customer complaint.

Deadlines are counted in business days, so the system needs a calendar of days off as configuration data, not a constant in the code. The calendar must be the same in all systems that calculate the deadline.

Business customers who port dozens or hundreds of numbers at once are a separate case. Such a request is best modeled as a group of related requests with its own aggregate state. That way, the rejection of one number does not block the rest, and the customer and the agent can clearly see which numbers are already ported and which are waiting for clarification.

Integrations between operators: patterns and pitfalls

Number porting is only one of the integrations between operators. Settlement for traffic between networks, roaming, and wholesale access to another operator's network are built similarly. They share several traits: communication is asynchronous, the partner has its own release schedule, and an error on one side comes back to the other after hours or days.

Patterns that work:

  • Idempotent processing. The same message may arrive twice; the second must not change the state or create a new request.
  • Writing the message and the state change in one transaction, for example with the outbox pattern, so that you never end up with a state where the system changed the status but did not send the reply.
  • Explicit timeout handling. No response from the partner is also a state, with its own reaction.
  • Format versioning. A change to the message format at one operator must not stop porting at all of them.

Integrations with partners who have their own teams and their own releases are well protected by contract tests, described in the article API contract testing.

Security: number porting as a fraud vector

A phone number is used today for logging in, confirming transfers, and recovering passwords. Whoever takes over a number takes over the SMS codes. That is why unauthorized number porting, like an unauthorized SIM swap, is a way to attack the customers of banks and online services.

On the operator's IT side this means:

  • identity verification on the request that does not rely only on data that is easy to obtain,
  • a notification to the customer on the current number about the submitted request,
  • rules for detecting suspicious patterns, for example many requests from one point of sale,
  • security testing of the processes themselves, not just the applications.

An example of such tests for SIM swap and a self-service portal is described in the scenario Security testing of a self-service portal and the SIM swap process.

How to test number porting

Testing covers three levels: messages with partners, internal systems, and network behavior.

LevelExample cases
Messagesrejection with each reason code, a duplicate message, no response within the deadline, cancellation by the customer
Internal systemsend of charging at the donor and start at the recipient on the same day, a business number in a multi-number bundle, a deadline falling after a day off
Network and routinga call from a third network after porting, an SMS with a code to a ported number, a number ported again or returning to the original operator

The full flow requires the partner's test environment or a simulator of its system. A simulator is worth maintaining like any other code, with tests, because the value of the entire regression suite depends on how closely it matches the real partner. The cases are well suited to automation on a shared platform, as in the TestFactory scenario.

Porting touches billing and customer systems, so knowing the whole landscape of an operator's systems, described in the article BSS and OSS systems, helps. Integration testing and security testing are carried out by B2Bnetwork engineers (What we do).

Questions and answers

Who runs the number porting process: the new or the current operator?

Under the European Electronic Communications Code, the process is led by the new provider, the recipient. The customer files the request only with them, and the recipient communicates with the donor. The donor verifies the request and cooperates on the cutover, and the customer does not have to pass information between operators. The details of the national procedure, including forms and deadlines, are set by the rules of the given country.

Why does a call to a ported number sometimes not get through?

Most often because some network has not yet updated its call routing and is still sending calls to the donor. The cause can also be an inconsistency between the ported number database and the network configuration at one of the operators. That is why post-porting tests cover calls and SMS from third networks, not only from the recipient's network.

How do you protect customers from unauthorized number porting?

With strong identity verification on the request, a notification to the customer on their current number, detection of unusual request patterns, and a clear procedure for quickly reversing a fraudulent port. Banks and services that send SMS codes benefit from information about a recent SIM or operator change, if the operator provides it lawfully.

Can integrations between operators be tested without the partner?

Most cases, yes, thanks to a simulator of the partner's system that reproduces its messages, delays, and rejections. A simulator does not replace testing with the real partner before a change in message format or procedure, though. Such tests are planned jointly, with an agreed window and a set of cases on both sides.

What it looks like in a project

Changing an operator's systems? Talk to an engineer who has done it in night windows.

Let's talk

Read more: IT in telecom