FreeSwitch v1,大专生面试阿里P7居然过了

如执行后提示mod_lua.cpp:37:10: fatal error: lua.h: No such file or directory、[Makefile:1040: libluamod_la-mod_lua.lo] Error 1,见问题附录十三处理后再继续。

如执行后提示Makefile:967: *** You must install libopus-dev to build mod_opus.  Stop.,见问题附录十四处理后再继续。

如执行后提示Makefile:965: *** You must install libpq-dev to build mod_pgsql.  Stop.,见问题附录十五处理后再继续。

如执行后提示Makefile:976: *** You must install libks to build mod_signalwire.  Stop.,见问题附录十六处理后再继续。

如执行后提示Makefile:971: *** You must install signalwire-client-c to build mod_signalwire.  Stop.,见问题附录十七处理后再继续。

如执行后提示Makefile:1451: *** You must install libsndfile-dev to build mod_sndfile.  Stop.,见问题附录十八处理后再继续。

Make成功后如下所示:

(5)安装:make install,安装成功如下所示:

进入/app/rainbow/freeswitch/目录查看,结构如下所示:

创建软连接:

ln -sf /app/rainbow/freeswitch/bin/freeswitch /usr/bin/

ln -sf /app/rainbow/freeswitch/bin/fs_cli /usr/bin/

启动服务到后台:

freeswitch -nc

查看启动日志,显示IPv6的支持问题,如下所示:

如不需要ipv6,进入sip_profiles目录下去掉ipv6配置文件即可,执行:

mv external-ipv6.xml external-ipv6.xml_bak

mv internal-ipv6.xml internal-ipv6.xml_bak

然后重新启动

  • 启用freeswitch-portal(可选)

freeswitch portal为内置模块,开箱即用,安装完成之后只需要启用就可以,如下:

fs_cli

load mod_xml_rpc

启用后可访问:http://服务IP:8080/portal,默认账户为:freeswitch/works,可以在 conf/autoload_configs/xml_rpc.conf.xml中修改,修改后可直接在控制台reload mod_xml_rpc生效。

如果想跟随freeswitch启动则直接操作配置文件具体如下

#conf/autoload_configs/modules.xml 中去掉如下注释:

启用后,访问结果如下:

如果在浏览器右上角出现:Socket Disconnected,表示数据的自动更新使用Ajax轮询的方式获得;如果想使用Websocket自动更新数据,只需要在xml_rpc.conf.xml中添加

  • 对接postgresQL

基于公司1.10.7版本

在auto_modules/switch.conf.xml修改连接信息如下:

放开pgql注释编辑连接信息,放开auto-create-schemas自动创建表空间,最后注释掉原来放开的core-db-name

Freeswitch各个模块的数据库是可以单独设置的,不同的模块接入时,会创建不同的表结构,涉及修改的文件内容如下:

  • auto_modules/switch.conf.xml

  • auto_modules/db.conf.xml

  • sip_profiles/internal.xml

fifo.conf.xml

voicemail.conf.xml

external.xml

也可以统一放在vars.xml中设置。

六、卸载

在源码目录下执行:

make uninstall

七、问题附录

  • (一)安装sofia-sip提示autoreconf:command not found

安装sofia-sip模块,如执行./bootstrap后提示**autoreconf:command not found,**如下:

根据提示需要安装libtool,执行安装:

yum -y install autoconf automake libtool

  • (二)安装sofia-sip提示:openssl/ssl.sh 不存在

安装sofia-sip模块,如执行make后提示**fatal error: openssl/ssl.h: No such file or directory #include <openssl/ssl.h>,**如下:

根据提示需要安装openssl-devel,执行安装:

yum install openssl-devel

安装完成后需要对sofia-sip模块重新./configure。

  • (三)安装spandsp提示Cannot build without libtiff

安装spandsp模块,如执行./configure后提示configure: error: “Cannot build without libtiff (does your system require a libtiff-devel package?)”,如下:

根据提示需要安装libtiff-devel,执行安装:

yum install libtiff-devel

  • (四)安装spandsp提示Cannot build without libtiff

安装spandsp模块,如执行./configure后提示configure: error: “Cannot build without libtiff (does your system require a libjpeg-devel or libjpeg-turbo-devel package?)”,如下:

根据提示需要安装libjpeg-devel,执行安装:

yum install libjpeg-devel

  • (五)安装freeswitch提示sqlite错误

安装freeswitch模块,如执行./configure后提示configure: error: Library requirements (sqlite3 >= 3.6.20) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them. ,如下:

根据提示需要安装sqlite-devel,执行安装:

yum install sqlite-devel

  • (六)安装freeswitch提示libcurl错误

安装freeswitch模块,如执行./configure后提示configure: error: Library requirements (libcurl >= 7.19) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.,如下:

根据提示需要安装curl-devel,执行安装:

yum install curl-devel

  • (七)安装freeswitch提示libpcre错误

安装freeswitch模块,如执行./configure后提示configure: error: Library requirements (libpcre >= 7.8) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.,如下:

根据提示需要安装pcre-devel,执行安装:

yum install pcre-devel

  • (八)安装freeswitch提示speex、speexdsp错误

安装freeswitch模块,如执行./configure后提示configure: error: Library requirements (speex >= 1.2rc1 speexdsp >= 1.2rc1) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.,如下:

根据提示需要安装speex-devel、speexdsp-devel,执行安装:

yum install speex-devel

yum install speexdsp-devel

安装过程中腾讯云的仓库找不到speex-devel、speexdsp-devel,丢了个阿里云的repo到/etc/yum.repo/下面启用后继续安装。

  • (九)安装freeswitch提示libldns错误

安装freeswitch模块,如执行./configure后提示configure: error: You need to either install libldns-dev or disable mod_enum in modules.conf,如下:

根据提示可选择安装库文件或修改modules.conf禁用该功能,这里选择安装:

yum install ldns-devel

  • (十)安装freeswitch提示libedit错误

安装freeswitch模块,如执行./configure后提示configure: error: You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support,如下:

根据提示可以选择安装库文件或增加编译参数(–disable-core-libedit-support),在此选择执行安装:

yum install libedit-devel

  • (十一)安装freeswitch提示yasm错误

安装freeswitch模块,如执行make后提示Neither yasm nor nasm have been found. See the prerequisites section in the README for more info.,如下:

根据提示需要安装yasm或nasm,执行安装:

yum install yasm

  • (十二)安装freeswitch提示libavformat-dev and libswscale-dev错误

安装freeswitch模块,如执行make后提示Makefile:1476: *** You must install libavformat-dev and libswscale-dev to build mod_av.  Stop.,如下:

根据提示需要安装libavformat-dev和libswscale-dev用于编译mod_av模块,连续找了几个yum源都没找到(在此推荐:https://centos.pkgs.org/,提供各类依赖包检索和下载),最后直接从官方lib库(Index of /downloads/libs)下载编译所需文件:

  • 安装libav需要libx264,先装libx264

wget -c http://files.freeswitch.org/downloads/libs/libx264.tar.bz2

tar -jxvf libx264.tar.bz2

./configure --enable-static --enable-shared --prefix=/usr

make

make install

cp /usr/lib/pkgconfig/x264.pc /usr/lib64/pkgconfig/

cp /usr/lib/libx264.so /usr/lib64/

cp /usr/lib/libx264.a /usr/lib64/

  • 下载安装libav

下载:wget -c http://files.freeswitch.org/downloads/libs/libav-12.tar.bz2

解压:tar -jxvf libav-12.tar.bz2

编译:./configure --enable-pic --enable-shared --enable-libx264 --enable-gpl --extra-libs=“-ldl” --extra-cflags=-I/usr/include --extra-ldflags=-L/usr/lib64

安装:make

make提示**libav  make: *** No rule to make target util.asm', needed by libavresample/x86/audio_convert.o’.  Stop.**可以删了解压目录重新解压安装。

安装:make install

cp /usr/local/lib/pkgconfig/libavcodec.pc /usr/local/lib/pkgconfig/libavdevice.pc /usr/local/lib/pkgconfig/libavfilter.pc /usr/local/lib/pkgconfig/libavformat.pc /usr/local/lib/pkgconfig/libavresample.pc /usr/local/lib/pkgconfig/libavutil.pc /usr/local/lib/pkgconfig/libswscale.pc /usr/lib64/pkgconfig/

ldconfig    # 执行刷新,以让FreeSWITCH运行时可以找到库

###################################

# 如果编译完成 libav 以后,启动 mod_av 还是找不到库,可以用以下方式加载动态库路径

# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

# export LD_LIBRARY_PATH

###################################

  • (十三)安装freeswitch提示lua.h错误

安装freeswitch模块,如执行make后提示mod_lua.cpp:37:10: fatal error: lua.h: No such file or directory、[Makefile:1040: libluamod_la-mod_lua.lo] Error 1,如下:

根据提示需要安装lua-devel,执行安装:

yum install lua-devel

  • (十四)安装freeswitch提示libopus-dev错误

安装freeswitch模块,如执行make后提示Makefile:967: *** You must install libopus-dev to build mod_opus.  Stop.,如下:

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Linux运维工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Linux运维知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加VX:vip1024b (备注Linux运维获取)
img

最后的话

最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!

资料预览

给大家整理的视频资料:

给大家整理的电子书资料:

如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
img

更新**

如果你觉得这些内容对你有帮助,可以添加VX:vip1024b (备注Linux运维获取)
[外链图片转存中…(img-4vYZIrY7-1712660730086)]

最后的话

最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!

资料预览

给大家整理的视频资料:

[外链图片转存中…(img-J9PG9vZj-1712660730086)]

给大家整理的电子书资料:

[外链图片转存中…(img-38untUqJ-1712660730086)]

如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
[外链图片转存中…(img-NgJGgYgC-1712660730087)]

  • 10
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值