編譯 G72X codec

    版本為 14:21, 20 Nov 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    G.723 and G.729 for Asterisk 11

    You should compile Asterisk 11, so prepare your PC/server for it. Install development packages, get Asterisk 11 source, compile and install it.

    Suppose you don’t want to install Asterisk 11 in your PC/server. You can configure and compile Asterisk 11, but don’t need to install it. After that you can continue compile the codec.

    Now, assumed you have compiled Asterisk 11 and install it in /opt/asterisk on your PC/server.

    Follow below steps to compile codec g723 and g729:

    wget -c http://asterisk.hosting.lv/src/asterisk-g72x-1.1.tar.bz2
    tar -jxf asterisk-g72x-1.1.tar.bz2
    cd asterisk-g72x-1.1/
    ./configure --with-asterisk-includes=/opt/asterisk/include --with-asterisk100 --enable-pentium4 --with-itu
    make
    cd .libs
    ls -l *.so
    

    Copy codec_g723.so and codec_g729.so to your Asterisk 11 modules directory.

    Should you use not a Pentium 4 compatible just replace –enable-pentium4 with your PC/server architecture. Get options by running ./configure –help in the codec source directory asterisk-g72x-1.1.

    These are complete steps when you don’t want to install Asterisk 11 but need to compile the codec.

    apt-get install build-essential
    wget -c http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
    tar -zxf asterisk-11-current.tar.gz
    cd asterisk-11.4.0
    ./configure --disable-xmldoc
    make
    cd ../
    wget -c http://asterisk.hosting.lv/src/asterisk-g72x-1.1.tar.bz2
    tar -jxf asterisk-g72x-1.1.tar.bz2
    cd asterisk-g72x-1.1/
    ./configure --with-asterisk-includes=../asterisk-11.4.0/include --with-asterisk100 --enable-pentium4 --with-itu
    make
    cd .libs
    ls -l *.so
    

    G729 for ARM Processor

    apt-get install build-essential checkinstall cvs subversion git-core mercurial
    
    cd /usr/src
    wget http://download-mirror.savannah.gnu.org/releases/linphone/plugins/sources/bcg729-1.0.0.tar.gz
    tar xzf bcg729-1.0.0.tar.gz
    cd bcg729-1.0.0/
    ./configure
    make && make install
    ldconfig
    
    cd /usr/src
    hg clone http://bitbucket.org/arkadi/asterisk-g72x
    cd asterisk-g72x/
    vi configure.ac
    

    在 case "${host}" in 這行下方

      armv7l-unknown-linux-gnueabihf*)
        cflags="-O3 -funroll-loops -marm -mtune=cortex-a7 -Wall"
        march="armv7-a"
        ;;
    

    NOTE:

    以上修改僅適合 Cubieboard v1

    Raspberry Pi B 不需要修改

    開始編譯

    ./autogen.sh
    ./configure --with-asterisk-includes=/usr/src/asterisk-12.4.0/include/ --with-bcg729
    make
    make install
    ldconfig 
    

    NOTE:

    * 必須先下載 Asterisk 安裝原始檔

    *  執行 autogen.sh 後才會有 configure 指令,如果遇到錯誤,必須先安裝 autoconf , automake 套件。

    * --with-asterisk-includes Asterisk 原始安裝檔目錄內的 include 目錄

    * --with-bcg729 會自動偵測 bcg729 函式庫。

    移植到其他的硬體
    1. 複製 /usr/local/lib/libbcg729.so.0 至新硬體的 /lib 目錄
    2. 複製 /usr/lib/asterisk/modules/codec_g729.so 至新硬體相同目錄
    3. Asterisk 版本必須與編譯時的相同
    Q & A

    錯誤:

    autoreconf: failed to run aclocal: No such file or directory

    解答:apt-get insatll automake

    錯誤:

    configure.ac:11: warning: macro `AM_PROG_LIBTOOL' not found in library

    解答:apt-get install libtool

    錯誤:

    configure: error: unable to find Bcg729 library

    解答:必須先編譯  bcg729 函式庫,且安裝路徑為預設值。

    Powered by MindTouch Core