freeswitch 1.10版本 centos7安装

简介

FreeSWITCH 是一个电话的软交换解决方案,包括一个软电话和软交换机用以提供语音和聊天的产品驱动。FreeSWITCH 可以用作交换机引擎、PBX、多媒体网关以及多媒体服务器等。

FreeSWITCH 支持多种通讯技术标准,包括 SIP, H.323, IAX2 以及 GoogleTalk ,可以方便的与其他开源的PBX系统进行对接,例如 sipX, OpenPBX, Bayonne, YATE 或者 Asterisk.

FreeSWITCH 支持许多高级的 SIP 特性,例如 presence/BLF/SLA 、TCP TLS 和 sRTP,它还可以用来作为类似于 SBC (Session Border Controller) 的透明代理。

FreeSWITCH 是一个开源的电话交换平台,从一个简单的软电话客户端到运营商级的软交换设备几乎无所不能。能原生地运行于Windows、Max OS X、Linux、BSD 及 solaris 等诸多32/64位平台。可以用作一个简单的交换引擎、一个PBX,一个媒体网关或媒体支持IVR的服务器等。它支持SIP、H323、Skype、Google Talk等协议,并能很容易地与各种开源的PBX系统如sipXecs、Call Weaver、Bayonne、YATE及Asterisk等通信。

安装

安装yum数据源
lizhenghao
pat_rSr5EbxhSBMSW7a1Wz1dR2xQ

echo "signalwire" > /etc/yum/vars/signalwireusername
echo "TOKEN" > /etc/yum/vars/signalwiretoken
yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release

安装所需要的依赖包
升级 gcc到最新版本(gcc-9)

yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
scl enable devtoolset-9 'bash'
source /etc/profile

依赖包libavformat-dev
下载界面:
http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release.html

rpm -Uvh cheese-release*rpm

或者直接下载更新

rpm -Uvh http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release-7-1.noarch.rpm

 yum -y install libavformat-devel
 yum -y install libswscale-devel

开启mod_av需要的依赖包 (暂时没找到)如果没有安装 则需要取消编译mod_av
取消视频模块 mod_nuimrcp模块

yum -y install libavresample-dev  (暂未找到)
vim ./build/modules.conf.in
#applications/mod_av

编译时检查此文件有没有注释#applications/mod_av
vim /usr/local/src/freeswitch/modules.conf 
  #applications/mod_av
  

其他make时需要的依赖包

yum -y install fltk  fltk-devel
yum -y install libtiff-devel 
yum -y install libjpeg-turbo-devel
yum -y install speex*
yum -y install libedit-devel
yum -y install libcurl-devel.x86_64
yum -y install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel openssl-devel
yum -y install yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git

yum -y install  git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel python-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel libshout-devel libmpg123-devel lame-devel

安装缺少的用于生成RPM包的依赖项

yum-builddep -y freeswitch --skip-broken

git下载编译安装 spandsp、sofia-sip

cd /usr/local/src/
git clone https://ghproxy.com/https://github.com/freeswitch/spandsp.git
cd spandsp/
./configure
make 
make install
cd /usr/local/src/
git clone https://ghproxy.com/https://github.com/freeswitch/sofia-sip.git
cd sofia-sip/
./configure
make 
make install

安装spandsp、sofia-sip后
至少应该在哪里列出

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

 ls /usr/local/lib/pkgconfig
 sofia-sip-ua.pc  spandsp.pc

git下载1.10版本的的freeswitch 源码包(如果下载其他版本可自行修改版本号)

cd /usr/local/src/
git clone -b v1.10 https://ghproxy.com/https://github.com/signalwire/freeswitch.git freeswitch
cd freeswitch
./bootstrap.sh -j

./configure  CFLAGS="-Wno-error" --enable-portable-binary \
            --prefix=/usr/local/freeswitch --localstatedir=/var/freeswitch --sysconfdir=/etc/freeswitch \
            --with-gnu-ld --with-python --with-erlang --with-openssl \
            --enable-core-odbc-support --enable-zrtp 
make
make -j8 install    (使用make -j后面跟一个数字,比如make -j8 即绑定8个cpu同时编译,提高效率)

./configure 提示此界面为 编译成功
在这里插入图片描述

安装声音文件(make的时候可以自动下载,下载较慢,可以用通过迅雷下载链接下载上传)

cd /usr/local/src/freeswitch

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



上传文件(命令可直接下载,但是很慢)
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-8000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-16000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-32000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-48000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-8000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-16000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-32000-1.0.52.tar.gz
http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-48000-1.0.52.tar.gz


make  cd-sounds-install  //CD音质
make cd-moh-install     //CD音质
或者
make sounds-install             //8K音质
make moh-install                  //8K音质



配置freeswitch在任何一个路径都可以运行

ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/ 
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/

freeswitch -nc  后台启动
fs_cli  进入命令 


带界面启动:-c
后台运行:-nc
退出:shutdown 
设置日志级别(console loglevel help可以查看6的含义):console loglevel 6
查看服务器运行状态:status
查看有多少用户已注册:sofia status profile internal reg
退出fs_cli(不关闭fs):/bye

看到此界面是启动成功,可以看到5060的端口
在这里插入图片描述

vim /usr/local/src/freeswitch/src/mod/event_handlers/mod_event_socket/conf/autoload_configs/event_socket.conf.xml
将ip改为127.0.0.1改成0.0.0.0

在这里插入图片描述

使用ODBC连接mysql

yum在线安装驱动

yum -y install  unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel openssl-devel

yum -y install mysql-connector-odbc

ODBC配置:

vim /etc/odbc.ini

[freeswitch]
Description=MySQL realtime database
Driver=/usr/lib64/libmyodbc8w.so      ##根据/etc/odbcinst.ini中MySQL ODBC 8.0 Unicode Driver来定
SERVER=192.168.253.11       ##数据库连接地址
PORT=8809 	 				##数据库端口号
DATABASE=freeswitch			##数据库库名
OPTION=67108864					
CHARSET=UTF8
USER=frees					##数据库连接用户	
PASSWORD=Zz123..0			##用户密码
Threading=0

vim  /etc/odbcinst.ini


[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
UsageCount=8

[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
UsageCount=8

                

输入:isql -v freeswitch测试是否能够连通:
在这里插入图片描述
安装php–为freeswitch后期扩展开发预备

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

//查看
yum search php72w
//安装php以及扩展
yum install php72w php72w-fpm php72w-cli php72w-common php72w-devel php72w-gd php72w-pdo php72w-mysql php72w-mbstring php72w-bcmath

可能出现的问题

[root@centos2 nasm-2.14]# yum -y install libedit-devel
已加载插件:fastestmirror

解决办法:

1. (可能没有modules.conf文件,请使用第二条)
vi /usr/local/src/freeswitch/modules.conf
将enabled=1改为enabled=0
2.修改yum的配置文件
 vi /etc/yum.conf
将plugins=1改为plugins=0
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值