📜 ⬆️ ⬇️

FreeSWITCH life example ...

Good time% username%.

I would like to warn you earlier that everyone who is in principle will be right, this system is like shooting sparrows from a cannon, but I wanted something like that. Also, some elements in this scheme did not rise from scratch, they were already used in solving other problems, and we will not consider their architecture (database server and HTTP server), let’s take the fact that these services are reserved properly.

One of my works was tasked with transferring external lines from gsm gateways (about 30) and land lines pri (100 lines) to IP. Also due to the impossibility of further development of the Samsung ids-500 PBX (2 stations) the installation of IP phones. At the PBX has already been about 600 business phones. Currently external lines 190.
')


Primary requirements:


Briefly on the software used:
FreeSWITCH - call routing, subscriber registration, faxes, in general, all PBX functions
OpenSIPS - balancing registrations, calls to FreeSWITCH servers, also when intercepting a call, determines the server to which the call is received and sends a user request to it.
Asterisk - DAHDI cards, logic 0.1%, forwarding calls from PBX to FreeSWITCH and back.
Django - distribution of configurations on servers (mod_xml_curl), phone configurations, and management of all this economy.

I’m not good at drawing schemes, so I’ll try to describe the scheme in this way (as it turned out, I don’t get very good at writing too). If more detailed details will be interesting, I will answer in addition.

Equipment:


2 - physical servers, each of which has two DAHDI boards with which Asterisk is working (port 6060 is used for sip`a). Also on the same machines installed FreeSWITCH. PBXs are located in different server servers, servers are also separated by these server servers. Let's call them sip1 and sip2.
1 - virtualka, it communicates with operators through it, FreeSWITCH is installed, let's call it sip0
1 - Virtualka, OpenSIPS is our balancer.

Logics:


Each server is connected to each PBX by pri, which provides us with redundancy. When calling from a PBX, Asterisk tries to send a call to FreeSWITCH running on this machine, in case of an error, we send a call to a second server.
Calls to PBXs basically follow the same logic, with the only exception, first the call goes to the server that is located next to the PBX that the call is going to. Ie if the call came on sip1 and closer to ATS2 is sip2, then the call is first sent to it.
All PBX numbers that have an external number binding are registered in the system, when a call comes out with sip0, the corresponding caller id is substituted, in the case of absence of binding, a pilot number is substituted. This is released as a variable defined for users out_number and checking in the dialplan ${user_data(${caller_id_number}@${domain} var out_number)}
For VOIP numbers, the logic is the same.

For internal calls to the caller name, we get the mod_cidlookup request via http. Match the phone number of the employee's name, a separate story about AD and 1C.
VOIP phones - Dlink dph-105, dph-400, grandstream gxp-1405, gxp-2120. The configuration on them is distributed through http, we take all the settings from the base and on the fly we form the necessary configuration file.
The admin has implemented the minimum functionality, the configuration of the user devices, cdr, rebooting the devices, dialplan management, small statistics for the day incoming / outgoing successful calls and also by errors, the current number of registered users and the number of active calls in the context of servers.
sip1 and sip2 use the same database for user registration, voice mail, active calls, cdr, storage of variables.
About the scalability and redundancy of FreeSWITCH ʻa can be read Enterprise deployment
Currently, there are 300 registered SIP users, 600 users on PBXs. The maximum number of simultaneous calls to external destinations is 40.

I understand this text flow is not complete and does not describe the whole picture, however, as I constantly put off writing, I decided to write as much as I can and if this topic is interesting I will expand and complement it.

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


All Articles