Good afternoon, evening or night, it all depends on the time of day in 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 there was a question why I didn’t create a deb package, I’ll say directly - there was no such task. But still I decided to go deep and solve this problem. I will not describe the installation of Ubuntu server 16.04, I’ll only focus on the main thing.
')
Initial data:
- Ubuntu server 16.04 minimal, Memory 1Gb, Disk 64 Gb, uses EFI, server virtualization ESXi 6.5;
- Asterisk 15.0.0 in source code;
- All add-ons from repositories.
Creating deb of asterisk 15.0.0 package:
1. Install the build dependencies:
sudo apt install libiksemel-utils lame sox mpg123 pkg-config automake libtool autoconf git subversion xmlstarlet checkinstall
2. Download Asterisk sources:
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 sources:
contrib/scripts/get_mp3_source.sh
Asterisk itself downloads the files it needs.
4. Prepare the system for building Asterisk:
contrib/scripts/install_prereq install
5. Configuring the source:
./configure
If the system already has a pjproject, then use:
./configure
6. Assemble 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
For Asterisk to work, the package libjansson4, libxslt1-dev is needed, add them depending, clause 10.
8. I needed to change the package, include the necessary directories and files for full-fledged work with FreePBX:
dpkg-deb -x asterisk_15.0.0-1_amd64.deb asterisk
I added the / etc / aserisk directories, / var / spool / asterisk and the / etc / default / asterisk file
If you forgot to add dependencies, then:
dpkg-deb -e asterisk_15.0.0-1_amd64.deb asterisk/DEBIAN
Putting it all up with a team:
fakeroot dpkg -b asterisk/ .
The package is created, I will not describe how to create a local repository, articles are habrahabr.ru.
PS The assembled package is not installed on the system where it was built, the problem is in the dependencies installed for the assembly. On another machine gets up without problems. If you have an installation error, then there are no dependent packages in the system.