1.正确安装freeswitch,带有silk编码。安装过程见前面的博客
2.修改/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml,添加<load module="mod_silk"/>
3.修改/usr/local/freeswitch/conf/vars.xml,修改
<X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/> 为
<X-PRE-PROCESS cmd="set" data="global_codec_prefs=SILK,OPUS,G722,PCMU,PCMA,VP8"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=SILK,OPUS,G722,PCMU,PCMA,VP8"/>
4.重启fs,可以用命令show codec验证silk是否被成功加载
freeswitch@internal> show codec
type,name,ikey
codec,ADPCM (IMA),mod_spandsp
......
codec,OPUS (STANDARD),mod_opus
codec,PROXY PASS-THROUGH,CORE_PCM_MODULE
codec,PROXY VIDEO PASS-THROUGH,CORE_PCM_MODULE
codec,RAW Signed Linear (16 bit),CORE_PCM_MODULE
codec,SILK,mod_silk
codec,Speex,CORE_SPEEX_MODULE
codec,VP8 Video,mod_vpx
codec,VP9 Video,mod_vpx
26 total.