1、安裝asterisk先決條件:mysql
1.檢查系統內核版本linux
#uname -ac++
例如:sql
Linux localhost.localdomain 2.6.18-92.el5xen #1 SMP Tue Jun 10 19:55:54 EDT 2008 i686 i686 i386 GNU/Linuxvim
2.檢查是否已經安裝kernel-develdom
# rpm -q kernel-develsvn
例如:kernel-devel-2.6.18-92.1.10.el5,表示已經安裝,若是沒有安裝,要用yum安裝一下,ui
以下 yum install kernel-develes5
3.檢查是否已經安裝如下的輔助軟件包spa
rpm -q bison bison-devel ncurses ncurses-devel zlib zlib-devel openssl openssl-devel gnutls-devel gcc gcc-c++ mysql-devel
最少mysql-devel須要安裝
4.若是沒有安裝則用yum安裝
yum install bison
yum install bison-devel
yum install ncurses
yum install ncurses-devel
yum install zlib
yum install zlib-devel
yum install openssl
yum install openssl-devel
yum install gnutls-devel
yum install gcc
yum install gcc-c++
5.其餘依賴軟件安裝
Software dependencies for Asterisk on Ubuntu Server and CentOS Server
Ubento:
Sudo apt-get install build-essential subversion libncurses5-dev libssl-dev libxml2-dev vim-nox
CentOS
Sudo yum install gcc gcc-c++ make wget subversion libxml2-devel ncurses-devel openssl-devel vim-enhanced
2、從網上下載asterisk源代碼
先建立文件夾存放文件
$ mkdir -p ~/src/asterisk-complete/asterisk
兩種方法下載源代碼
Svn:
$ cd ~/src/asterisk-complete/asterisk
$ svn co http://svn.asterisk.org/svn/asterisk/branches/1.8
Wget:
$ cd ~/src/asterisk-complete/asterisk
$ wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz
$ tar zxvf asterisk-1.8-current.tar.gz
我使用的是SVN方法
3、安裝asterisk
1.安裝libpri
$ cd ~/src/asterisk-complete/
$ mkdir libpri
$ cd libpri/
$ svn co http://svn.asterisk.org/svn/libpri/tags/1.4.11.5(按照svn上的最新版本填寫http://downloads.asterisk.org/pub/telephony/libpri/)
$ cd 1.4.11.5
$ make
$ sudo make install
2.安裝DAHDI
$ cd ~/src/asterisk-complete/
$ mkdir dahdi
$ cd dahdi/
$ svn co http://svn.asterisk.org/svn/dahdi/linux-complete/tags/2.4.1.2+2.4.1(按照svn上的最新版本填寫http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/)
$ cd 2.4.1.2+2.4.1
$ make
$ sudo make install
$ sudo make config
3.安裝asterisk
$ cd ~/src/asterisk-complete/asterisk/1.8
$ ./configure
$ make
$ sudo make install
$ sudo make config
4.安裝文檔
Make progdocs
5.安裝示例配置文件
Make samples
6.關閉SELinux
$ cd /etc/selinux/
$ sudo vim config
Change the SELINUX option from enforcing to disabled.(SELINUX=disabled)
$ sudo reboot
安裝完成