How to install Asterisk 20 LTS on Debian 11.4
To Install Asterisk 20 LTS On Debian 11.4
Introduction:
Asterisk is a complete telephony server that provides Private Branch Exchange (PBX), Interactive Voice Response (IVR), Automated Call Distribution (ACD), Voice over IP (VoIP) gatewaying, Conferencing, and a wide variety of other telephony applications to a broad range of telephony devices including packet voice devices.
Installation Procedure:
Step 1: Check the OS version by using the below command
root@debian:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Step 2: Change the directory by using the below command
root@debian:~# cd /usr/src/
Step 3: Download the Asterisk by using the below command
root@debian:/usr/src# curl -O http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 26.8M 100 26.8M 0 0 2917k 0 0:00:09 0:00:09 --:--:-- 3749k
Step 4: Extract the downloaded file by using the below command
root@debian:/usr/src# tar xvf asterisk-20-current.tar.gz
asterisk-20.3.0/
asterisk-20.3.0/.cleancount
asterisk-20.3.0/.gitignore
asterisk-20.3.0/.lastclean
asterisk-20.3.0/.version
asterisk-20.3.0/BSDmakefile
asterisk-20.3.0/BUGS
asterisk-20.3.0/CHANGES.md
asterisk-20.3.0/COPYING
asterisk-20.3.0/CREDITS
asterisk-20.3.0/ChangeLogs/
asterisk-20.3.0/ChangeLogs/ChangeLog-20.3.0.md
asterisk-20.3.0/ChangeLogs/historical/
asterisk-20.3.0/ChangeLogs/historical/CHANGES
asterisk-20.3.0/ChangeLogs/historical/ChangeLog
asterisk-20.3.0/LICENSE
asterisk-20.3.0/Makefile
asterisk-20.3.0/Makefile.moddir_rules
asterisk-20.3.0/Makefile.rules
asterisk-20.3.0/README-SERIOUSLY.bestpractices.md
asterisk-20.3.0/README-addons.txt
asterisk-20.3.0/README.md
asterisk-20.3.0/SECURITY.md
asterisk-20.3.0/UPGRADE.txt
asterisk-20.3.0/Zaptel-to-DAHDI.txt
asterisk-20.3.0/addons/
asterisk-20.3.0/addons/.gitignore
asterisk-20.3.0/addons/Makefile
asterisk-20.3.0/addons/chan_mobile.c
asterisk-20.3.0/addons/chan_ooh323.c
asterisk-20.3.0/addons/chan_ooh323.h
asterisk-20.3.0/addons/format_mp3.c
asterisk-20.3.0/addons/ooh323c/
asterisk-20.3.0/addons/ooh323c/COPYING
asterisk-20.3.0/addons/ooh323c/README
asterisk-20.3.0/addons/ooh323c/src/
asterisk-20.3.0/addons/ooh323c/src/Makefile.in
asterisk-20.3.0/addons/ooh323c/src/context.c
asterisk-20.3.0/addons/ooh323c/src/decode.c
asterisk-20.3.0/addons/ooh323c/src/dlist.c
asterisk-20.3.0/addons/ooh323c/src/dlist.h
asterisk-20.3.0/addons/ooh323c/src/encode.c
asterisk-20.3.0/addons/ooh323c/src/errmgmt.c
asterisk-20.3.0/addons/ooh323c/src/eventHandler.c
asterisk-20.3.0/addons/ooh323c/src/eventHandler.h
asterisk-20.3.0/addons/ooh323c/src/h323/
asterisk-20.3.0/addons/ooh323c/src/h323/H235-SECURITY-MESSAGES.h
asterisk-20.3.0/addons/ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c
asterisk-20.3.0/addons/ooh323c/src/h323/H235-SECURITY-MESSAGESEnc.c
asterisk-20.3.0/addons/ooh323c/src/h323/H323-MESSAGES.c
asterisk-20.3.0/addons/ooh323c/src/h323/H323-MESSAGES.h
asterisk-20.3.0/addons/ooh323c/src/h323/H323-MESSAGESDec.c
asterisk-20.3.0/addons/ooh323c/src/h323/H323-MESSAGESEnc.c
asterisk-20.3.0/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROL.c
asterisk-20.3.0/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROL.h
asterisk-20.3.0/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c
asterisk-20.3.0/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLEnc.c
Step 5: Change the directory to the “asterisk-20.4.0” by using the below command
root@debian:/usr/src# cd asterisk-20.3.0/
Step 6: Next long list the directory by using the below command
root@debian:/usr/src/asterisk-20.3.0# ls -la
total 1608
drwxrwxr-x 32 root root 4096 May 23 09:31 .
drwxr-xr-x 3 root root 4096 Jun 29 01:57 ..
drwxrwxr-x 3 root root 4096 May 23 09:31 addons
drwxrwxr-x 2 root root 4096 May 23 09:31 agi
drwxrwxr-x 3 root root 4096 May 23 09:31 apps
drwxrwxr-x 2 root root 4096 May 23 09:31 autoconf
-rwxrwxr-x 1 root root 761 May 23 09:31 bootstrap.sh
drwxrwxr-x 3 root root 4096 May 23 09:31 bridges
-rw-rw-r-- 1 root root 294 May 23 09:31 BSDmakefile
-rw-rw-r-- 1 root root 598 May 23 09:31 BUGS
drwxrwxr-x 2 root root 4096 May 23 09:31 build_tools
drwxrwxr-x 2 root root 4096 May 23 09:31 cdr
drwxrwxr-x 2 root root 4096 May 23 09:31 cel
drwxrwxr-x 3 root root 4096 May 23 09:31 ChangeLogs
lrwxrwxrwx 1 root root 30 May 23 09:31 CHANGES.md -> ChangeLogs/ChangeLog-20.3.0.md
drwxrwxr-x 6 root root 4096 May 23 09:31 channels
-rw-rw-r-- 1 root root 3 May 23 09:31 .cleancount
drwxrwxr-x 7 root root 4096 May 23 09:31 codecs
-rwxrwxr-x 1 root root 44169 May 23 09:31 config.guess
drwxrwxr-x 4 root root 4096 May 23 09:31 configs
-rwxrwxr-x 1 root root 31467 May 23 09:31 config.sub
-rwxrwxr-x 1 root root 962301 May 23 09:31 configure
-rw-rw-r-- 1 root root 102993 May 23 09:31 configure.ac
drwxrwxr-x 13 root root 4096 May 23 09:31 contrib
-rw-rw-r-- 1 root root 17986 May 23 09:31 COPYING
-rw-rw-r-- 1 root root 12913 May 23 09:31 CREDITS
-rw-rw-r-- 1 root root 126 May 23 09:31 default.exports
drwxrwxr-x 5 root root 4096 May 23 09:31 doc
drwxrwxr-x 2 root root 4096 May 23 09:31 formats
drwxrwxr-x 2 root root 4096 May 23 09:31 funcs
-rw-rw-r-- 1 root root 590 May 23 09:31 .gitignore
drwxrwxr-x 2 root root 4096 May 23 09:31 images
drwxrwxr-x 4 root root 4096 May 23 09:31 include
-rwxrwxr-x 1 root root 6397 May 23 09:31 install-sh
-rw-rw-r-- 1 root root 3 May 23 09:31 .lastclean
-rw-rw-r-- 1 root root 3029 May 23 09:31 LICENSE
drwxrwxr-x 3 root root 4096 May 23 09:31 main
-rw-rw-r-- 1 root root 43288 May 23 09:31 Makefile
-rw-rw-r-- 1 root root 5939 May 23 09:31 Makefile.moddir_rules
-rw-rw-r-- 1 root root 7611 May 23 09:31 Makefile.rules
-rw-rw-r-- 1 root root 7353 May 23 09:31 makeopts.in
drwxrwxr-x 4 root root 4096 May 23 09:31 menuselect
-rwxrwxr-x 1 root root 6480 May 23 09:31 missing
-rwxrwxr-x 1 root root 671 May 23 09:31 mkinstalldirs
drwxrwxr-x 3 root root 4096 May 23 09:31 pbx
drwxrwxr-x 2 root root 4096 May 23 09:31 phoneprov
-rw-rw-r-- 1 root root 1575 May 23 09:31 README-addons.txt
-rw-rw-r-- 1 root root 11231 May 23 09:31 README.md
-rw-rw-r-- 1 root root 16626 May 23 09:31 README-SERIOUSLY.bestpractices.md
drwxrwxr-x 15 root root 12288 May 23 09:31 res
drwxrwxr-x 3 root root 4096 May 23 09:31 rest-api
drwxrwxr-x 2 root root 4096 May 23 09:31 rest-api-templates
-rw-rw-r-- 1 root root 2720 May 23 09:31 sample.call
-rw-rw-r-- 1 root root 521 May 23 09:31 SECURITY.md
drwxrwxr-x 2 root root 4096 Jun 29 01:57 sounds
drwxrwxr-x 2 root root 4096 May 23 09:31 static-http
drwxrwxr-x 4 root root 4096 May 23 09:31 tests
drwxrwxr-x 4 root root 4096 May 23 09:31 third-party
-rw-rw-r-- 1 root root 144755 May 23 09:31 UPGRADE.txt
drwxrwxr-x 3 root root 4096 May 23 09:31 utils
-rw-rw-r-- 1 root root 7 May 23 09:31 .version
-rw-rw-r-- 1 root root 1803 May 23 09:31 Zaptel-to-DAHDI.txt
Step 7: Update the apt source list by using the below command
root@debian:/usr/src/asterisk-20.3.0#apt update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Step 8: Install the dependencies by using the below command
root@debian:/usr/src/asterisk-20.3.0# contrib/scripts/install_prereq install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
dbconfig-common dbconfig-mysql default-mysql-client galera-4 icc-profiles-free
libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl
libdbd-mariadb-perl libdbi-perl libfcgi-bin libfcgi-perl libfcgi0ldbl
libhtml-template-perl libjs-bootstrap4 libjs-codemirror libjs-jquery
libjs-jquery-mousewheel libjs-jquery-timepicker libjs-jquery-ui libjs-openlayers
libjs-popper.js libjs-sizzle libjs-sphinxdoc libjs-underscore libmariadb3 libonig5
libopengl0 libterm-readkey-perl libzip4 mariadb-client-10.5
mariadb-client-core-10.5 mariadb-common mariadb-server-10.5
mariadb-server-core-10.5 mysql-common node-jquery rsync socat
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
aptitude-common libcwidget4
Suggested packages:
apt-xapian-index aptitude-doc-en | aptitude-doc debtags libcwidget-dev
The following NEW packages will be installed:
aptitude aptitude-common libcwidget4
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,441 kB of archives.
After this operation, 15.9 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 aptitude-common all 0.8.13-3 [1,776 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libcwidget4 amd64 0.5.18-5 [315 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 aptitude amd64 0.8.13-3 [1,349 kB]
Fetched 3,441 kB in 1s (5,305 kB/s)
Selecting previously unselected package aptitude-common.
(Reading database ... 146886 files and directories currently installed.)
Preparing to unpack .../aptitude-common_0.8.13-3_all.deb ...
Unpacking aptitude-common (0.8.13-3) ...
Selecting previously unselected package libcwidget4:amd64.
Preparing to unpack .../libcwidget4_0.5.18-5_amd64.deb ...
Unpacking libcwidget4:amd64 (0.5.18-5) ...
Selecting previously unselected package aptitude.
Preparing to unpack .../aptitude_0.8.13-3_amd64.deb ...
Unpacking aptitude (0.8.13-3) ...
Setting up libcwidget4:amd64 (0.5.18-5) ...
Setting up aptitude-common (0.8.13-3) ...
Setting up aptitude (0.8.13-3) ...
#############################################
## install completed successfully
#############################################
Step 9: Download the mp3 decoder library into the source tree by using the below command
root@debian:/usr/src/asterisk-20.3.0# contrib/scripts/get_mp3_source.sh
A addons/mp3
A addons/mp3/MPGLIB_README
A addons/mp3/common.c
A addons/mp3/huffman.h
A addons/mp3/tabinit.c
A addons/mp3/Makefile
A addons/mp3/README
A addons/mp3/decode_i386.c
A addons/mp3/dct64_i386.c
A addons/mp3/MPGLIB_TODO
A addons/mp3/mpg123.h
A addons/mp3/layer3.c
A addons/mp3/mpglib.h
A addons/mp3/decode_ntom.c
A addons/mp3/interface.c
Exported revision 204.
Step 10: Run the configure script to build the dependencies by using the below command
root@debian:/usr/src/asterisk-20.3.0# ./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
configure: creating ./config.status
config.status: creating makeopts
config.status: creating autoconfig.h
configure: Menuselect build configuration successfully completed
.$$$$$$$$$$$$$$$=..
.$7$7.. .7$$7:.
.$$:. ,$7.7
.$7. 7$$$$ .$$77
..$$. $$$$$ .$$$7
..7$ .?. $$$$$ .?. 7$$$.
$.$. .$$$7. $$$$7 .7$$$. .$$$.
.777. .$$$$$$77$$$77$$$$$7. $$$,
$$$~ .7$$$$$$$$$$$$$7. .$$$.
.$$7 .7$$$$$$$7: ?$$$.
$$$ ?7$$$$$$$$$$I .$$$7
$$$ .7$$$$$$$$$$$$$$$$ :$$$.
$$$ $$$$$$7$$$$$$$$$$$$ .$$$.
$$$ $$$ 7$$$7 .$$$ .$$$.
$$$$ $$$$7 .$$$.
7$$$7 7$$$$ 7$$$
$$$$$ $$$
$$$$7. $$ (TM)
$$$$$$$. .7$$$$$$ $$
$$$$$$$$$$$$7$$$$$$$$$.$$$$$$
$$$$$$$$$$$$$$$$.
configure: Package configured for:
configure: OS type : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :
Step 11: Setup the Menu option by using the below command
root@debian:/usr/src/asterisk-20.3.0# make menuselect
CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" cmenuselect
make[1]: Entering directory '/usr/src/asterisk-20.3.0/menuselect'
gcc -g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations -DHAVE_NCURSES -I/usr/include/libxml2 -c -o menuselect.o menuselect.c
gcc -g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations -DHAVE_NCURSES -c -o strcompat.o strcompat.c
gcc -g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations -DHAVE_NCURSES -c -o menuselect_curses.o menuselect_curses.c
gcc -o cmenuselect menuselect.o strcompat.o menuselect_curses.o -lncurses -ltinfo -L/usr/lib/x86_64-linux-gnu -lxml2
make[1]: Leaving directory '/usr/src/asterisk-20.3.0/menuselect'
CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" nmenuselect
make[1]: Entering directory '/usr/src/asterisk-20.3.0/menuselect'
gcc -g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations -DHAVE_NCURSES -c -o menuselect_newt.o menuselect_newt.c
gcc -o nmenuselect menuselect.o strcompat.o menuselect_newt.o -lnewt -L/usr/lib/x86_64-linux-gnu -lxml2
make[1]: Leaving directory '/usr/src/asterisk-20.3.0/menuselect'
CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" gmenuselect
make[1]: Entering directory '/usr/src/asterisk-20.3.0/menuselect'
make[1]: Nothing to be done for 'gmenuselect'.
make[1]: Leaving directory '/usr/src/asterisk-20.3.0/menuselect'
make[1]: Entering directory '/usr/src/asterisk-20.3.0'
Generating input for menuselect ...
Step 12: Mark the chan_ooh and format_mp3 on ADD-ons as shown in the below image
Step 13: Select the Audio format packages on core sound packages as shown in the below image
Step 14: Select the Minimal Modules on Music on Hold as shown in the below image
Step 15: Select the following packages on Extra sound packages as shown in the below image
Step 16: Select the app_macro on Applications as shown in the below image
Step 17: Build Asterisk by running make by using the below command
root@debian:/usr/src/asterisk-20.3.0# make
[CC] astcanary.c -> astcanary.o
[LD] astcanary.o -> astcanary
[CC] astdb2sqlite3.c -> astdb2sqlite3.o
[CC] hash/hash.c -> hash/hash.o
[CC] hash/hash_bigkey.c -> hash/hash_bigkey.o
[CC] hash/hash_buf.c -> hash/hash_buf.o
[CC] hash/hash_func.c -> hash/hash_func.o
[CC] hash/hash_log2.c -> hash/hash_log2.o
[CC] hash/hash_page.c -> hash/hash_page.o
[CC] hash/ndbm.c -> hash/ndbm.o
[CC] btree/bt_close.c -> btree/bt_close.o
[CC] btree/bt_conv.c -> btree/bt_conv.o
[CC] btree/bt_debug.c -> btree/bt_debug.o
[CC] btree/bt_delete.c -> btree/bt_delete.o
[CC] btree/bt_get.c -> btree/bt_get.o
[CC] btree/bt_open.c -> btree/bt_open.o
[CC] btree/bt_overflow.c -> btree/bt_overflow.o
[CC] btree/bt_page.c -> btree/bt_page.o
[CC] btree/bt_put.c -> btree/bt_put.o
[CC] btree/bt_search.c -> btree/bt_search.o
[CC] btree/bt_seq.c -> btree/bt_seq.o
[CC] btree/bt_split.c -> btree/bt_split.o
[CC] btree/bt_utils.c -> btree/bt_utils.o
[CC] db/db.c -> db/db.o
[CC] mpool/mpool.c -> mpool/mpool.o
[CC] recno/rec_close.c -> recno/rec_close.o
[CC] recno/rec_delete.c -> recno/rec_delete.o
[CC] recno/rec_get.c -> recno/rec_get.o
[CC] recno/rec_open.c -> recno/rec_open.o
[CC] recno/rec_put.c -> recno/rec_put.o
[CC] recno/rec_search.c -> recno/rec_search.o
[CC] recno/rec_seq.c -> recno/rec_seq.o
[CC] recno/rec_utils.c -> recno/rec_utils.o
[AR] hash/hash.o hash/hash_bigkey.o hash/hash_buf.o hash/hash_func.o hash/hash_log2.o hash/hash_page.o hash/ndbm.o btree/bt_close.o btree/bt_conv.o btree/bt_debug.o btree/bt_delete.o btree/bt_get.o btree/bt_open.o btree/bt_overflow.o btree/bt_page.o btree/bt_put.o btree/bt_search.o btree/bt_seq.o btree/bt_split.o btree/bt_utils.o db/db.o mpool/mpool.o recno/rec_close.o recno/rec_delete.o recno/rec_get.o recno/rec_open.o recno/rec_put.o recno/rec_search.o recno/rec_seq.o recno/rec_utils.o -> libdb1.a
[LD] astdb2sqlite3.o db1-ast/libdb1.a -> astdb2sqlite3
[CC] astdb2bdb.c -> astdb2bdb.o
[LD] astdb2bdb.o db1-ast/libdb1.a -> astdb2bdb
[pjproject] Compiling libpj-x86_64-unknown-linux-gnu.a
+--------- Asterisk Build Complete ----------+
+ Asterisk has successfully been built, and +
+ can be installed by running: +
+ +
+ make install +
+--------------------------------------------------+
Step 18: After build run make to install Asterisk by using the below command
root@debian:/usr/src/asterisk-20.3.0# make install
Installing modules from channels...
Installing modules from pbx...
Installing modules from apps...
Installing modules from codecs...
Installing modules from formats...
Installing modules from cdr...
Installing modules from cel...
Installing modules from bridges...
Installing modules from funcs...
Installing modules from tests...
Installing modules from main...
Installing modules from res...
Installing modules from addons...
/usr/bin/install -c -m 755 contrib/scripts/astversion "/usr/sbin/"
/usr/bin/install -c -m 755 contrib/scripts/astgenkey "/usr/sbin/"
/usr/bin/install -c -m 755 contrib/scripts/autosupport "/usr/sbin/"
./build_tools/install_subst contrib/scripts/safe_asterisk "/usr/sbin/safe_asterisk";
/usr/bin/install -c -m 644 doc/core-*.xml "/var/lib/asterisk/documentation"
/usr/bin/install -c -m 644 doc/appdocsxml.xslt "/var/lib/asterisk/documentation"
/usr/bin/install -c -m 644 doc/appdocsxml.dtd "/var/lib/asterisk/documentation"
/usr/bin/install -c -m 644 doc/asterisk.8 "/usr/share/man/man8"
/usr/bin/install -c -m 644 doc/astdb*.8 "/usr/share/man/man8"
/usr/bin/install -c -m 644 contrib/scripts/astgenkey.8 "/usr/share/man/man8"
/usr/bin/install -c -m 644 contrib/scripts/autosupport.8 "/usr/share/man/man8"
/usr/bin/install -c -m 644 contrib/scripts/safe_asterisk.8 "/usr/share/man/man8"
if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
/usr/bin/install -c -m 644 contrib/firmware/iax/iaxy.bin "/var/lib/asterisk/firmware/iax/iaxy.bin"; \
fi
CFLAGS=" -I/usr/include/libxml2 -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 " build_tools/mkpkgconfig "/usr/lib/pkgconfig";
find static-http | while read x; do \
if test -d $x; then \
/usr/bin/install -c -m 755 -d "/var/lib/asterisk/$x"; \
else \
/usr/bin/install -c -m 644 $x "/var/lib/asterisk/$x" ; \
fi \
done
/usr/bin/install -c -m 644 doc/core-en_US.xml "/var/lib/asterisk/static-http";
/usr/bin/install -c -m 644 doc/appdocsxml.xslt "/var/lib/asterisk/static-http";
if [ -d doc/tex/asterisk ] ; then \
/usr/bin/install -c -d "/var/lib/asterisk/static-http/docs" ; \
for n in doc/tex/asterisk/* ; do \
/usr/bin/install -c -m 644 $n "/var/lib/asterisk/static-http/docs" ; \
done \
fi
for x in images/*.jpg; do \
/usr/bin/install -c -m 644 $x "/var/lib/asterisk/images" ; \
done
make -C sounds install
make[1]: Entering directory '/usr/src/asterisk-20.3.0/sounds'
--2023-06-29 02:47:06-- http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en_AU-wav-1.6.1.tar.gz
Resolving downloads.asterisk.org (downloads.asterisk.org)... 165.22.184.19, 2604:a880:400:d0::14:9001
Connecting to downloads.asterisk.org (downloads.asterisk.org)|165.22.184.19|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13048433 (12M) [application/octet-stream]
Saving to: ‘asterisk-core-sounds-en_AU-wav-1.6.1.tar.gz’
asterisk-core-sounds- 100%[=======================>] 12.44M 2.11MB/s in 6.9s
2023-06-29 02:47:13 (1.80 MB/s) - ‘asterisk-core-sounds-en_AU-wav-1.6.1.tar.gz’ saved [13048433/13048433]
--2023-06-29 02:47:14-- http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-en-g729-1.5.2.tar.gz
Resolving downloads.asterisk.org (downloads.asterisk.org)... 165.22.184.19, 2604:a880:400:d0::14:9001
Connecting to downloads.asterisk.org (downloads.asterisk.org)|165.22.184.19|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2663681 (2.5M) [application/octet-stream]
Saving to: ‘asterisk-extra-sounds-en-g729-1.5.2.tar.gz’
asterisk-extra-sounds 100%[=======================>] 2.54M 1.27MB/s in 2.0s
2023-06-29 02:47:17 (1.27 MB/s) - ‘asterisk-extra-sounds-en-g729-1.5.2.tar.gz’ saved [2663681/2663681]
--2023-06-29 02:47:17-- http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-g729-2.03.tar.gz
Resolving downloads.asterisk.org (downloads.asterisk.org)... 165.22.184.19, 2604:a880:400:d0::14:9001
Connecting to downloads.asterisk.org (downloads.asterisk.org)|165.22.184.19|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1103000 (1.1M) [application/octet-stream]
Saving to: ‘asterisk-moh-opsound-g729-2.03.tar.gz’
asterisk-moh-opsound- 100%[=======================>] 1.05M 643KB/s in 1.7s
2023-06-29 02:47:20 (643 KB/s) - ‘asterisk-moh-opsound-g729-2.03.tar.gz’ saved [1103000/1103000]
make[1]: Leaving directory '/usr/src/asterisk-20.3.0/sounds'
find rest-api -name "*.json" | while read x; do \
/usr/bin/install -c -m 644 $x "/var/lib/asterisk/rest-api" ; \
done
+---- Asterisk Installation Complete -------+
+ +
+ YOU MUST READ THE SECURITY DOCUMENT +
+ +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ +
+ For generic reference documentation: +
+ make samples +
+ +
+ For a sample basic PBX: +
+ make basic-pbx +
+ +
+ +
+----------------- or ---------------------+
+ +
+ You can go ahead and install the asterisk +
+ program documentation now or later run: +
+ +
+ make progdocs +
+ +
+ **Note** This requires that you have +
+ doxygen installed on your local system +
+-------------------------------------------+
Step 19: Install the samples by using the below command
root@debian:/usr/src/asterisk-20.3.0# make samples
Installing adsi config files...
/usr/bin/install -c -d "/etc/asterisk"
Installing configs/samples/asterisk.adsi
Installing configs/samples/telcordia-1.adsi
Installing other config files...
Installing file configs/samples/acl.conf.sample
Installing file configs/samples/adsi.conf.sample
Installing file configs/samples/aeap.conf.sample
Installing file configs/samples/agents.conf.sample
Installing file configs/samples/alarmreceiver.conf.sample
Installing file configs/samples/alsa.conf.sample
Installing file configs/samples/amd.conf.sample
Installing file configs/samples/app_skel.conf.sample
Installing file configs/samples/ari.conf.sample
Installing file configs/samples/ast_debug_tools.conf.sample
Installing file configs/samples/asterisk.conf.sample
Installing file configs/samples/calendar.conf.sample
Installing file configs/samples/ccss.conf.sample
Installing file configs/samples/cdr_adaptive_odbc.conf.sample
Installing file configs/samples/cdr_beanstalkd.conf.sample
Installing file configs/samples/cdr.conf.sample
Installing file configs/samples/cdr_custom.conf.sample
Installing file configs/samples/cdr_manager.conf.sample
Installing file configs/samples/cdr_odbc.conf.sample
Installing file configs/samples/cdr_pgsql.conf.sample
Installing file configs/samples/cdr_sqlite3_custom.conf.sample
Installing file configs/samples/cdr_tds.conf.sample
Installing file configs/samples/cel_beanstalkd.conf.sample
Installing file configs/samples/cel.conf.sample
Installing file configs/samples/cel_custom.conf.sample
Installing file configs/samples/cel_odbc.conf.sample
Installing file configs/samples/cel_pgsql.conf.sample
Installing file configs/samples/cel_sqlite3_custom.conf.sample
Installing file configs/samples/cel_tds.conf.sample
Installing file configs/samples/chan_dahdi.conf.sample
Installing file configs/samples/chan_mobile.conf.sample
Installing file configs/samples/cli_aliases.conf.sample
Installing file configs/samples/cli.conf.sample
Installing file configs/samples/cli_permissions.conf.sample
Installing file configs/samples/codecs.conf.sample
Installing file configs/samples/confbridge.conf.sample
Installing file configs/samples/config_test.conf.sample
Installing file configs/samples/console.conf.sample
Installing file configs/samples/dbsep.conf.sample
Installing file configs/samples/dnsmgr.conf.sample
Installing file configs/samples/dsp.conf.sample
Installing file configs/samples/dundi.conf.sample
Installing file configs/samples/enum.conf.sample
Installing file configs/samples/extconfig.conf.sample
Installing file configs/samples/extensions.ael.sample
Installing file configs/samples/extensions.conf.sample
Installing file configs/samples/extensions.lua.sample
Installing file configs/samples/extensions_minivm.conf.sample
Installing file configs/samples/features.conf.sample
Installing file configs/samples/festival.conf.sample
Installing file configs/samples/followme.conf.sample
Installing file configs/samples/func_odbc.conf.sample
Installing file configs/samples/geolocation.conf.sample
Installing file configs/samples/hep.conf.sample
Installing file configs/samples/http.conf.sample
Installing file configs/samples/iax.conf.sample
Installing file configs/samples/iaxprov.conf.sample
Installing file configs/samples/indications.conf.sample
Installing file configs/samples/logger.conf.sample
Installing file configs/samples/manager.conf.sample
Installing file configs/samples/meetme.conf.sample
Installing file configs/samples/mgcp.conf.sample
Installing file configs/samples/minivm.conf.sample
Installing file configs/samples/modules.conf.sample
Installing file configs/samples/motif.conf.sample
Installing file configs/samples/musiconhold.conf.sample
Installing file configs/samples/ooh323.conf.sample
Installing file configs/samples/osp.conf.sample
Installing file configs/samples/phoneprov.conf.sample
Installing file configs/samples/pjproject.conf.sample
Installing file configs/samples/pjsip.conf.sample
Installing file configs/samples/pjsip_notify.conf.sample
Installing file configs/samples/pjsip_wizard.conf.sample
Installing file configs/samples/prometheus.conf.sample
Installing file configs/samples/queuerules.conf.sample
Installing file configs/samples/queues.conf.sample
Installing file configs/samples/res_config_mysql.conf.sample
Installing file configs/samples/res_config_sqlite3.conf.sample
Installing file configs/samples/res_corosync.conf.sample
Installing file configs/samples/res_curl.conf.sample
Installing file configs/samples/res_fax.conf.sample
Installing file configs/samples/res_http_media_cache.conf.sample
Installing file configs/samples/res_ldap.conf.sample
Installing file configs/samples/res_odbc.conf.sample
Installing file configs/samples/resolver_unbound.conf.sample
Installing file configs/samples/res_parking.conf.sample
Installing file configs/samples/res_pgsql.conf.sample
Installing file configs/samples/res_pktccops.conf.sample
Installing file configs/samples/res_snmp.conf.sample
Installing file configs/samples/res_stun_monitor.conf.sample
Installing file configs/samples/rtp.conf.sample
Installing file configs/samples/say.conf.sample
Installing file configs/samples/sip.conf.sample
Installing file configs/samples/sip_notify.conf.sample
Installing file configs/samples/skinny.conf.sample
Installing file configs/samples/sla.conf.sample
Installing file configs/samples/smdi.conf.sample
Installing file configs/samples/sorcery.conf.sample
Installing file configs/samples/ss7.timers.sample
Installing file configs/samples/stasis.conf.sample
Installing file configs/samples/statsd.conf.sample
Installing file configs/samples/stir_shaken.conf.sample
Installing file configs/samples/test_sorcery.conf.sample
Installing file configs/samples/udptl.conf.sample
Installing file configs/samples/unistim.conf.sample
Installing file configs/samples/users.conf.sample
Installing file configs/samples/voicemail.conf.sample
Installing file configs/samples/xmpp.conf.sample
Updating asterisk.conf
/usr/bin/install -c -d "/var/spool/asterisk/voicemail/default/1234/INBOX"
build_tools/make_sample_voicemail "//var/lib/asterisk" "//var/spool/asterisk"
Installing file phoneprov/000000000000.cfg
Installing file phoneprov/000000000000-directory.xml
Installing file phoneprov/000000000000-phone.cfg
Installing file phoneprov/polycom_line.xml
Installing file phoneprov/polycom.xml
Installing file phoneprov/snom-mac.xml
Step 20: Install the configs by using the below command
root@debian:/usr/src/asterisk-20.3.0# make config
Step 21: ldconfig creates the necessary links and cache to the most recent shared libraries found
root@debian:/usr/src/asterisk-20.3.0# ldconfig
Step 22: Create a group as asterisk by using the below command
root@debian:/usr/src/asterisk-20.3.0# groupadd asterisk
Step 23: Create a user as asterisk and adding to the group asterisk by using the below command
root@debian:/usr/src/asterisk-20.3.0# useradd -r -d /var/lib/asterisk -g asterisk asterisk
Step 24: Add asterisk user to the some more groups by using the below command
root@debian:/usr/src/asterisk-20.3.0# usermod -aG audio,dialout asterisk
Step 25: Change the ownership as asterisk for the following directories
root@debian:/usr/src/asterisk-20.3.0# chown -R asterisk.asterisk /etc/asterisk
root@debian:/usr/src/asterisk-20.3.0# chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
root@debian:/usr/src/asterisk-20.3.0# chown -R asterisk.asterisk /usr/lib/asterisk
Step 26: Set default user as asterisk by using the below command
root@debian:/usr/src/asterisk-20.3.0# vim /etc/default/asterisk
# Startup configuration for the Asterisk daemon
# Uncomment the following and set them to the user/groups that you
# want to run Asterisk as. NOTE: this requires substantial work to
# be sure that Asterisk's environment has permission to write the
# files required for its operation, including logs, its comm
# socket, the asterisk database, etc.
AST_USER="asterisk"
AST_GROUP="asterisk"
# If you DON'T want Asterisk to start up with terminal colors, comment
# this out.
COLOR=yes
# If you want Asterisk to run with a non-default configuration file,
# uncomment the following option, and set the value appropriately.
#ALTCONF=/etc/asterisk/asterisk.conf
# In the case of a crash, Asterisk may create a core file. Uncomment
# if you want this behavior.
#COREDUMP=yes
# Asterisk may establish a maximum load average for the system. This
# may be useful to prevent a flood of calls from taking down the system.
#MAXLOAD=4
# Or, if you'd prefer, you can limit the maximum number of calls.
#MAXCALLS=1000
# Default console verbosity. This may be raised or lowered on the console.
# Note this is analogous to the -v command line switch, which by default
# will cause Asterisk to start in console mode and run in the foreground,
# unless the always fork (-F) option is also provided.
#VERBOSITY=3
# Enable internal timing if the DAHDI timer is available. The default
# behaviour is that outbound packets are phase locked to inbound packets.
# Enabling this option causes them to be locked to the internal DAHDI
# timer instead.
#INTERNALTIMING=yes
# Start all recordings into a temporary directory, before moving them to
# their final location.
#TEMPRECORDINGLOCATION=yes
Step 27: Set the Asterisk conf will run as asterisk user by using the below command
root@debian:/usr/src/asterisk-20.3.0# vim /etc/asterisk/asterisk.conf
[directories](!)
astcachedir => /var/cache/asterisk
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
[options]
;verbose = 3
;debug = 3
;trace = 0 ; Set the trace level.
;refdebug = yes ; Enable reference count debug logging.
;alwaysfork = yes ; Same as -F at startup.
;nofork = yes ; Same as -f at startup.
;quiet = yes ; Same as -q at startup.
;timestamp = yes ; Same as -T at startup.
;execincludes = yes ; Support #exec in config files.
;console = yes ; Run as console (same as -c at startup).
;highpriority = yes ; Run realtime priority (same as -p at
; startup).
;initcrypto = yes ; Initialize crypto keys (same as -i at
; startup).
;nocolor = yes ; Disable console colors.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
;languageprefix = yes ; Use the new sound prefix path syntax.
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
; uses 'localhost' on failure, or systemname if
; set.
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
; If we get shorter DTMF messages, these will be
; changed to the minimum duration
;maxcalls = 10 ; Maximum amount of calls allowed.
;maxload = 0.9 ; Asterisk stops accepting new calls if the
; load average exceed this limit.
;maxfiles = 1000 ; Maximum amount of openfiles.
;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if
; the amount of free memory falls below this
; watermark.
;cache_media_frames = yes ; Cache media frames for performance
; Disable this option to help track down media frame
; mismanagement when using valgrind or MALLOC_DEBUG.
; The cache gets in the way of determining if the
; frame is used after being freed and who freed it.
; NOTE: This option has no effect when Asterisk is
; compiled with the LOW_MEMORY compile time option
; enabled because the cache code does not exist.
; Default yes
;cache_record_files = yes ; Cache recorded sound files to another
; directory during recording.
;record_cache_dir = /tmp ; Specify cache directory (used in conjunction
; with cache_record_files).
;transmit_silence = yes ; Transmit silence while a channel is in a
; waiting state, a recording only state, or
; when DTMF is being generated. Note that the
; silence internally is generated in raw signed
; linear format. This means that it must be
; transcoded into the native format of the
; channel before it can be sent to the device.
; It is for this reason that this is optional,
; as it may result in requiring a temporary
; codec translation path for a channel that may
; not otherwise require one.
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of
; directly.
runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.
;lightbackground = yes ; If your terminal is set for a light-colored
; background.
;forceblackbackground = yes ; Force the background of the terminal to be
; black, in order for terminal colors to show
; up properly.
;defaultlanguage = en ; Default language
documentation_language = en_US ; Set the language you want documentation
; displayed in. Value is in the same format as
; locale names.
;hideconnect = yes ; Hide messages displayed when a remote console
; connects and disconnects.
;lockconfdir = no ; Protect the directory containing the
; configuration files (/etc/asterisk) with a
; lock.
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
; macro - Invoke the stdexten using a macro as
; done by legacy Asterisk versions.
; gosub - Invoke the stdexten using a gosub as
; documented in extensions.conf.sample.
; Default gosub.
;live_dangerously = no ; Enable the execution of 'dangerous' dialplan
; functions and configuration file access from
; external sources (AMI, etc.) These functions
; (such as SHELL) are considered dangerous
; because they can allow privilege escalation.
; Configuration files are considered dangerous
; if they exist outside of the Asterisk
; configuration directory.
; Default no
;entityid=00:11:22:33:44:55 ; Entity ID.
; This is in the form of a MAC address.
; It should be universally unique.
; It must be unique between servers communicating
; with a protocol that uses this value.
; This is currently is used by DUNDi and
; Exchanging Device and Mailbox State
; using protocols: XMPP, Corosync and PJSIP.
;rtp_use_dynamic = yes ; When set to "yes" RTP dynamic payload types
; are assigned dynamically per RTP instance vs.
; allowing Asterisk to globally initialize them
; to pre-designated numbers (defaults to "yes").
;rtp_pt_dynamic = 35 ; Normally the Dynamic RTP Payload Type numbers
; are 96-127, which allow just 32 formats. The
; starting point 35 enables the range 35-63 and
; allows 29 additional formats. When you use
; more than 32 formats in the dynamic range and
; calls are not accepted by a remote
; implementation, please report this and go
; back to value 96.
;hide_messaging_ami_events = no; This option, if enabled, will
; suppress all of the Message/ast_msg_queue channel's
; housekeeping AMI and ARI channel events. This can
; reduce the load on the manager and ARI applications
; when the Digium Phone Module for Asterisk is in use.
; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl
Step 28: Restart the Asterisk service by using the below command
root@debian:/usr/src/asterisk-20.3.0# systemctl restart asterisk
Step 29: Enable the Asterisk service to start on boot by using the below command
root@debian:/usr/src/asterisk-20.3.0# systemctl enable asterisk
asterisk.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable asterisk
Step 30: Check the status of the Asterisk service by using the below command
root@debian:/usr/src/asterisk-20.3.0# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/init.d/asterisk; generated)
Active: active (running) since Thu 2023-06-29 07:16:51 CDT; 17s ago
Docs: man:systemd-sysv-generator(8)
Tasks: 80 (limit: 4623)
Memory: 60.5M
CPU: 2.767s
CGroup: /system.slice/asterisk.service
└─72780 /usr/sbin/asterisk -U asterisk -G asterisk
Jun 29 07:16:51 debian systemd[1]: Starting LSB: Asterisk PBX...
Jun 29 07:16:51 debian asterisk[72765]: Starting Asterisk PBX: asterisk.
Jun 29 07:16:51 debian systemd[1]: Started LSB: Asterisk PBX.
Jun 29 07:16:54 debian asterisk[72780]: radcli: rc_read_config: rc_read_config: can't>
Jun 29 07:16:54 debian asterisk[72780]: radcli: rc_read_config: rc_read_config: can't>
Step 31: Login to the Asterisk CLI by using the below command
root@debian:/usr/src/asterisk-20.3.0# asterisk -rvv
Asterisk 20.3.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Running as user 'asterisk'
Running under group 'asterisk'
Connected to Asterisk 20.3.0 currently running on debian (pid = 72780)
debian*CLI>
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to install Asterisk 20 LTS on Debian 11.4. Your feedback is much welcome.