
Organization of a remote workplace using voice gateways
The task is: to submit one telephone number and Ethernet to one remote point. There is already terminated optics from the main building to this point. There are several ways to solve this problem, but we had two DLink 7022S voice gateways in our warehouse, so the solution was in the palm of our hand.
Nevertheless, a cursory search in the documentation and on the Internet did not give an answer on how to achieve the desired.

Under a cat there is no overview of gateways and not a manual, but an example of solving a specific problem. Not the most elegant way, of course, but quite working.
So, the connection diagram will be as follows:

No SIP servers should be used, the call should be transparent to the user, that is, without a set of additional digits. Gateways are connected to each other by WAN ports. A telephone cable from the telephone exchange or from the operator and an Ethernet cable to the LAN port are connected to the device at the central node. On the far side, a telephone and a computer are connected to it.

In the beginning, I had doubts about the operability of such a scheme. Can gateways communicate this way? Many articles on the Internet described the connection of this gateway to Asterisk or other SIP servers. It turns out that this is quite possible.
DLink 7022S carries on the body 1 WAN port, a switch for 4 LAN ports, 2 Line (FXO) ports for connecting to the telephone network and 2 Phone (FXS) ports for connecting phones. The front panel is full of status indicators.
In the experimental setup, we connect the two WAN ports with the usual patch cord. In fact, of course, there can be any IP network.
Let's start with telephony, since it was her work that seemed at first dubious. First of all, you need to configure IP addresses on the WAN ports for gateway communication. Since these DLinks are essentially mini-PBXs, it’s naive to hope that everything will work without tuning. And so it happened. Next, I will describe the configuration algorithm.
The address on the computer is issued via DHCP. The default address is 192.168.8.254. It is better to start the broadcast ping 192.168.8.255 and you will see which address will answer you. Authorization fields are empty.
We work with the Network Settings group of settings. The WAN IP address will be used to connect the two gateways:
the LAN IP address must not be on the same subnet as the WAN address and vice versa must belong to the local network of the enterprise for management purposes.

In order not to fence the fence from new subnets and routes, you can configure the bridge operation mode:

The working scheme will be as follows:
1) when the call arrives at the first FXO port of the gateway on the central node (on which the number 601 will be configured), it will automatically be redirected to the number 701, which will be configured on the first FXS port of the gateway at the remote point. Similarly for the second.
2) when a call is made from a remote point via the first FXS port (number 701), the number 601 will be automatically called - the number of the 1st FXO gateway port on the central node. Similarly for the second port.
Here you need to specify other phone numbers instead of default.
Set the numbers 601 and 602 for the FXO ports, respectively:

We also disable the use of SIP servers:

In the phone book you need to make two entries with the corresponding numbers and the address through which the call will be made to this number. In our case, this is not yet the configured address of the second device:

Last of all, set up the call so that when dialing the PBX extension, the call passes without extension dialing. If this is not done, then after dialing the internal number the female voice will say: “Dial phone number” - and you will need to dial 601 or 602 to get to one of the two connected phones. That is, in fact, our configured numbers 601 and 602 are internal. And the next setting, we indicate that the call should automatically go to the appropriate ports.

I’ll explain again: if a call arrives at the first FXO port (a line from the telephone exchange or from the operator is inserted into it), it will automatically (thanks to the Hot Line daw) go to number 701, which in turn is entered in the phone book with the IP address second gateway.
To save the settings, it is not enough to click Accept on the settings page - you need to go to the System Operation group, install both the daws and click Accept.

Configure the IP address for the WAN and LAN ports.
If in the first case the bridge mode was set, then it is better to do the same here, although DLink can be made here by a router, which, for example, via DHCP will provide network parameters. We don’t need this and therefore I set the bridge mode:

For the WAN address must be on the same subnet as the WAN address of the first device:

Here you can leave the same numbers in SIP as by default:

Similar to the first case, disable the use of SIP servers .

In the Phone book, we also add two lines, only now we indicate the other numbers and the IP address of the first device.

And in order for the calls to pass unhindered, we will set up Hotline again - an automatic call: We

save the settings and reboot the device.
You can check the connection between the two gateways through the menu Status-> Ping Test

From this window you can conclude that the devices most likely work on linux.
Now you can make a test call. If you did everything according to the instructions, then the call will definitely pass. When you pick up the handset, the Phone indicator lights up yellow,

when a connection is established with the second gateway, the Line indicator lights up on the second.

What problems are noticed:
1) call delay and hang up in a few seconds. Attention is practically not attracted, especially since the voice is not late.
2) Sometimes, right after loading, the gateway confuses the phones and sends them to the wrong devices. For example, a call to number 104 comes to 123. But after the final download, the situation is corrected
.
Numbers 601, 602, 701, 702 are exclusively internal for this group of gateways and there is no need to start them on the PBX.
It is recommended to immediately change the login / password for access.

Other DLink devices of this genre work and configure in a similar way.
The tuning principle is slightly less than fully taken here .
Nevertheless, a cursory search in the documentation and on the Internet did not give an answer on how to achieve the desired.

Under a cat there is no overview of gateways and not a manual, but an example of solving a specific problem. Not the most elegant way, of course, but quite working.
So, the connection diagram will be as follows:

No SIP servers should be used, the call should be transparent to the user, that is, without a set of additional digits. Gateways are connected to each other by WAN ports. A telephone cable from the telephone exchange or from the operator and an Ethernet cable to the LAN port are connected to the device at the central node. On the far side, a telephone and a computer are connected to it.

In the beginning, I had doubts about the operability of such a scheme. Can gateways communicate this way? Many articles on the Internet described the connection of this gateway to Asterisk or other SIP servers. It turns out that this is quite possible.
DLink 7022S carries on the body 1 WAN port, a switch for 4 LAN ports, 2 Line (FXO) ports for connecting to the telephone network and 2 Phone (FXS) ports for connecting phones. The front panel is full of status indicators.
In the experimental setup, we connect the two WAN ports with the usual patch cord. In fact, of course, there can be any IP network.
Let's start with telephony, since it was her work that seemed at first dubious. First of all, you need to configure IP addresses on the WAN ports for gateway communication. Since these DLinks are essentially mini-PBXs, it’s naive to hope that everything will work without tuning. And so it happened. Next, I will describe the configuration algorithm.
Configuring a gateway on a central site
The address on the computer is issued via DHCP. The default address is 192.168.8.254. It is better to start the broadcast ping 192.168.8.255 and you will see which address will answer you. Authorization fields are empty.
IP addresses
We work with the Network Settings group of settings. The WAN IP address will be used to connect the two gateways:
the LAN IP address must not be on the same subnet as the WAN address and vice versa must belong to the local network of the enterprise for management purposes.

In order not to fence the fence from new subnets and routes, you can configure the bridge operation mode:

Now configure the SIP settings:
The working scheme will be as follows:
1) when the call arrives at the first FXO port of the gateway on the central node (on which the number 601 will be configured), it will automatically be redirected to the number 701, which will be configured on the first FXS port of the gateway at the remote point. Similarly for the second.
2) when a call is made from a remote point via the first FXS port (number 701), the number 601 will be automatically called - the number of the 1st FXO gateway port on the central node. Similarly for the second port.
Here you need to specify other phone numbers instead of default.
Set the numbers 601 and 602 for the FXO ports, respectively:

We also disable the use of SIP servers:

In the phone book you need to make two entries with the corresponding numbers and the address through which the call will be made to this number. In our case, this is not yet the configured address of the second device:

Last of all, set up the call so that when dialing the PBX extension, the call passes without extension dialing. If this is not done, then after dialing the internal number the female voice will say: “Dial phone number” - and you will need to dial 601 or 602 to get to one of the two connected phones. That is, in fact, our configured numbers 601 and 602 are internal. And the next setting, we indicate that the call should automatically go to the appropriate ports.

I’ll explain again: if a call arrives at the first FXO port (a line from the telephone exchange or from the operator is inserted into it), it will automatically (thanks to the Hot Line daw) go to number 701, which in turn is entered in the phone book with the IP address second gateway.
To save the settings, it is not enough to click Accept on the settings page - you need to go to the System Operation group, install both the daws and click Accept.

The second device is configured in much the same way
Configure the IP address for the WAN and LAN ports.
If in the first case the bridge mode was set, then it is better to do the same here, although DLink can be made here by a router, which, for example, via DHCP will provide network parameters. We don’t need this and therefore I set the bridge mode:

For the WAN address must be on the same subnet as the WAN address of the first device:

Here you can leave the same numbers in SIP as by default:

Similar to the first case, disable the use of SIP servers .

In the Phone book, we also add two lines, only now we indicate the other numbers and the IP address of the first device.

And in order for the calls to pass unhindered, we will set up Hotline again - an automatic call: We

save the settings and reboot the device.
You can check the connection between the two gateways through the menu Status-> Ping Test

From this window you can conclude that the devices most likely work on linux.
Now you can make a test call. If you did everything according to the instructions, then the call will definitely pass. When you pick up the handset, the Phone indicator lights up yellow,

when a connection is established with the second gateway, the Line indicator lights up on the second.

What problems are noticed:
1) call delay and hang up in a few seconds. Attention is practically not attracted, especially since the voice is not late.
2) Sometimes, right after loading, the gateway confuses the phones and sends them to the wrong devices. For example, a call to number 104 comes to 123. But after the final download, the situation is corrected
.
Numbers 601, 602, 701, 702 are exclusively internal for this group of gateways and there is no need to start them on the PBX.
It is recommended to immediately change the login / password for access.

Other DLink devices of this genre work and configure in a similar way.
The tuning principle is slightly less than fully taken here .