📜 ⬆️ ⬇️

Call for free using ENUMER blockchain service

The article describes the decentralized implementation of the ENUM IP telephony protocol based on the Emercoin blockchain cryptocurrency. A description of the ENUMER system, its difference from other ENUM implementations is given. Instructions are also given for expanding the ENUMER node and an example of a VOIP PBX FreeSWITCH configuration for working with ENUMER is given.




Introduction


In the world, IP-telephony, which has a number of advantages in comparison with the classical one, is becoming more and more common. IP solutions are usually cheaper than classic ones and have more functionality. Currently, IP ATCs are used in various organizations, but the main telephone networks continue to use classic solutions, even if based on digital PBXs. As a result of this state of affairs, communication even between two IP ATCs takes place through a regular telephone network, the PSTN. Consider an example:


Suppose we have the organization "Buyer", and another organization, "Seller". Both organizations use IP ATC (also called PBX) for their internal needs. Let the employee of the Buyer find in the advertisement the announcement of the Seller that interested him. The buyer decided to call the Seller, and dials his number. The call is as follows:




During this call, two IP ATCs are connected through the PSTN chain of providers, and accordingly the buyer pays the call to the provider, who forwards the call from the VOIP network to the PSTN network (lands the call). Well, then there are offsets between PSTN-providers that do not interest us.


If IP_ATC_buyer “knew the way”, it could directly connect to IP_ATC_ seller via the Internet, and thus save the buyer from paying for the PSTN-downer, and the call would be free:




Yes, and the reliability and quality of the connection would be significantly higher, since in such a chain there are less intermediate elements and transcoding of voice traffic.


It is clear that “to know all the roads”, that is, to support all kinds of direct IP connections, is very laborious, and a network protocol was developed for converting a phone number to a “road”, that is, into a URI, which was called ENUM.


Enum


The ENUM protocol ( rfc6116 ) works as a distributed address book, and allows for a telephone number to “find the way” to the corresponding IP ATC that serves this number. Protocol Description: https://en.wikipedia.org/wiki/Telephone_number_mapping


The idea of ​​using the protocol is as follows:
')


Benefit from ENUM


Using ENUM provides benefits for both the initiator and the receiver of the call. For them it is:


The ENUM protocol is simple and lightweight, technically efficient, and all the most popular IP ATCs support it. However, it did not receive wide distribution from, and there are a number of organizational and economic reasons that have become problems for widespread adoption. Consider them in more detail.

Problems with current ENUM implementations


  1. The first problem of ENUM is that now there is simply no such place where the owner of a normal IP ATC could register his number (or several numbers) and the corresponding SIP URI. Or rather, such places were, for example, freenum.org or e164.org. But freenum has long been unavailable, and e164.org stopped working in November 2016. Yes, somewhere, an ENUM server like e164.arpa continues to exist. But this service is not for IP ATC owners or individuals, but an “inter-provider node”, where large and mutually verified VOIP providers give information about the possibility of landing on their network. A kind of "parties for their own", where the usual owner of IP ATC is no road.
  2. The second problem is the critical dependence of network operation on a centralized service, which may behave incorrectly or not work at all. A good example is e164.org. In the last 2 years, he worked unstably, and besides, he was engaged in obscenity, for example, despite toll-free numbers registered with him, he directed traffic not to IP ATC subscribers, but to “his landowners”, who naturally did not forget to bill for the delivered PSTN network calls. Naturally, this behavior led to the fact that the owners of toll-free numbers lost the economic incentive to register these numbers at e164.org.
    And about a month before closing - e164.org in general stopped giving ENUM answers, despite the fact that the records contained correct (we checked).
  3. Since the classic centralized ENUM system uses DNS transport, it is vulnerable to all sorts of attacks on the DNS infrastructure, such as DNS-Spoofing , DNS-hijacking , and the like. Naturally, failures in the DNS system also lead to a denial of service in the ENUM system.
  4. And finally, but important: The load on such a server is very large, because the request is made when you try each call from IP ATC. Yes, requests are cached by intermediate DNS servers, but nevertheless - the load still remains high for the server serving all telephone exchanges around the world. As a result - denials of service or delays in processing requests, as well as the high cost of server infrastructure.

The aforementioned reasons for the “failure” are of an organizational and technical nature, stemming from the centralized organization of the service and the opacity of the query resolution algorithm. Indeed, a centralized implementation of ENUM, like any network service, depends on the performance of the site that services the creation of ENUM records and their support for current ones, as well as the corresponding DNS server that allows ENUM requests. In other words, trust in such an ENUM system cannot exceed trust in the organization that manages this system. Confidence also reduces the fact that the algorithm and criteria by which a centralized service allows ENUM requests are completely unknown. So, for example, today it can work as it should, and tomorrow it can redirect where calls to a certain number that interests the competent comrades ( who care about everything ). For example, on an intermediate VOIP-node, which in turn can do anything with traffic. Why suddenly redirect? Well, maybe the owner of the room is playing jazz ...

Accordingly, the failure of such a service leads to an instantaneous shutdown of the entire network. Both of these shortcomings were fully demonstrated by e164.org: at first it redirected toll-free calls not to the registered numbers, but to its landline provider, then generally answered with empty answers, and at the end of the epic went out of business, with all the bases.


ENUMER - decentralized enum


To solve the above problems, we have developed a decentralized ENUM system based on the Emercoin blockchain. The project was named "ENUMER", derived from the words "ENUM" and "Emer". In short: ENUM + EMER = ENUMER.


Cryptocurrencies are the trend of the modern financial industry, and are currently actively developing. The basis of all cryptocurrencies, including Emercoin, is the blockchain - a distributed, trusted public database of payment transactions.


A feature of Emercoin is NVS (Name-Value Storage) - a distributed, trusted storage of general-purpose information. That is, each network member has a valid local copy of the entire blockchain, and therefore the entire content of NVS, and trust in the contents of NVS, as well as the entire blockchain, is created through the consolidated efforts of miners to prove POW’s work and to prove POS’s share.


Based on this repository, emcSSH / emcSSL security systems , as well as the invulnerable decentralized domain name system EmerDNS , have already been created and are being operated.


This decentralized ENUM project is based on EmerDNS, and has the following advantages over the classic ENUM centralized implementation:


As a result, we get the system:


But with such impressive advantages, the decentralized ENUM has its own specific problems related to the public availability of the infrastructure. So, anyone can create a record with any content, and capture the record corresponding to someone else's phone number, and its contents either block ENUM access for the true owner of the phone, or worse, redirect the call to the wrong place. You call, for example, the laundry, and you get into the Ministry of Culture ...

To prevent such abuses, the system provides for verifiers. These are agents who verify that an ENUM record really belongs to the owner of the corresponding number, and then pass the signature to the owner of the ENUM record - the verdict that the record is correct and can be used. Also, in order to curb abuse, the ENUMER system only works with individual phone numbers. That is, it is not possible to grab a large chunk of numbering space with one ENUM record.


How to create a verified entry in the ENUMER system


An IP ATC owner who wants to receive calls using ENUM must first configure his IP ATC so that he can receive incoming calls to the SIP URI "from the world." The configuration details depend on the specific IP PBX (PBX) and network environment, and are no different from the usual PBX settings without a blockchain.


After that, a verified ENUM record should be placed in EmerCoin NVS, which the callers will use. To do this, take the following steps:


Set wallet Emercoin


Emercoin's purse (node) is a client program of a distributed ENUM network (and not only ENUM), and something like a “personal account” where the user can create his ENUM records and then update them as needed. Wallet can be downloaded from http://emercoin.com/#download


To manage your records, we recommend using a GUI wallet for your OS.


After downloading and launching, wait until the wallet synchronizes the local copy of the blockchain. This may take several hours.


Get EMC Coins


Next, you need somewhere to purchase the EMC coins needed to download and update records in NVS. They can be purchased at one of the exchanges , or contact the developers .
To reserve one record for 10 years and several subsequent updates, approximately 0.05EMC is required, which is $ 0.06 at the current rate. In general, the price is quite acceptable. And if we take into account that soon the price for NVS-recording will be reduced by 100 times , we can consider the costs for maintaining ENUMER-recordings close to zero.


The address where to receive the coins is in the “File / Receiving Addresses” menu, and it looks like this: ERFJfQGwmZEomHQHGZsRFLZEyBxaWsCHTo .


Create ENUM Record


To store ENUM records, trusted decentralized storage is used — EmerCoin NVS (Name-Value Storage). Access to NVS entries is done either through the GUI of the wallet in the “Manage Names” tab, or by using the JSON API commands provided in the documentation. NVS-record, as the name implies, consists of Name (Name) and value (Value).



Name


For the ENUM subsystem, the record names are as follows:

enum: phone_num: N
Here:


For example:

enum: 18009359935: 0

If the prefix of the service and the number is clear, the purpose of the parameter N needs clarification. This number is needed to protect the true owner of the number from squatters who can capture an ENUM record corresponding to someone else's number, and through it try to do all sorts of bad things. They will not be able to use the zipped recording (see about verification below), but in the absence of an attempt number N, the real owner of the number will not be able to enter his entry. In the case of using the number N, the real owner of the phone number can create an entry with the first free value N. For example, suppose you want to create an ENUM record for the phone number 18009359935 , and the example shown above has already captured some kind of squatter. It does not matter, create the name " enum: 18009359935: 1 ", and after verification, the system will believe exactly your name, and the squatter will admire the useless record in which he burned his coins. If this name is dropped too - try to create an entry with the number N = 2, and so on.


Value


The Value field consists of several lines. The strings are either the U-directives of NAPTR ( rfc3402 ) ENUM (start with E2U), or the signatures of verifiers (start with SIG). One ENUM record may have several directives, as well as several signatures from different verifiers. Example value, including U-directive and signature:


 E2U + sip = 100 | 10 |! ^ (. *) $! Sip: 17772325555@in.callcentric.com!
 SIG = ver: enum | IC00zMELlEwmMHLpQs8 =

You do not have any signatures yet (verification lines will provide you with verifiers), so when creating a record, make only U-directives (at least one) that will ensure the routing of calls to your IP ATC. The directive structure is as follows:

Service = Priority | Preference | Regex


In the example above:


The meaning of the fields and their names correspond to the standards of the classical ENUM. For those who are too lazy to read the documentation, a brief guide for beginners:

Almost always service is as in the example above, E2U + sip for SIP IP ATC. Other options are possible, for example E2U + iax or something like that. As mentioned above, there may be several U directives in the ENUM record.


Priority, Preference - leave as in the example to start. It is not recommended to reduce them greatly.

The most important thing is Regex. This is the rule by which the phone number is converted to a SIP URI. The delimiter is “!”. In the first part - regex is superimposed on the phone number, and in the second - this number is substituted for \ 1, and thus a SIP URI is formed.
Another good example of using regex :! ^ \ +? 441865332 (. *) $! Sip: \ 1@nominet.org.uk!


Verify


So, the ENUM entry was created, and the blockchain accepted it. It is already available to all. But the IP ATC callers are ignoring it unanimously, since there are no signatures of verifiers that they believe in. And it is right. For you never know who created an entry with your phone number? And what, now send all the traffic where indicated there, without looking? No, traffic will be sent only on the basis of verified records containing the verifier's signature.


At present, the automatic verification system has not yet been made, but the plans include its manufacture and commissioning. If you wish to participate in the partnership for the creation and operation of the automatic verification subsystem, contact us: enumer@emercoin.com. For the time being, verification takes place through a human operator.


To get the signature, write an e-mail to enumer@emercoin.com. In the letter, specify the NVS-name of your ENUMER record, for example: enum: 18009359935: 0 .

Within a few days, the operator will check for the record and make a test call to the appropriate number to make sure that the owner of the number is aware of the request and agrees to use ENUMER. After successful verification, we will send a reply containing a signature that you will add to your NVS record. After entering the signature, your entry will become trusted, and other users will be able to use it for direct calls to your PBX.


Add the signature of the verifier to your ENUM record


By putting this signature into your ENUM record and executing NAME_UPDATE, you prove to everyone the ownership of the number, and callers (ENUMER clients) who believe this verifier will send calls not to the PSTN, but to the SIP URI of your IP ATC.


There may be several signatures in ENUM records, from different verifiers. A client uses an ENUM record if there is at least one signature from one of those verifiers that he believes.


After adding a signature - your ENUM record is active, and ENUMER clients can call you directly, without using a PSTN network.


How to call using ENUMER (client)


Now, after the entry about your IP ATC is made to ENUMER, it remains to start using the system for the benefit of yourself and other subscribers. To do this, you need to make your IP ATC send ENUM requests to Emercoin NVS.


Using the enum.enumer.org service


We created a public gateway in ENUMER, and any PBX user without any settings of the blockchain and TP can use it in his PBX. To do this, send an ENUM request to the DNS: to the resolum enum.enumer.org. An example of a test request from the command line and response:

 $ dig -t naptr + short 53995390081.enum.enumer.org
 100 10 "u" "E2U + sip" "! ^ (. *) $! Sip: \\ 1@tollfree.alcazarnetworks.com!"  .

But when using our gateway, you potentially get all the problems discussed above related to centralization and the use of an external server. Therefore, the main purpose of our gateway is to provide a test environment, and nothing more. We strongly do not recommend using our gateway for practical use in an under-exploited system, but rather deploy your own gateway in EmerDNS, as will be explained below.

Deploying a gateway in EmerDNS


The most correct, fast and secure option is to install the EmerCoin daemon and deploy the gateway to emcDNS on the local network or even on a server running IP ATC. Documentation on the deployment of such a gateway - here . See “Integration into a regular DNS tree”.


In the BINDa config (or another DNS-proxy), you will need to add a link to the fifth zone “enum”, by analogy with the four already existing ones from EmerDNS.


In addition, in the emercoin.conf wallet config, you must add “$ enum” to the list of served zones, as in the example below. Using the “$” sign instead of a dot indicates to the wallet that this zone will be serviced according to the ENUM rfc6116 rules. In addition, two parameters specific to ENUM must be added to the wallet config:


Thus, the following lines should be added to the emercoin.conf configuration file:
 emcdnsallowed = $ enum | .coin | .emc | .lib | .bazar # Allowed TLDs, including ENUM
 enumtrust = ver: enum | olegh
 enumtollfree = @ enum: tollfree

To test the settings, try manually sending an ENUM query to the DNS:

$ dig -t naptr + short 53995390081.enum localhost



The answer should be something like this:
 100 10 "u" "E2U + sip" "! ^ (. *) $! Sip: \\ 1@tollfree.alcazarnetworks.com!"  .

If something does not work, try sending the request directly to the wallet, to port 5335

$ dig -t naptr + short 53995390081.enum localhost –p 5335

And localize the place of failure. But with the right settings, everything works right away and without problems.

IP ATC connection


This is the easiest. In dialplan-e IP ATC, you must specify that after resolving internal and corporate numbers, but before moving to PSTN providers, we make a request to ENUMER. Naturally, before the request it is necessary to bring the desired number to the format of ITU-T E164.


Below is an example of a fragment of the dialplan-a for FreeSWITCH, which first leads the number to the E164 format without the leading plus, and then makes a request to ENUMER, adding a plus when prompted. If ENUMER cannot help, a request is made to e164.arpa. Well, if there is nothing there, then the dialplan goes to the PSTN landings. A similar dialplan fragment can be created for another IP ATC that supports ENUM (Asterisk, Yate, etc).


 <! - Normalize numbers to ITU-T E164 without PLUS ->
 <extension name = "Normalize to ITU-T E164 without PLUS">
   <condition field = "destination_number" expression = "^ (?: \ + | 011 | 00) (\ d {7,}) $" break = "on-true">
     <action application = "transfer" data = "$ 1" />
   </ condition>
   <condition field = "destination_number" expression = "^ (\ d {10}) $" break = "on-true">
     <action application = "transfer" data = "1 $ 1" />
   </ condition>
   <condition field = "destination_number" expression = "^ (\ d {7}) $" break = "on-true">
      <action application = "transfer" data = "1 $ {home_code} $ 1" />
   </ condition>
 </ extension>

 <! - Lookup E164 with PLUS in the ENUMER and e164.arpa ->
 <extension name = "Lookup ENUM" continue = "true">
   <condition field = "destination_number" expression = "^ (\ d {7,}) $" break = "on-true">
     <action application = "ring_ready" />
     <action application = "set" data = "hangup_after_bridge = true" />
     <action application = "set" data = "continue_on_fail = true" />
     <action application = "set" data = "effective_caller_id_name = + 15553550000" />
     <action application = "set" data = "effective_caller_id_number = + 15553550000" />
     <action application = "enum" data = "+ $ 1 enum" />
     <action application = "bridge" data = "$ {enum_auto_route}" />
     <action application = "enum" data = "+ $ 1 e164.arpa" />
     <action application = "bridge" data = "$ {enum_auto_route}" />
     </ condition>
 </ extension>

Source: https://habr.com/ru/post/337034/


All Articles