1.查看網(wǎng)關(guān)注冊(cè)狀態(tài)
sofia status
2.橋接(未實(shí)踐) http://wiki.freeswitch.org.cn/wiki/Mod_lua.html#jump10237
freeswitch.bridge
session1 = freeswitch.Session("sofia/internal/1001%192.168.1.1");
session2 = freeswitch.Session("sofia/internal/1002%192.168.1.1");
freeswitch.bridge(session1, session2);
http://wiki.freeswitch.org.cn/wiki/Mod_lua.html#jump10237
3.diaplan腳本中先呼叫一方剿配,再轉(zhuǎn)接另一方
[](javascript:void(0); "復(fù)制代碼")
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"> 1 prefix = "{ignore_early_media=true}sofia/192.168.150.132/"
2 file_to_play = "/usr/local/freeswitch/sounds/custom/8000/sound.wav"
3
4 function call_number(number) 5 dial_string = prefix .. tostring(number);
6 -- debug("calling " .. dial_string);
7 session = freeswitch.Session(dial_string); 8 session:setAutoHangup(false)
9 session:transfer("5002", "XML", "default") 10 return session:hangupCause() 11 end
12 hangup_cause = call_number("1012")</pre>
](javascript:void(0); "復(fù)制代碼")
freeswitch下執(zhí)行l(wèi)ua腳本運(yùn)行
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;">luarun autodia.lua param1</pre>
如果通過客戶端執(zhí)行,可以調(diào)用fs_cli 阅束,調(diào)用完成后退出客戶端命令如下:
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;">bin/fs_cli -x "luarun autodia.lua param1"</pre>
4.fs_cli連接不上問題
a.可以看8021端口是否使用呼胚,如果是的
相關(guān)配置文件 conf/autoload_configs/event_socket.conf.xml
<configuration name="event_socket.conf" description="Socket Client">
<settings>
<param name="nat-map" value="false"/>
- <param name="listen-ip" value="::"/>
- <param name="listen-ip" value="127.0.0.1"/>
<param name="listen-port" value="8021"/>
<param name="password" value="ClueCon"/>
-
</settings>
</configuration>
配置改成如下配置即可
[](javascript:void(0); "復(fù)制代碼")
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"><configuration name="event_socket.conf" description="Socket Client">
<settings>
<param name="nat-map" value="false"/>
<param name="listen-ip" value="127.0.0.1"/>
<param name="listen-port" value="8021"/>
<param name="password" value="ClueCon"/>
</settings>
</configuration></pre>
](javascript:void(0); "復(fù)制代碼")
b. ip最好改成本機(jī),否者仍有可能拒絕訪問
5.FREESWITCH轉(zhuǎn)接語音到MRCP Server接收到的音頻音質(zhì)極差問題
一般是FREEWTICH與終端的音頻編碼和與MRCP Server的編碼不一致導(dǎo)致(終端音頻碼率較高)息裸,F(xiàn)S進(jìn)行轉(zhuǎn)碼時(shí)失真過大蝇更,SF轉(zhuǎn)碼能力可能有些欠缺。通過修改FREESWITCH 目錄下conf/vars.xml 將 global_codec_prefs 配置限制為MRCP Server能夠接收的編碼即可呼盆。
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"><X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA"/></pre>
6.單模塊編譯安裝
當(dāng)已經(jīng)安裝好freeswitch年扩,需要安裝一個(gè)未安裝的模塊步驟
1.進(jìn)入freeswitch-version源碼目錄
修改module.conf 啟動(dòng)你的安裝的模塊如mod_json_cdr
2.進(jìn)入src/mod目錄下,make mod_json_cdr
3.在src/mod目錄下 make mod_json_cdr-install
4.在FREESWITCH控制臺(tái) load mod_json_cdr
7.集成mod_unimrcp 并對(duì)接unimrcpserver
a.FREESWITCH源碼根路徑下访圃,修改modules.conf文件厨幻,取消“asr_tts/mod_unimrcp”配置的注釋
b. make mod_unimrcp;make mod_unimrcp-install 集成mod_unimrcp模塊
c.切換到安裝目錄。新建文件conf/mrcp_profiles/unimrcpserver-mrcp-v2.xml腿时,具體配置如下况脆,注意修改ip和端口
[](javascript:void(0); "復(fù)制代碼")
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"><include>
<profile name="unimrcpserver-mrcp2" version="2">
<param name="server-ip" value="127.0.0.1"/>
<param name="server-port" value="8060"/>
<!-- FreeSWITCH IP、端口以及 SIP 傳輸方式 -->
<param name="client-ip" value="127.0.0.1" />
<param name="client-port" value="5069"/>
<param name="sip-transport" value="udp"/>
<!-- <param name="speechsynth" value="speechsynthesizer"/> -->
<!-- <param name="speechrecog" value="speechrecognizer"/> -->
<!--param name="rtp-ext-ip" value="auto"/-->
<param name="rtp-ip" value="127.0.0.1"/>
<param name="rtp-port-min" value="4000"/>
<param name="rtp-port-max" value="5000"/>
<param name="codecs" value="PCMU PCMA L16/96/8000"/>
<!-- Add any default MRCP params for SPEAK requests here -->
<synthparams>
</synthparams>
<!-- Add any default MRCP params for RECOGNIZE requests here -->
<recogparams>
<!--param name="start-input-timers" value="false"/-->
</recogparams>
</profile>
</include></pre>
](javascript:void(0); "復(fù)制代碼")
d.conf/autoload_configs/unimrcp.conf.xml修改配置批糟,將mrcp對(duì)接server選擇為上面配置的server格了,使用profile name熟悉值
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;">
<param name="default-tts-profile" value="unimrcpserver-mrcp2"/>
<param name="default-asr-profile" value="unimrcpserver-mrcp2"/></pre>
e. conf/autoload_configs/modules.conf.xml增加如下配置項(xiàng),讓fs啟動(dòng)時(shí)自動(dòng)加載該模塊
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"><load module="mod_unimrcp" /></pre>
8.sip跃赚、rtp對(duì)接配置笆搓,修改conf/sip_profiles/external.xml。如果走的是代理等網(wǎng)絡(luò)纬傲,需要視情況將auto-nat改為外部ip(如果本機(jī)即有外部ip或者對(duì)端支持nat满败,則可能不需要配置)。
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"> <param name="ext-rtp-ip" value="auto-nat"/>
<param name="ext-sip-ip" value="auto-nat"/></pre>
9.對(duì)接mod_format_cdr
a.編譯安裝模塊叹括,同上
b.啟用模塊算墨,同上
c.配置,修改 conf/autoload_configs/format_cdr.conf.xml汁雷,其中幾個(gè)配置項(xiàng)需要修改
[](javascript:void(0); "復(fù)制代碼")