在Ubuntu下面需要安装

apt install libncurses5-dev uuid-dev libjansson-dev libxml2-dev libsqlite3-dev

去官网下载包https://www.asterisk.org/downloads

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-15-current.tar.gz

./configure

checking for curses.h... (cached) yes
checking for a sed that does not truncate output... /bin/sed
checking for xml2-config... /usr/bin/xml2-config
checking for pkg-config... no
checking for GTK2... no
configure: creating ./config.status
config.status: creating makeopts
config.status: creating autoconfig.h
configure: Menuselect build configuration successfully completed .$$$$$$$$$$$$$$$=..
.$$.. .$$:.
.$$:. ,$7.7
.$. $$$$ .$$
..$$. $$$$$ .$$$
..$ .?. $$$$$ .?. $$$.
$.$. .$$$. $$$$ .$$$. .$$$.
.. .$$$$$$$$$$$$$$. $$$,
$$$~ .$$$$$$$$$$$$$. .$$$.
.$$ .$$$$$$$: ?$$$.
$$$ ?$$$$$$$$$$I .$$$
$$$ .$$$$$$$$$$$$$$$$ :$$$.
$$$ $$$$$$$$$$$$$$$$$$ .$$$.
$$$ $$$ $$$ .$$$ .$$$.
$$$$ $$$$ .$$$.
$$$ $$$$ $$$
$$$$$ $$$
$$$$. $$ (TM)
$$$$$$$. .$$$$$$ $$
$$$$$$$$$$$$$$$$$$$$$.$$$$$$
$$$$$$$$$$$$$$$$. 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 :

然后make

Building Documentation For: third-party channels pbx apps codecs formats cdr cel bridges funcs tests main res addons
+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running: +
+ +
+ make install +
+-------------------------------------------+

最后make install

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 +
+-------------------------------------------+
05-11 15:36