
As you know, SIP is gaining more and more popularity and it is no secret that you can optimize the cost of telephony by correctly choosing a SIP provider.
But, unfortunately, the above statement is true only for large cities of Russia and the CIS. But what to do in cases where SIP is not available? Use PRI? Quite expensive, especially for a small company with a small number of calls, and again, not everywhere available. Use analog telephony in the old manner? Certainly not. The answer seems pretty obvious: the GSM gateway will solve all your problems.
')
At first glance, everything is quite simple to implement, but with more detailed thinking it will become clear that the gateway itself is not very functional and is only a kind of GSM to SIP converter, and for the implementation of even non-cloudy ones, it is still PBX (for example IVR, routing, queues). To minimize the cost process, let's assume that this is our favorite open-source Asterisk. If we are talking about a completely global economy, then you can immediately say: “Aha, and the server under Asterisk? It is also not free! ”(Although in my opinion, the thrifty admin will always have a piece of hardware under Aster :))
Now imagine that everything written above can be implemented only by means of a single GSM gateway? Incredible? Well, please under the cat.
A couple of months ago,
grigly wrote an article about the new GSM gateways of
Openvox , which ended with a completely optimistic phrase that
promoted action: full PBX. "
And really? Is it possible to implement the PBX functions by means of a gateway?
Colleagues, at once I will make a reservation that this solution is suitable for a small company, say with a staff of 10 employees.
So, to begin with, let's evaluate what functions of a PBX do a small company need? In my opinion, these are queues, IVR, call transfer.
Create sip peers in the gateway web interface:
Go to SIP → SIP Endpoints tab, click “Add New SIP Endpoint”
Name = 777
User Name = 777
Password = YourStrongPasssword123
Registration = Endpoint registers with this gateway
Hostname or IP Address = dynamic
Transport = UDP
NAT Traversal = Yes
Click “Save”

Further, by analogy, we create the required number of SIP peers.
Now we will enable SSH access in the web interface. To do this, go to the System → Login Settings tab and set the SSH Login Settings “Enable ON”

It is worth noting that the port for SSH in the 12345 gateway cannot be changed, which is apparently done for security purposes.
By default, the admin user does not have root rights, in order to get root, you must change the user to super, the password is super.

So, we go to the gateway via SSH:
ssh -p 12345 admin@192.168.1.111
Password: admin
After you hit the gateway, edit the context of the extra-channels.conf configuration file:
vim /etc/asterisk/extra-channels.conf:
Rule the context for an incoming call with SIM1:; Span 1: opvxg4xx / 0/1 "OpenVox G400P GSM / CDMA PCI Card 0" AMI / CCS
group = 1
context = ivr
signalling = gsm
vol = 70
mic = 1
dacgain = -15
adcgain = -3
debugat = off
smscodec = utf-8
; hwdtmfdet = 1
anonymouscall = off
call_waiting = off
band =
dialprefix =
switchtype = SIMCOM_SIM840W
channel => 1
Now create a new context ivr.
vim /etc/asterisk/extensions_custom.conf
Create a new ivr context:[ivr]
exten => s, 1, Answer ()
same => n, Background (press-1 & or press-2)
same => n, WaitExten ()
exten => 1.1, Playback (wait_connection)
same => n, Dial (SIP / 777)
same => n, hangup ()
exten => 2.1, Playback (wait_connection)
same => n, Dial (SIP / 888)
same => n, hangup ()
The dialplan in the example is the most primitive, it is intended for demonstration, in production, of course, protection against incorrectly entered digits must be implemented.
It is worth noting that Openvox supports sounds for IVR only in GSM format. I had sounds in the .wav format, which I recoded using the means of the system:
sox input.wav -r 8000 -c1 output.gsm lowpass 4000 compand 0.02,0.05 -60,-60,-30,-10,-20,-8,-5,-8,-2,-8 -8 -7 0.05
By default, gsm modules are not loaded in Openvox, you must load them into the CLI:
Openvox-Wireless-Gateway*CLI> module load codec_gsm.so Openvox-Wireless-Gateway*CLI> module load format_gsm.so
In order not to load gsm every time after reloading the gateway, I recommend adding these two lines to the /etc/asterisk/modules.conf file
We now turn to configuring the queues:
Go to the web interface of the gateway, tab Routing → Groups. Create a new group by clicking the New Group button:
Group Name = YourGroupName
Type = SIP
Policy = choose the appropriate calling strategy
Members = put a checkmark in the checkboxes opposite those numbers that we want to include in the group:

Now go to the tab Routing → Call Routing Rules, click New Call Routing Rule:
Routing name = YourRoutingName
Call Comes in From = for example, gsm-2 (that is, all calls from sim 2 will be redirected to our turn)
Send Call Through = from the drop-down list, select the group you just created.

Another important feature is the ability to transfer calls. To our great joy, this is already provided by the Openvox developers. Open feauteres.conf:
vim /etc/asterisk/features.conf
And we see there the following line:
blindxfer =>
That is, by pressing # 1, the call will be transferred, in principle, you can select any prefix for translation, I changed to * 1 for convenience.
Conclusion
Using the undocumented features of this device, as a result, we get the following costing for a typical small business:
1) 10 IP phones ~ 25 thousand rubles. (not the cheapest devices, but with support for HD codecs, headsets, and probably even PoE)
2) OpenVox VS-GW1200-4G ~ 15 thousand rubles
3) If you need to connect an external analog line and, say, a fax, then you can purchase an inexpensive FXO / FXS gateway, for example, Granstream HT-503 ~ 2.5 thousand rubles.
4) As mentioned above, the gateway is able to register the end SIP devices on itself, so it can register on the PBX itself, so there will be no problems connecting the SIP provider
Total, full VOIP in the office, with anlim trunks, queues and blackjack for less than 45,000 rubles!
The gateway does not have hard drives, and uses only high-quality components (we could see this in the
previous article about OpenVox), therefore it is an extremely reliable solution.
Moreover, this solution does not require any additional. licenses, subscriptions to those. support, etc., so the total cost of ownership is quite quickly calculated and you can forget about all sorts of pitfalls with licensing.