FreeSwitch安裝配置記錄

安裝FreeSwitch

主要命令以下:html

git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git
cd freeswitch/
./bootstrap.sh && ./configure && make && make install && make hd-sounds-install && make hd-moh-install && make samplesgit

最後一個命令大約執行20分鐘bootstrap

缺省安裝目錄:/usr/local/freeswitch/dom

FreeSwitch所需的端口列表(需在防火牆設置裏打開):http://wiki.freeswitch.org/wiki/Firewall測試

FreeSwitch默認只支持音頻,爲支持視頻,修改vars.xml以下:google

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA,GSM,H264,H263-1998,H263"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA,GSM,H264,H263-1998,H263"/>code

檢驗是否安裝成功

FreeSwitch安裝後缺省用戶是1000~1020,密碼均爲1234。用任意sip客戶端(boghe, linphone, x-lite等等)登陸,撥9664應該能夠聽到等待音樂,說明安裝成功了。還有一些功能號碼,總結以下:視頻

------------------
號碼 | 說明
----------------------
9664 | 保持音樂
9196 | echo,迴音測試
9195 | echo,迴音測試,延遲5秒
9197 | milliwatte extension,鈴音生成
9198 | TGML 鈴音生成示例
5000 | 示例IVR
4000 | 聽取語音信箱
33xx | 電話會議,48K(其中xx可爲00-99,下同)
32xx | 電話會議,32K
31xx | 電話會議,16K
30xx | 電話會議,8K
2000-2002 | 呼叫組
1000-1019 | 默認分機號xml

曾遇到過一個問題,接通9664後馬上被自動掛斷,接上攝像頭後問題消失。htm

配置電信/聯通雙線

複製internal.xml爲internal2.xml,修改internal2.xml裏第一行的name爲internal2,再將sip-ip和rtp-ip改成與internal裏不一樣的那個公網ip,重啓freeswitch便可。(用sofia status命令應該能夠看到新建的internal2生效)

要使用智能域名解析,將vars.xml裏的domain改成域名便可。

防掉線

在profile文件裏修改nat-options-ping屬性爲true,大約每30秒FreeSwitch會發一個options包給客戶端以保持鏈接。
http://wiki.freeswitch.org/wiki/Sofia.conf.xml#nat-options-ping

中文語音

中文語音包下載和使用方法:https://groups.google.com/forum/#!topic/freeswitch-cn/gYXmAv7sGKU

參考資料

http://www.dujinfang.com/2010/04/14/freeswitch-chu-bu.html

相關文章
相關標籤/搜索