⬆️ ⬇️

Yate - SIP telephony at home or in the office in 5 minutes!

Everyone is talking about Asterisk and its fork, for large companies they suggest using Cisco or Avaya, but for some reason almost nowhere is there any information about Yate - a simple and convenient, but at the same time, very functional solution for IP-telephony.



In this article I would like to briefly talk about building Yate for Linux, as well as its initial configuration for working with SIP.



Yate Logo

Yate is written in C ++, allows the use of modules and extensions, can be installed on almost any operating system, supports SIP, H.323, IAX and Jingle.



Part 1. Build.



Because Ubuntu is installed on a home computer, then the whole instruction will be adapted exclusively for this OS, but, in general, it will not be very different for other systems.

')

Only the first version of Yate is available in the repositories, although officially 2.1 already exists, which was released in November. So download the sources and proceed to action.



First you need to install all the packages necessary for the assembly (in this case for the assembly of codecs):

apt-get install libspeex-dev libgsm1-dev libopencore-amrnb-dev



After successful installation, you can begin to build Yate:

./configure; make; make install



Everything! The build is complete and we can begin setting up the server.



Part 2. Setup.



Setting up Asterisk, I did not quite understand its syntax. In Yate, everything turned out to be much simpler: the configuration files have the structure of INI files, everything is clearly divided into sections, a comment goes to each option. The default prefix for the installation is / usr / local, so go to the / usr / local / etc / yate folder, where we will need the following files:



Next in turn:



Part 2.1. Configure regfile.conf.


The regfile.conf file contains information about the users that are allowed to connect. It consists of the [general] section, in which the general settings are indicated, as well as of the sections with the user name. In order to add a new user, we only need to add the following lines:



[username]

password=secret




Thus, if I want to connect as a user with the name 100 and the password secret, the file should have the following content (comments are omitted hereinafter):



[general]



[100]

password=secret




Part 2.2. Configure accfile.conf.


In my case, it was necessary to configure the ability to make outgoing calls through several providers. The accfile.conf file allows you to configure connections to other servers. Add the providers we need and get:



[sip1]

enabled=yes

protocol=sip

username=user1

password=secret1

registrar=sip1.server.net



[sip2]

enabled=yes

protocol=sip

username=user2

password=secret2

registrar=sip2.server.net




Part 2.3. Configuring regexroute.conf.


Despite the fact that the server can already work, we still need to register routes for outgoing calls, as well as (if necessary) for incoming calls. For those who have already worked with regular expressions, it will be quite simple. The regexroute.conf structure allows us to determine through which provider to make calls, as well as where to direct incoming calls. Here I needed the following: if the number starts from 00, then you should send calls through the first provider, if 01 - through the second. Incoming calls should all be directed to the number 100. As a result, the following has turned out:



[priorities]



[$once]



[$init]



[extra]



[contexts]



[default]

;

^99991001$=tone/dial

^99991002$=tone/busy

^99991003$=tone/ring

^99991004$=tone/specdial

^99991005$=tone/congestion

^99991006$=tone/outoforder

^99991007$=tone/milliwatt

^99991008$=tone/info



; 00< >,

^00\(.*\)$=sip/sip:\1;line=sip1

; 01< >,

^01\(.*\)$=sip/sip:\1;line=sip2

; ,

^sip1$=route/100

^sip2$=route/100




Part 3. Starting the server.



The server is started by simply typing:

yate -d



If we want to see the entire debug output, then we can simply run:

yate -vvvvvvvvvv



Everything! Now you can register as a SIP client and call :)



Part 4. Results. Advantages and disadvantages.



Thus, people even unfamiliar with telephony can set up their own server. Sorry, only the server documentation is too small.



pros




Minuses






Despite all the disadvantages, authors can almost always be found on their IRC channel. There is also a mailing list in which you can ask all your questions. Plus, all the same documentation, albeit incomplete, but on the site is present.



PS> my first article, if there are comments / suggestions, I’ll be happy to hear them

PPS> also if there are questions on Yate, I will try to help with what I can :)

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



All Articles