What is SIP probably already know many. In fact, this is just a session establishment protocol for communication devices, everything is simple - you ask the server for the presence of the called subscriber, the server responds that it is there, no, it is live-offline, and so on, the server responds to you - it does, it is there , asks both subscribers to establish a connection (ACK), after which you successfully talk to a friend. The protocol is quite simple, very similar in both codes and organization to HTTP.

This article is not about the protocol. It will be about how to create your own PBX, rationally organize external and internal calls.
So: for a start, we will consider several options of “ready-made solutions” for organizing our own PBX.
')
Option 1: Commercial product CommunigatePro. Why at number 1? Yes, because there are implementations for all major platforms, there is an intelligible web-based administrator interface and a bunch of related services, mail, IM and so on. Worth the money, but for the formal service can easily work as a personal service without limiting functionality.
Option 2: Asterisk. asterisk.org. And a huge pile of clones, assemblies, forks: TrixBox (
trixbox.org ), Elastix (
www.elastix.org ), Yate2 (
voip.null.ro ), FreePBX (
www.freepbx.org ) ... you can take a long time to list Clones and Asterisk mods . What is a plus - the project is developing, there are many additions - web interfaces, database integrations. Minus - Asterisk has not very simple syntax of configuration files. Therefore, I do not recommend it to beginners.
Option 3: Other software I don’t know about. :-) In fact, there are a huge number of server solutions with intelligible interfaces for the administrator, client, billing, etc.
So. It is clear that we will talk about CommunigatePro (
www.stalker.com/communigatepro ). By the way, there is Russian documentation for it, there are many references, for example, here:
relay.bhost.ru/guide/russianInstalling the server is quite simple for both different linux implementations and for windows. The server uses 2 main folders - the service folder and the data folder, where domain accounts, settings, web skin templates and voice messages are stored.
The entire installation on any platform is reduced to running the installer, specifying folders. The process is minimal, so we will not consider the installation process. If someone has problems - I will answer in the comments.
In any Linux, CommuniGate is located in the / opt / CommuniGate and / var / CommuniGate folders.
Service is installed. What's next?
The default port of the web admin is: 8010. We go to the administration service with any browser
127.0.0.1 : 8010 if the server is installed on the same computer, if you installed the service on the remote computer, replaces 127.0.0.1 with the address of the remote server). When you first log in, the server will ask you for a password to manage the server. There you can also specify the system default language. The default user is postmaster.
All we are in admin. To deploy a SIP service, 3 steps are enough:
1. Via the Web Interface of the Administrator, open the General page in the Settings area: specify the domain or use your IP address instead of the domain. All email addresses in this domain will be treated as local, and (in the simplest case) the mail will be stored in the user's local folders. Initially, this field contains the name of the server computer that CommuniGate Pro takes from the OS. If this name looks like host12345hh.company.com, then you should change it to the domain name that the Server should maintain.
2. Domain created. Now we need to configure clients and their phone numbers. In communicagate it is quite simple. In the default domain, we climb into the domain objects, add the user (for example, ivan). After pressing the Create button, we are thrown onto the user settings form, we must enter the password for the user and drop it to the bottom of the settings page - there, at the bottom right, the most important thing is the text field with the name “Telephone Number”. Well, as the first mover we put 1001).
This is the most important thing for local PBX. Wash everything simple. Now you need to create another couple of accounts and try to talk within the network.
Repeating steps 2, we add the users Vasya and Jenya by assigning them the numbers 1002 and 1003, respectively.
Now the stage of choice: what will we say?
Options 3:
1. There are softphones. The list can be viewed here:
en.wikipedia.org/wiki/List_of_SIP_softwareI personally like
en.wikipedia.org/wiki/SIP_Communicator2. There are hardware solutions. I use WellTech LP-388 hardware. There are many other analogues.
3. SIP adapter. it is made in the form of a box with an ezernta and a simple tephonic RJ-11 hole. Not popular for private purposes.
So, put the software (for debugging, you can put 2 siphon on the same computer), indicated different accounts, WE'RE DRAWING!
The call has gone! We enjoy the fact that everything works. And if you dial 200 from any of the clients, the Auto-Attendant starts talking to us - this is the auto-informer of the system. While he speaks English, later we will teach him to communicate in his native Russian).
Now the most important stage. External world!)
3. In order for our internal PBX to not only connect us between each other, we need to have an external SIP gateway.
There are many. Consider a couple of the most popular. A service that is known to be sipnet (
sipnet.ru ). We cure. After registration, the service will give us an extension number of the type 0023413643 - this is the extension number of the system. I don’t know how it is now, but in times of promotion, sipnet gave a small bonus of 100 rubles at the time of registration to the account. This is enough to establish an external connection for our server.
What do we need to throw the server out?
- sipnet address - sipnet.ru
- our username and password of the account that we registered
Moving on: we climb in the admin panel of our communigate in Settings - Real Time - SIP - Gateways.
We see an empty form with fields: Gateway Name, Domain, Username, AUTH-Name, Password - this is in the left column, on the right - Calls: (Authentication, Proxy), Replace, Contact Field and Register once in…
What we write: The gateway name is a personal name for you, you can name at least tel1, we will use this name later when setting up routing of calls.
The main point: Domain: sipnet.ru - where the road, Username: Your ID in the system format 0023413643 and Password.
Specifically for sipnet, you must put Auth in Auth (in different systems in different ways) and set Register once every ... 30 minutes. These are their recommendations.
The Proxy field is used to ensure that your servers with Unreal IPs work with signals and media. If you have an internal ip, I advise you to put the type of media proxying.
And now the most important thing. As our Vasya to bring out.
We climb in the settings - Router (Router):
There is a full text box.
Do not get scared, look what is written:
= john; simple alias
<sales@client1.com> = sales-client1; simple alien alias
<info@client1.com> = info@otherhost.com; user -> another user
This is the setting for the passage of calls within your system.
In fact, in the default installation, you need to fix only 1 tsifirku - the one where you have local calls. By default, it costs 7d - if you plan to use numbering like 1001 1002 - change to 4d, if like me 005-364536 - <005 (6d) "*> well, or by analogy - <(6d) @ *> if without prefixes.
Now the most pleasant: we configure the CITY.
Just one line after everything that is there (add):
N: S: <(7d) @ *> = + 7495*@tel1.sipgw; this is our outside world! tel1 is how you called the gateway (see above)
Simply save (Modify) and dial your home number from your soft background.
CALL GONE!)
Congratulations! You have set up your own PBX, where you can distribute internal numbers to your friends, communicate over the network, both with software clients and with hardware solutions of tsiska, veltecha, etc. In addition, this server also supports IM, mail, web, but more on that later .
And a small Py-Sy - if you lock the second gateway in the Gateways, calling it, for example tel2, you can easily make Routing like this:
N: S: <(7d) @ *> = + 7495*@tel1.sipgw
N: S: <8 (10d) @ *> = + 7*@tel2.sipgw
It will work like this: all city calls in the format 9463746 will go to the provider's gateway tel1, and all cellular calls in the format 89267485746 through the second provider tel2. It is very profitable if one provider provides Moscow as a bonus for free, and the second has a cellular price much lower than the first.