系統環境:
CentOS 5.4
dahdi-linux-current
Asterisk-1.6.1-current
Linux domU-12-31-39-14-69-89 2.6.18-xenU-ec2-v1.0 (uname -a)
請參考這篇教學 Install Elastix on Amazon EC2
// 檢查並安裝所有相依性的套件
# rpm -q gcc-c++ zlib-devel openssl-devel ncurses-devel gtk2-devel iksemel-devel speex-devel libogg-devel libvorbis-devel curl-devel unixODBC-devel libtool-ltdl-devel net-snmp-devel bzip2-devel newt-devel lm_sensors-devel openldap-devel postgresql-devel gtk+-devel # yum install gcc-c++ zlib-devel openssl-devel ncurses-devel gtk2-devel iksemel-devel speex-devel libogg-devel libvorbis-devel curl-devel unixODBC-devel libtool-ltdl-devel net-snmp-devel bzip2-devel newt-devel lm_sensors-devel openldap-devel postgresql-devel gtk+-devel
// Install asterisk
# cd /usr/src # wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.6.1-current.tar.gz # tar xzf asterisk-1.6.1-current.tar.gz # cd asterisk-1.6.1*/ # contrib/scripts/get_ilbc_source.sh ;安裝 iLBC codec # ./configure # make menuselect
進入編譯模組的選單,選擇 Core Sound Packages,安裝所有項目(按 Enter),還有 Music On Hold File Packages,Extras Sound Packages 也都做相同的處理。
# make # make install # make samples # make config
// 檢查 asterisk 是否可執行
# asterisk -vvvvvvvvvvc CLI> stop now
// 安裝 asterisk-addons
# cd /usr/src # wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.1-current.tar.gz # tar asterisk-addons-1.6.1-current.tar.gz # cd asterisk-addons-1.6.1*/ # make clean # ./configure # make menuselect
這裡的選單顯示有關與 MySQL 連結的所有模組是否可以安裝。
# make # make install # make samples
// 為了改善 asterisk 的安全性,設定為不使用 root 來執行
// 新增帳號 asterisk,群組 asterisk
# groupadd asterisk # useradd -r -d /var/lib/asterisk -g asterisk asterisk
// 修改 /etc/asterisk/asterisk.conf
# cd /etc/asterisk # vi asterisk.conf [directories] ;移除(!) astrundir => /var/run/asterisk # mkdir /var/run/asterisk
// 修改 /etc/init.d/asterisk
# vi /etc/init.d/asterisk
// 重設相關目錄檔案權限
# chown -R -L asterisk:asterisk /var/lib/asterisk # chown -R -L asterisk:asterisk /var/log/asterisk # chown -R -L asterisk:asterisk /var/run/asterisk # chown -R -L asterisk:asterisk /var/spool/asterisk # chown -R -L asterisk:asterisk /etc/asterisk # chmod -R 0755 /var/lib/asterisk # chmod -R 0755 /var/log/asterisk # chmod -R 0755 /var/run/asterisk # chmod -R 0755 /var/spool/asterisk # chmod 0775 /etc/asterisk # chmod -R 0664 /etc/asterisk/* # chmod +x /etc/init.d/asterisk
// 啟動 asterisk 服務
# chkconfig asterisk on # service asterisk start