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

    All around are discussing Asterisk and its forks, for large companies they suggest using Cisco or Avaya, but for some reason there is practically no information about Yate - a simple and convenient, but at the same time, very functional IP telephony solution.

    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. Assembly.


    Because Ubuntu is installed on the home computer, then the entire manual will be adapted exclusively for this OS, but, in general, it will not differ much 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 we load source codes and we proceed to actions.

    First you need to install all the packages you need to build (in this case, build codecs):
    apt-get install libspeex-dev libgsm1-dev libopencore-amrnb-dev

    After a successful installation, you can proceed to build Yate:
    ./configure; make; make install

    That's it! The assembly is completed and we can begin to configure the server.

    Part 2. Setup.


    Setting up Asterisk, I did not quite understand its syntax. Everything turned out to be much simpler in Yate: configuration files have the structure of INI files, everything is clearly divided into sections, there is a comment for each option. By default, the installation prefix is ​​/ usr / local, so go to the / usr / local / etc / yate folder, in which we will need the following files:
    • regfile.conf
    • accfile.conf
    • regexroute.conf

    Next in turn:

    Part 2.1. Configuring regfile.conf.

    The regfile.conf file contains information about users who are allowed to connect. It consists of the [general] section, in which the general settings are indicated, as well as sections with the user name. In order to add a new user, we only need to add the following lines: Thus, if I want to connect as a user with the name 100 and password secret, the file should have the following content (comments are omitted hereinafter):

    [username]
    password=secret




    [general]

    [100]
    password=secret


    Part 2.2. Configuring accfile.conf.

    In my case, it was necessary to configure the possibility of 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. Configure regexroute.conf.

    Despite the fact that the server can already work, we still need to prescribe routes for outgoing calls, as well as (if necessary) for incoming calls. For those who have already worked with regular expressions, this will be quite simple. The regexroute.conf structure allows us to determine through which provider to make calls, as well as where to send incoming calls. Here I needed the following: if the number starts at 00, then you should send calls through the first provider, if 01 - through the second. All incoming calls should be directed to number 100. As a result, the following 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 launched by simple input:
    yate -d

    If we want to see the entire debug-output, then we can simply start:
    yate -vvvvvvvvvv

    That's it! Now you can register as a SIP client and make calls :)

    Part 4. Results. Pros and cons.


    Thus, people even unfamiliar with telephony can set up their own server. It’s a pity, only the server documentation is too small.

    pros

    • easy setup
    • low resource consumption (with 4 clients uses only 5 MB of RAM)
    • ability to serve a large number of customers (according to the authors, up to 10,000)
    • functionality

    Minuses

    • little documentation
    • lack of SIP support over TCP / TLS
    • low-functional telnet interface


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

    PS> my first article, if there are comments / suggestions, I will gladly listen to them
    PPS> also if there are questions about Yate, I will try to help than I can :)

    Also popular now: