Home computickets Definition of the region and telecom operator by phone number

Definition of the region and telecom operator by phone number

Author

Date

Category

It is necessary by the phone number to determine the region and telecom operator. This is necessary for the further definition of the method to call the most profitable to this number. Previously, it could be done in the country and operator code. Tables exist on the Internet. But now it is impossible to do it, because Accepted the law on the possibility of care to another operator while maintaining the number.

Please help come up with the most simple and fast algorithm for defining the number to the operator.

additionally notice that the option to call, then evaluate how much money went – it is not suitable, because The user of the number can change the operator quite often (on a historic scale).

If there is any API from operators to solve this task, it will be very great if you specify it.

Select the selection of directions Planning through the Dial-Plan Asterisk system.


Answer 1, Authority 100%

found a solution. Keyword HLR.

HLR Lookup is something mean between WHOIS and Ping, but for phone numbers. There is (as it turned out) a variety of services that allow you to check the number. The only minus that they are all paid.

for example,
https://www.hlr-lineups.com/
https://www.hlrlookup.com/prices
etc.


Answer 2, Authority 100%

If there is any API from the operators to solve this problem,
It will be very cool if you specify it.

http://mnp.tele2.ru/gateway.php?90000000

http://www.megafon.ru/api/mfn/info ? MSISDN = 90000000


Answer 3, Authority 25%

Here there is an API with examples
https://api.regius.name/ifaces/Phone-Number/#asterisk .
The base is updated often, but there are some restrictions in the free version.
It is convenient that MNC operator code shows, and the region code, and not just the name

Server gives an answer to JSON-format:
{“Phone”: “9123332211”, “Company”: “PJSC” Mobile TeleSystems “”, “Brand”: “MTS”, “MNC”: “01”, “Region”: “Kirov region”, “Kladr” : “43”, “Gibdd”: “43”, “UTC”: “+ 3”, “qty”: 48, “Limit”: 2000, “Answer”: “OK”}

and asterisk script (token you can not specify if it is not)

#! / usr / local / bin / python3
   Import Urllib.Request, JSON, SYS, PYMYSQL
   token = '98yysa8y8lnkn $ 27SDSKLDSK'
   With urllib.request.urlopen ("https://api.regius.name/iface/phone-number.php?phone=" + sys.argv [1] + "& amp; token =" + token) AS URL:
   Data = json.loads (URL.Read (). Decode ())
   IF Data ['Answer'] == 'OK':
     Print ('Exec Set Message = "Calling UTC' + Str (Data ['UTC']) + 'Region' + Str (Data ['kladr']) + '' + str (Data ['Region']) + ' '+ Str (Data [' Brand ']) +' "')
   ELSE:
     Print ('Exec Set Message =' + Data ['Answer'])

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions