How to determine the operator and region by phone number



It is useful to know which telephone operator the client chose and in which region. Then you can break down the customer base geographically and not call at night. Or conduct promotions with operators. And some of our customers save: for each operator choose the cheapest SMS aggregator.

Therefore, " Dadata " has long been finding the operator by phone number. The algorithm is simple - do it and use it. Unless in 2013, when “mobile slavery” was abolished, I had to slightly adjust the process. In this article I will tell how everything works for us.

There is a big difficulty in the process - getting access to the database of transferred numbers. It is not issued to private individuals, and companies will have a hard time. About this - in a separate section.

Break the phone number apart


The first thing to do is disassemble the phone into three parts:

  • country code - for Russia it is +7 or 8;
  • operator code - 3-5 digits (in fact, this is not an operator code, but a numbering zone code. I’ll tell you later);
  • the actual phone number is 5-7 digits.


The numbering zone code for a mobile number always consists of three digits. In stationary - from three, four or five. In any case, the first three digits are enough to determine the region by phone number.

If you don’t know which part of the number consists of which digits, then it will be difficult. The way out is to put a mask so that users immediately enter numbers in parts. Or disassemble it after, the Google library for working with phones will cope with the task .

Find an operator by phone number by looking at the numbering plan


The main Russian document, according to which operators receive phone numbers, is the Rossvyaz numbering plan. It clearly spelled out all the layouts: which codes and numbers to which operators in which regions belong. What is nice, the Rossvyaz reference is free at rossvyaz.ru/deyatelnost/resurs-numeracii/vypiska-iz-reestra-sistemy-i-plana-numeracii .


The guide was uploaded in two formats at once, which is very nice on the part of Rossvyaz. Once a month

, four files are updated inside the numbering plan: three for landline numbers and one for mobile numbers. The difference between the contents of the files is noticeable if you look at the prefixes in the names:

  • “ABC-” means that the file contains fixed numbers. Actually, “ABC” is a designation of numbering zones defined on a geographical basis;
  • “DEF-” is a file with mobile numbers. Prefix means numbering zones that are not geographically defined.

It’s already clear here: the directory will tell you not only the operator, but also the type of phone:

  • for stationary, the code starts with 3, 4 or 8;
  • on mobile - from 9.

There are also direct mobile ones - outwardly they cannot be distinguished from stationary ones. I know only one way to discover direct mobile: find its operator and compare it with the list of mobile operators in Russia. But even so without a guarantee, because some mobile operators at the same time - and fixed operators.
The number +7 495 999-99-34 can be direct mobile. Or maybe this office buys a fixed connection from a mobile operator - only the operator knows.

But I digress, back to the numbering plan. Inside the files, everything is very simple - a table with six fields.


The order of the fields is as follows: ABC or DEF zone code, beginning of range, end of range, capacity, operator, region. Capacity is simply the number of numbers included in the range.

Searching according to the numbering plan for a region and an operator is a pleasure.

  1. We get the numbering zone code from the desired number.
  2. Using the code, select the appropriate ranges from the directory.
  3. We leave from the phone only what follows after the area code - the actual number.
  4. We are looking for what range the number falls into.
  5. Success! We found for the phone region, operator and type.


The number +7 301 220-22-47 is owned by Mobilon Telecommunications LLC. Region - Republic of Buryatia

Sometimes the phone does not fit into any range. This means that the number is incorrect. There are no exceptions. On this, I must say, the aforementioned Google library is punctured - it approves an outwardly faithful phone, not comparing it with the numbering plan.

Previously, at this step, the research ended. But in 2013, authorities passed a law abolishing “mobile slavery”. Since then, phone numbers are nailed to the operators not so tight.

Now the law permits: change the operator, keeping the number. But, attention, only within the region. You can not remove the phone from the region provided by Rossvyaz. It is impossible to “break” the ranges of distribution of numbers. Therefore, if only the region of the telephone number is of interest, then you can not read further. And I will continue and tell you how to find the changed operator numbers.

Get access to the database of transferred numbers


This is a bureaucratic step, respectively, the most difficult. And for most companies it’s completely impassable, unfortunately.

The numbers that changed the operator are stored in the database of transferred subscriber numbers (BDPN). Its operator is no longer Rossvyaz, but the  Central Research Institute of Communications .

The problem is that access to the DDP is very difficult. Of course, if you are not a mobile operator, a subject of a national payment system, a power structure or another agency.


All that an ordinary user can do is manually verify a specific number.

We gained access to the BDPN back in 2013 as a “different organization." But since then, the rules seem to have tightened. Even the application form has changed a lot, the latest one is on the website of the Institute of Communications. Therefore, I can’t advise anything here, alas.

UPD. In the comments they write that with access everything is not so harsh: “I worked in an energy sales company, without problems I got access to the bdpn for several days. <...> filled out the application, signed the director, put a seal and sent it electronically. Then he phoned for fidelity. "

Check if the number has gone to another operator


If you got access to the official database of ported numbers, then it's easy. We check to see if the subscriber has changed the operator, dropping the shackles of "mobile slavery."

The Institute of Communications uploads the BDPN to the SFTP server in three folders.


The first folder contains a complete reference. In the second - incremental updates. And the third stores the numbers returned to the "owners"

  •   PortAllNew . ,  00:00  ;
  • PortIncrementNew — .   ;
  • ReturnIncrementNew — , «» . .

Inside folders, data for all operators in all regions is stored without dividing by file. Files are needed to distinguish between updates.


The date and time of the update are inserted in the name of the increments. If you want to receive the transferred numbers as urgently as possible - here you are. If there is no urgency, it’s easier once a day to download the complete directory.

File format - CSV, compressed in ZIP. Inside - there's nowhere easier.


There are three fields in the directory files: number, operator, and number of lines. Moreover, the third field is filled out only for the first line - an elegant solution The

history is not stored in the BDPN: every day all transferred numbers are uploaded to the server. If the phone is not in the full directory or in increments per day, then it obeys the Rossvyaz plan. Therefore, for our purposes, the folder with the returned numbers isReturnIncrementNew  - not needed.

Every day we download fresh BDPN from the server. Any SFTP client is suitable for this: WinSCP or FileZilla FTP Client are suitable for Windows, and Nautilus for Ubuntu. A classic mistake in this case is to leave default FTP in the settings instead of the set SFTP. So you can suffer for a long time, do not repeat our mistakes.

When the directory of transferred numbers is at hand, it remains to look for the number under investigation in it. There are two options:

  • number found in the BDPN. In this case, we change the operator from the Rossvyaz plan to a new one;
  • the number is not in the BDPN - we leave the operator as is.

That’s all wisdom.

And you can make out the number "Dadatoy"


Another option is to give the Dadate phone number, the service will extract useful information from it.


We recognize the operator, correct typos in the number, show the country, region and time zone. Finally, we separate the inpatient from the mobile. We

process numbers of 10 kopecks apiece, if given by files or through the API. Hands on one phone - free of charge and even without registration. All this is on dadata.ru .

All Articles