VoIP server for a small company (FreePBX 14, Asterisk 15, Ubuntu 16.04) part 2

    Good afternoon, evening or night, it all depends on the time of day at which you happened to read my article.

    Continuation of the article VoIP Server for a Small Company (FreePBX 14, Asterisk 15, Ubuntu 16.04) Part 1 .

    In the comments, the question arose, why I did not create a deb package, I will say directly - there was no such task. But still I decided to go deeper and solve this problem. I will not describe the installation of Ubuntu server 16.04, I will focus only on the main thing.

    Initial data:

    • Ubuntu server 16.04 minimal, Memory 1Gb, Disk 64 Gb, uses EFI, ESXi 6.5 virtualization server;
    • Asterisk 15.0.0 in source
    • All additions from repositories.

    Creating asterisk deb package 15.0.0:

    1. Install the dependencies for the assembly:

    sudo apt install libiksemel-utils lame sox mpg123 pkg-config automake libtool autoconf git subversion xmlstarlet checkinstall

    2. Download the sources of Asterisk:

    cd /usr/local/sbin
    wget wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-15-current.tar.gz
    tar zxvf ./asterisk-15-current.tar.gz
    cd ./asterisk-15*
    

    3. Add to mp3 source:

    contrib/scripts/get_mp3_source.sh

    Asterisk itself will download the files it needs.

    4. Prepare the system for assembling Asterisk:

    contrib/scripts/install_prereq install

    5. Configure the sources:

    ./configure --with-pjproject

    If the system already has pjproject, then use:

    ./configure --with-pjproject-bundled

    6. We collect Asterisk:

    make menuselect
    make

    Here, at my discretion, I chose 'format_mp3' and 'res_config_mysql'.

    7. Create a deb package with the command:

    checkinstall

    Asterisk requires the package libjansson4, libxslt1-dev, add them depending on point 10.

    8. I needed to change the package, include the directories and files necessary for full work with FreePBX:

    dpkg-deb -x  asterisk_15.0.0-1_amd64.deb asterisk

    I added the directories / etc / aserisk, / var / spool / asterisk and the file / etc / default / asterisk.

    If you forgot to add dependencies then:

    dpkg-deb -e asterisk_15.0.0-1_amd64.deb asterisk/DEBIAN

    Putting it all together:

    fakeroot dpkg -b asterisk/ .

    The package was created, I will not describe how to create local repositories, there are articles on habrahabr.ru.

    PS The assembled package is not installed on the system where it was built, the problem is with the dependencies installed for the assembly. On another machine it gets up without any problems. If you encounter an installation error, it means that there are no dependent packages in the system.

    Also popular now: