如何安裝 codec g.729&g.723

来源:互联网 发布:淘宝上做什么生意赚钱 编辑:程序博客网 时间:2024/06/06 09:26

转自: http://www.osslab.org.tw/index.php?title=%E5%AF%A6%E9%A9%97%E5%B0%88%E6%A1%88/Asterisk/Tips/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%9D_codec_g.729_%26_g.723

另:参考官方网站http://www.trixbox.org/forums/trixbox-forums/share-your-trixbox-success-stories/codec-g723-g729

 

 

此篇適用 Elastix、Trixbox及 PBXinaFlash 等用戶,以手動方式安裝語音編碼,如需要自動安裝請參考 Codec 自動安裝工具。

下載適合自己機器及軟體版本的模組檔,基本上略分為 pentium/pentium2/pentium3/x86_64,Asterisk 1.2/1.4/1.6。
前往 http://asterisk.hosting.lv/

Note: 在 Linux 要檢查 CPU 資訊,可以執行 cat /proc/cpuinfo。

安裝 codec 只需要將模組檔複製到 Asterisk 主機上,目錄為 /usr/lib/asterisk/modules。

#cp codec_g723-ast14-gcc4-glibc-pentium3.so /usr/lib/asterisk/modules#cp codec_g729-ast14-gcc4-glibc-pentium3.so /usr/lib/asterisk/modules#chmod 0755 /usr/lib/asterisk/modules/codec_g723-ast14-gcc4-glibc-pentium3.so#chmod 0755 /usr/lib/asterisk/modules/codec_g729-ast14-gcc4-glibc-pentium3.so

然後,重新啟動 asterisk 套用新模組檔

#asterisk -rx "stop now"#amportal stop#amportal start

Note: 如果不想停止服務,可以在 CLI 載入模組檔,請執行:

#asterisk -rx "load codec_g723-ast14-gcc4-glibc-pentium3.so"#asterisk -rx "load codec_g729-ast14-gcc4-glibc-pentium3.so"

到這裡,如果沒有發生任何錯誤,codec 就已經安裝完成,但 Asterisk 預設並未啟用這兩個額外裝的 codec,所以繼續下一步將它們啟用。

Elastix UI -> PBX -> Tools -> File Editor 搜尋 sip_general_custom.conf,加上這幾行。

allow=g729allow=g723

存檔離開,選擇 Asterisk-Cli,輸入 sip reload 按執行,套用新設定。

最後,檢查系統是否已支援 codec g.729 & g.723:

Elastix UI -> PBX -> Toosl -> Asterisk-Cli,執行 core show translation recalc 10
列表中,不能全出現 就可以了。

ast-check-codec.png 

Notes: 如果有多個模組檔都可以相容目前的機器,選擇其中一個顯示數字最小的模組來使用。