freeswitch1.10.6从Centos源码安装(成功)

1,安装必须依赖组件

In case of errors about "no usable spandsp" or sofia-sip, compile and install spandsp and sofia-sip first, then
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
where ls /usr/local/lib/pkgconfig should list at least

sofia-sip-ua.pc spandsp.pc

Then FreeSWITCH should compile properly.

#1、安装sofia-sip-ua
#2、安装spandsp


2,安装必须安装包

#安装必须包
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum-builddep -y freeswitch
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git
yum install -y devtoolset-4-gcc*
yum install sqlite-devel
yum install libcurl-devel 
yum install pcre 
yum install pcre-devel
yum install speex 
yum install speex-devel
yum install ldns-devel
yum install yasm
yum install libopus-devel
#错误提示: You must install libopus-dev to build mod_opus
yum -y install opus-devel
#可能需要清理:  make clean && ./configure && make


3,安装mod_av组件

#参照安装文档 https://www.cnblogs.com/cash/p/13278104.html
#如果不想安装这个组件(module.conf.xml 注释掉编译项)

#step 安装x264
#git clone http://git.videolan.org/git/x264.git
./configure --disable-asm
make
make install

#step2 安装libav
wget http://download1.rpmfusion.org/free/el/updates/7/x86_64/x/x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
wget http://download1.rpmfusion.org/free/el/updates/7/x86_64/x/x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
rpm -hiv x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
rpm -hiv x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
cd /usr/local/src
git clone https://gitee.com/nwaycn/libav.git
cd libav
./configure --enable-pic --enable-shared  --enable-libx264 --enable-gpl --extra-libs="-ldl"
make                                                                                  
make install
cp /usr/local/lib/pkgconfig/libavcodec.pc    /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavdevice.pc   /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavfilter.pc   /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavformat.pc   /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavresample.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavutil.pc     /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libswscale.pc    /usr/lib64/pkgconfig/
ldconfig

4,编译源代码安装

#下载freeswitch源文件
cd /usr/local/src
git clone -b v1.10 https://github.com/signalwire/freeswitch.git freeswitch
cd /usr/local/src/freeswitch
#执行开始编译
./bootstrap.sh -j

#执行编译
./configure

#出现错误与解决
#------------------------------------------------------------------
#configure: error: You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support
#1.执行:yum search libedit-dev
#=============== N/S Matched: libedit-dev ========================
#libedit-devel.i686 : Development files for libedit
#libedit-devel.x86_64 : Development files for libedit
#2.yum install libedit-devel
#------------------------------------------------------------------
#
#./configure --enable-portable-binary \
#            --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
#            --with-gnu-ld --with-python --with-erlang --with-openssl \
#            --enable-core-odbc-support --enable-zrtp

make
make -j install
make -j cd-sounds-install
make -j cd-moh-install

#在CentOS系统上,其默认的安装位置是/usr/local/freeswitch。
#两个常用的命令是bin/freeswitch和bin/fs_cli,为了便于使用,建议将这两个命令做符号链接放到你的搜索路径中,如:
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/

5,安装遇到问题及解决方案

 #参照下面博客
 https://www.cnblogs.com/lzpong/p/6740188.html
 
# 1.出现下面错误处理办法
# SignalWire adoption failed: stun [stun.freeswitch.org] lookup error: Remote Address Error!

vim /usr/local/freeswitch/conf/autoload_configs/signalwire.conf

<configuration name="signalwire.conf" description="SignalWire">
  <settings>
    <!-- on/off/file-path -->
    <!--param name="kslog" value="on"/-->
    <!--param name="blade-bootstrap" value="blade://switchblade:2100"/-->
    <!--param name="adoption-service" value="https://adopt.signalwire.com/adoption"/-->
    <!--param name="stun-server" value="stun.freeswitch.org"/-->
    <!-- <authentication></authentication> -->
    <!-- override dialplan context for calls on connector -->
    <!--<param name="override-context" value="signalwire"/>-->
  </settings>
</configuration>
保存重启

6,模块及组件安装

6.1 安装中文语音组件
1、下载中文语音包  

链接:https://pan.baidu.com/s/1UODvqj8NAQw7_CRatfl0kg
提取码:qwdn

创建目录 /usr/local/freeswitch/sounds/zh/cn/link
将下载好的语音上传到     /usr/local/freeswitch/sounds/zh/cn/link

2、修改   /usr/local/freeswitch/conf/vars.xml

  在53行左右增加 <X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}/zh/cn/link"/>

3、修改  /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml

  在136 行左右 取消 <load module="mod_say_zh"/> 注释 

4、编译mod_say_zh 模块  

  cd /usr/local/src/freeswitch-1.8.2/src/mod/say/mod_say_zh

   make && make instal

5、cd /usr/local/freeswitch/conf/lang/

  cp -fr en zh

  cd zh

  mv en.xml zh.xml

6、修改zh.xml
  <language name="zh" say-module="zh" sound-prefix="$${sound_prefix}/zh/cn/link" tts-engine="mod_tts_commandline" tts-voice="link">
7、/usr/local/freeswitch/conf/freeswitch.xml
  在61行增加   <X-PRE-PROCESS cmd="include" data="lang/zh/*.xml"/>
8、控制台 reloadxml
6.2,安装视频通话组件
# 特别说明:必须安装mod_av组件
#1,开启视频通话功能
#编辑 /usr/local/freeswitch/etc/freeswitch/vars.xml
bash <X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8"/> 
    <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8"/>

#编辑 /usr/local/freeswitch/etc/freeswitch/sip_profiles/internal.xml
shell 将 <param name="inbound-proxy-media" value="true"/> 这行注释去掉

#加载 mod_av 模块
启动 freeswitch 后,在 fs_cli 控制台中输入:load mod_av

#开启启动 freeswitch 自动加载 mod_av 方法:
#修改/usr/local/freeswitch/etc/freeswitch/autoload_configs/modules.conf.xml 文件
#取消注释 <load module="mod_av"/>
6.3 配置通话录音
#配置录音功能
#1.建立一个文件夹,在/freeswitch/recordings/archive/ ,用来存储录音文件;
#2.修改拨码计划,打开 \conf\dialplan\default.xml
# 找到下面的语句:<extension name="Local_Extension"><condition field="destination_number" expression="^(10[01][0-8])$">  
# 在下面添加录音配置参数:
<action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}"/> 
<action application="set" data="RECORD_COPYRIGHT=(c) 2021"/>  
<action application="set" data="RECORD_SOFTWARE=FreeSWITCH"/>
<action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
<action application="set" data="RECORD_COMMENT=FreeSWITCH"/>
<action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}"/>  
<action application="set" data="RECORD_STEREO=true"/>
<action application="record_session" data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
#3.在fs_cli中使用F6或执行reloadxml使配置文件生效;
#4.随便呼叫产生录音文件

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
禁止转载,如需转载请通过简信或评论联系作者。
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,651评论 6 501
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,468评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,931评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,218评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,234评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,198评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,084评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,926评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,341评论 1 311
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,563评论 2 333
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,731评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,430评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,036评论 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,676评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,829评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,743评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,629评论 2 354

推荐阅读更多精彩内容