系統環境介紹:

    • Debian 5.0.6
    • Asterisk 1.2.40
    • zaptel 1.2.27

    安裝開始

    // 準備事項
    // 使用 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 libmysqlclient15-dev
    

    // 下載原始檔

    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-addons

    cd /usr/src
    tar xzf asterisk-addons-1.2.9.tar.gz
    cd asterisk-addons-1.2.9
    make
    make install 
    

    Notes:

    asterisk-addons 包含了 cdr_addon_mysql.so, app_addon_sql_mysql.so, res_config_mysql.so 與資料庫 MySQL 連結的函式庫。

    設定 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
    adduser asterisk audio (增加 asterisk 到 group audio)
    

     

    //

    F.A.Q

    Error: Unable to open /dev/zap/ctl: Permission denied

    Ans: 編輯 /etc/udev/rules.d/zaptel.rules

    # zaptel devices with ownership/permissions for running as non-root
    KERNEL=="zapctl", NAME="zap/ctl", OWNER="asterisk", GROUP="asterisk", MODE="0660"
    KERNEL=="zaptimer", NAME="zap/timer", OWNER="asterisk", GROUP="asterisk", MODE="0660"
    KERNEL=="zapchannel", NAME="zap/channel", OWNER="asterisk", GROUP="asterisk", MODE="0660"
    KERNEL=="zappseudo", NAME="zap/pseudo", OWNER="asterisk", GROUP="asterisk", MODE="0660"
    KERNEL=="zaptranscode", NAME="zap/transcode", OWNER="asterisk", GROUP="asterisk", MODE="0660"
    KERNEL=="zap[0-9]*", NAME="zap/%n", OWNER="asterisk", GROUP="asterisk", MODE="0660"
    

    存檔後,重啟 zaptel,並檢查權限應為:

    acquavpbx:/etc/udev/rules.d# ls -l /dev/zap
    total 0
    crw-rw---- 1 asterisk asterisk 196,   1 2010-10-24 04:53 1
    crw-rw---- 1 asterisk asterisk 196,  10 2010-10-24 04:53 10
    crw-rw---- 1 asterisk asterisk 196,  11 2010-10-24 04:53 11
    crw-rw---- 1 asterisk asterisk 196,  12 2010-10-24 04:53 12
    crw-rw---- 1 asterisk asterisk 196,  13 2010-10-24 04:53 13
    ...
    ...
    crw-rw---- 1 asterisk asterisk 196, 254 2010-10-24 04:53 channel
    crw-rw---- 1 asterisk asterisk 196,   0 2010-10-24 04:53 ctl
    crw-rw---- 1 asterisk asterisk 196, 255 2010-10-24 04:53 pseudo
    crw-rw---- 1 asterisk asterisk 196, 253 2010-10-24 04:53 timer
    crw-rw---- 1 asterisk asterisk 196, 250 2010-10-24 04:53 transcode
    
    標籤 (Edit tags)
    • No tags
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core