云服务器 Ubuntu16镜像搭建FreeSwitch

简介

freeswitch官网:https://freeswitch.com/。FreeSWITCH是一个开源的电话软交换平台,主要开发语言是C,某些模块中使用了C++,以 MPL1.1发布。

安装部署

本文环境是使用的Ubuntu16.04,其他版本是否可用请自行测试。
1、安装依赖库

apt-get install libedit-dev libldns-dev libpcre3-dev libspeexdsp-dev libspeex-dev libcurl4-openssl-dev
 libopus-dev libncurses5-dev libtiff-dev libjpeg-dev libssl-dev libsqlite3-dev build-essential automake 
autoconf git-core wget libtool lua5.1 liblua5.1-dev libsndfile1-dev yasm libsndfile-dev libtool-bin sqlite3

2、git 拉取freeswitch仓库
cd 到自己想存放源代码的目录,然后

git clone https://stash.freeswitch.org/scm/fs/freeswitch.git

3、编译安装
cd 到源代码根目录

sudo ./bootstrap.sh
sudo ./configure
sudo make install
##安装声音相关模块
make cd-sounds-install
make cd-moh-install

4、链接启动方式
默认的安装位置在/usr/local/freeswitch上,如果不做链接,我们要启动bin文件下的命令时,只能cd到此目录下或者以完整路径名来执行,我们为了方便,进行链接后可以在随意目录下执行,系统会自动去搜寻相关文件来执行命令,配置命令如下:

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

接下来就可以启动freeswitch了,常用命令有:

freeswitch  ##启动,带日志输出
freeswitch -nc##后台启动
/exit ##退出fs_cli
shutdown ##关闭freeswitch
./fs_cli ##启动日志窗口
sofia status profile internal reg ##显示注册用户

至此,freeswitch就算配置好了。最后还要开放一组端口,这个别忘了。端口列表如下:

端口 类型 说明
1719 UDP H.323 Gatekeeper RAS port
1720 TCP H.323 Call Signaling
3478 UDP STUN service Used for NAT traversal
3479 UDP STUN service Used for NAT traversal
5002 TCP MLP protocol server
5003 UDP Neighborhood service
5060 UDP & TCP SIP UAS
5070 UDP & TCP SIP UAS
5080 UDP & TCP SIP UAS
8021 TCP ESL
16384-32768 UDP RTP/ RTCP multimedia streaming
5066 TCP Websocket
7443 TCP Websocket

开放好这些端口后就可以用sip客户端进行测试了,默认测试账号为:1000-1019这些账号,密码为1234,如果想自己新建账号可以查看官方文档或者Google搜索相关教程。本文旨在记录整个配置过程,等再研究清楚其他东西后再做记录。

猜你喜欢

转载自blog.csdn.net/weixin_34050389/article/details/87213756