系統環境介紹:
// 準備事項
// 使用 uname -r 檢查目前的 Linux 核心版本,安裝合適的 linux-headers。
apt-get install linux-headers-2.6.26-2-686 apt-get install libncurses5-dev bison libssl-dev libnewt-dev zlib1g-dev procps gcc make binutils doxygen apt-get install apache2 mysql-server php5-mysql php5-gd
// 下載原始檔
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-1.2.40.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-addons-1.2.9.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-sounds-1.2.1.tar.gz wget http://downloads.asterisk.org/pub/telephony/zaptel/zaptel-1.2.27.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.2.8.tar.gz
// 編譯安裝 libpri
cd /usr/src tar xzf libpri-1.2.8.tar.gz cd libpri-1.2.8 make make install
Notes:
* libpri-1.2.x 必須搭配 zaptel-1.2.x。
// 編譯安裝 zaptel
cd /usr/src tar xzf zaptel-1.2.27.tar.gz cd zaptel-1.2.27 make clean ./configure (忽略它,只適用 1.4.x) make menuselect (忽略它,只適用 1.4.x) make make install make config
Notes:
* 執行 make config 後,會增加開機啟動設定。
vi /etc/default/zaptel
除了所使用的卡型號及 ztdummy,其餘都註解。
MODULES="$MODULES wcte11xp" # TE110P - Single Span T1/E1 Card MODULES="$MODULES ztdummy" # UHCI USB Zaptel Timing Only Interface
// 編譯安裝 Asterisk
cd /usr/src tar xzf asterisk-1.2.40.tar.gz cd asterisk-1.2.40 make clean ./configure (忽略它,只適用 1.4.x) make menuselect (忽略它,只適用 1.4.x) make make install make samples make config
設定 Asterisk 啟動檔
cp contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk chmod 0755 /etc/init.d/asterisk
設定 Asterisk 的帳號及權限
addgroup --system asterisk adduser --system --ingroup asterisk --home /var/lib/asterisk --no-create-home asterisk vi /etc/init.d/asterisk
刪除註解
AST_USER="asterisk" AST_GROUP="asterisk"
編輯 /etc/asterisk/asterisk.conf
修改這行
astrundir => /var/run/asterisk
mkdir /var/run/asterisk chown asterisk:asterisk /var/run/asterisk chown -R asterisk:asterisk /etc/asterisk chown -R asterisk:asterisk /var/log/asterisk chown -R asterisk:asterisk /var/spool/asterisk chown -R asterisk:asterisk /var/lib/asterisk chown asterisk:asterisk /dev/zap/pseudo
//