整理FreeSWITCH目录下的文件
This commit is contained in:
parent
3342599e73
commit
2107ef5673
@ -15,16 +15,17 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
title: "FreeSWITCH",
|
title: "FreeSWITCH",
|
||||||
children: [
|
children: [
|
||||||
"/freeswitch/安装freeswitch1.6",
|
"/freeswitch/Ubuntu16.04安装FreeSWITCH1.6",
|
||||||
"/freeswitch/Debian11安装FreeSWITCH1.10",
|
"/freeswitch/Debian11安装FreeSWITCH1.10",
|
||||||
"/freeswitch/Debian11安装FreeSWITCH1.10-参照ClueCon官方文档",
|
"/freeswitch/Debian11安装FreeSWITCH1.10-参照ClueCon官方文档",
|
||||||
"/freeswitch/Debian11安装lua和luarocks",
|
"/freeswitch/Debian11安装lua和luarocks",
|
||||||
"/freeswitch/为FreeSWITCH安装mod_unimrcp模块",
|
"/freeswitch/为FreeSWITCH安装mod_unimrcp模块",
|
||||||
"/freeswitch/FreeSWITCH对接阿里云MRCP",
|
"/freeswitch/FreeSWITCH对接阿里云MRCP",
|
||||||
"/freeswitch/freeswitch对接百度mrcp",
|
"/freeswitch/FreeSWITCH对接百度mrcp",
|
||||||
"/freeswitch/freeswitch配置ssl",
|
"/freeswitch/FreeSWITCH配置SSL",
|
||||||
"/freeswitch/搭建STUN服务",
|
"/freeswitch/搭建STUN服务",
|
||||||
"/freeswitch/恶意SIP行为IP黑名单",
|
"/freeswitch/恶意SIP行为IP黑名单",
|
||||||
|
"/freeswitch/Debian11中注册FreeSWITCH为系统服务",
|
||||||
],
|
],
|
||||||
initialOpenGroupIndex: 0, // 可选的, 默认值是 0
|
initialOpenGroupIndex: 0, // 可选的, 默认值是 0
|
||||||
sidebarDepth: 0, // 可选的, 默认值是 1
|
sidebarDepth: 0, // 可选的, 默认值是 1
|
||||||
|
@ -1,108 +1,307 @@
|
|||||||
# ubuntu16.04安装FreeSWITCH1.6
|
# 在ubuntu16.04系统上安装freeswitch1.6
|
||||||
|
|
||||||
## 基本安装
|
------
|
||||||
|
|
||||||
### (可省)更换阿里源
|
## 操作系统和软件版本
|
||||||
|
|
||||||
```shell
|
ubuntu16.04
|
||||||
vim /etc/apt/source.list
|
|
||||||
|
freeswitch v1.6
|
||||||
|
|
||||||
|
python2.7
|
||||||
|
|
||||||
|
lua5.3
|
||||||
|
|
||||||
|
## 准备工作
|
||||||
|
|
||||||
|
### 安装系统
|
||||||
|
|
||||||
|
最小安装ubuntu16.04系统,安装ssh server
|
||||||
|
|
||||||
|
### 网络等必要配置
|
||||||
|
|
||||||
|
根据实际网络环境和个要习惯来配置
|
||||||
|
|
||||||
|
- 静态IP:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo vim /etc/network/interfaces
|
||||||
```
|
```
|
||||||
|
|
||||||
```plaint
|
示例(根据实际情况设置,照抄大概率无效)
|
||||||
deb https://mirrors.aliyun.com/ubuntu/ xenial main
|
|
||||||
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main
|
```txt
|
||||||
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
|
auto eth0
|
||||||
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main
|
iface eth0 inet static
|
||||||
deb https://mirrors.aliyun.com/ubuntu/ xenial universe
|
address 192.168.0.234
|
||||||
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
|
netmask 255.255.255.0
|
||||||
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
|
gateway 192.168.0.1
|
||||||
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
|
dns-nameserver 219.148.204.66
|
||||||
deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
|
dns-nameserver 219.149.6.99
|
||||||
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
|
dns-nameserver 114.114.114.114
|
||||||
deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
|
|
||||||
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 系统更新
|
- root登录:
|
||||||
|
|
||||||
```shell
|
```bash
|
||||||
|
sudo vim /etc/ssh/sshd_config
|
||||||
|
```
|
||||||
|
|
||||||
|
- root密码:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo passwd root
|
||||||
|
```
|
||||||
|
|
||||||
|
- 修改更新源:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo vim /etc/apt/sources.list
|
||||||
|
```
|
||||||
|
|
||||||
|
```txt
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ xenial main
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
|
||||||
|
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
|
||||||
|
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
|
||||||
|
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
|
||||||
|
```
|
||||||
|
|
||||||
|
> 在mirrors.aliyun.com里可以查看具体配置方法
|
||||||
|
|
||||||
|
- 更新系统
|
||||||
|
|
||||||
|
```bash
|
||||||
apt update && apt upgrade -y
|
apt update && apt upgrade -y
|
||||||
```
|
```
|
||||||
|
|
||||||
### 安装依赖
|
### 安装依赖
|
||||||
|
|
||||||
```shell
|
- apt部分
|
||||||
apt-get install -y git build-essential automake autoconf libtool g++ zlib1g-dev libjpeg-dev libncurses5-dev libsqlite3-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libssl-dev pkg-config yasm lua5.2 liblua5.2-dev liblua5.2 libopus-dev libsndfile-dev libtool libpq-dev pkg-config libtiff5-dev libtiff5 libvpx-dev libvpx3 libvpx3 libopus-dev uuid-dev libsndfile-dev ffmpeg python python-dev libmpg123-dev libshout3-dev libmp3lame-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
### 安装cmake
|
|
||||||
|
|
||||||
> 这个过程比较消耗时间
|
|
||||||
|
|
||||||
```shell
|
|
||||||
cd /opt
|
|
||||||
wget https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz
|
|
||||||
tar zxvf cmake-3.25.1.tar.gz
|
|
||||||
cd cmake-3.25.1
|
|
||||||
./bootstrap
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
```
|
|
||||||
|
|
||||||
### 安装FreeSWITCH
|
|
||||||
|
|
||||||
> github可能经常连不上,所以git clone这一步可以在安装依赖或者安装cmake时开新终端同步来搞,多试几次
|
|
||||||
|
|
||||||
```shell
|
|
||||||
cd /opt
|
|
||||||
git clone -b v1.6 https://github.com/signalwire/freeswitch.git
|
|
||||||
git clone https://github.com/signalwire/libks.git
|
|
||||||
git clone https://github.com/signalwire/signalwire-c.git
|
|
||||||
# 编译freeswitch
|
|
||||||
cd freeswitch
|
|
||||||
./bootstrap.sh -j
|
|
||||||
./configure
|
|
||||||
cd ..
|
|
||||||
# 编译安装libks
|
|
||||||
cd libks/
|
|
||||||
cmake .
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
cd ..
|
|
||||||
# 编译安装signalwire-c
|
|
||||||
cd signalwire-c
|
|
||||||
cmake .
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
cp /usr/local/lib/pkgconfig/.pc /usr/lib/pkgconfig/
|
|
||||||
cp -f /usr/local/lib/ /lib64/
|
|
||||||
cd ..
|
|
||||||
# 安装freeswitch
|
|
||||||
cd freeswitch
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
ln -s /usr/local/freeswitch/bin/* /usr/bin/
|
|
||||||
```
|
|
||||||
|
|
||||||
### 安装声音
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make sounds-install && \
|
sudo apt install python-dev swig ffmpeg yasm unixodbc-dev libshout3-dev libmpg123-dev libmp3lame-dev libsndfile-dev autoconf automake devscripts libopus-dev libvorbis0a libogg0 libogg-dev libvorbis-dev gawk g++ git-core libjpeg-dev libncurses5-dev libtool-bin pkg-config libtiff5-dev libperl-dev libgdbm-dev libdb-dev gettext libssl-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libedit-dev libldns-dev libpq-dev
|
||||||
make moh-install && \
|
|
||||||
make cd-sounds-install && \
|
|
||||||
make cd-moh-install && \
|
|
||||||
make uhd-sounds-install && \
|
|
||||||
make uhd-moh-install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 安装模块
|
如果需要开启mod_lua模块,还需要安装lua
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install lua5.3 liblua5.3-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
- pip安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
||||||
|
python get-pip.py
|
||||||
|
pip install pydub
|
||||||
|
pip install python-ESL
|
||||||
|
pip install pika
|
||||||
|
pip install dbutils
|
||||||
|
```
|
||||||
|
|
||||||
|
### 下载源码
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/signalwire/freeswitch.git
|
||||||
|
cd freeswitch
|
||||||
|
git checkout v1.6
|
||||||
|
git remote rm origin
|
||||||
|
```
|
||||||
|
|
||||||
|
> 最后一句是断开本地目录和远程代码库的关联
|
||||||
|
|
||||||
|
## 安装freeswitch
|
||||||
|
|
||||||
|
- 配置lua(如果不需要mod_lua模块,可跳过)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp /usr/include/lua5.3/*.h src/mod/languages/mod_lua/
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/lib/x86_64-linux-gnu/liblua.so
|
||||||
|
```
|
||||||
|
|
||||||
|
- 预处理
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ./bootstrap.sh -j
|
||||||
|
```
|
||||||
|
|
||||||
|
- 预配置模块
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /opt/freeswitch
|
|
||||||
vim modules.conf
|
vim modules.conf
|
||||||
# 为下面这几行解除注释
|
```
|
||||||
# mod_unimrcp
|
|
||||||
# mod_shout
|
打开注释
|
||||||
# mod_python
|
|
||||||
# mod_xml_curl
|
```conf
|
||||||
|
formats/mod_shout
|
||||||
|
languages/mod_python
|
||||||
|
event_handlers/mod_cdr_pg_csv
|
||||||
|
asr_tts/mod_unimrcp
|
||||||
|
```
|
||||||
|
|
||||||
|
如果不需要使用lua语言模块,则将下面内容加注释
|
||||||
|
|
||||||
|
```conf
|
||||||
|
#languages/mod_lua
|
||||||
|
```
|
||||||
|
|
||||||
|
- 预编译
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./configure --with-python=/usr/bin/python2.7 --with-lua=/usr/bin/lua5.3 --enable-core-pgsql-support
|
||||||
|
```
|
||||||
|
|
||||||
|
- 编译安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo make
|
||||||
|
sudo make mod_cdr_pg_csv-install
|
||||||
|
sudo make mod_unimrcp-install
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
- 安装声音包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo make sounds-install
|
||||||
|
sudo make moh-install
|
||||||
|
sudo make cd-sounds-install
|
||||||
|
sudo make cd-moh-install
|
||||||
|
sudo make uhd-sounds-install
|
||||||
|
sudo make uhd-moh-install
|
||||||
|
```
|
||||||
|
|
||||||
|
- 建立软连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/
|
||||||
|
sudo ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/
|
||||||
|
```
|
||||||
|
|
||||||
|
- 配置mod
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vim /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
打开注释
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<load module="mod_python"/>
|
||||||
|
<load module="mod_shout"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
添加配置
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<load module="mod_cdr_pg_csv"/>
|
||||||
|
<load module="mod_unimrcp"/>
|
||||||
|
<load module="mod_vad"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
如果不需要lua支持,则注释下面内容
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<!-- <load module="mod_lua"> -->
|
||||||
|
```
|
||||||
|
|
||||||
|
- 配置acl白名单
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vim /usr/local/freeswitch/conf/autoload_configs/acl.conf.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
根据自己网络的实际情况进行配置(照抄大概率无效)
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<list name="domains" default="deny">
|
||||||
|
<!-- domain= is special it scans the domain from the directory to build t$ -->
|
||||||
|
<node type="allow" domain="$${domain}"/>
|
||||||
|
<!-- use cidr= if you wish to allow ip ranges to this domains acl. -->
|
||||||
|
<!-- <node type="allow" cidr="192.168.0.0/24"/> -->
|
||||||
|
<node type="allow" cidr="192.168.0.112/24"/>
|
||||||
|
<node type="allow" cidr="192.168.0.50/24"/>
|
||||||
|
<!-- ==================这里添加 本机ip 127.0.0.1 ======================== -->
|
||||||
|
<!-- ==================这里添加 本机内网ip ======================== -->
|
||||||
|
<!-- ==================这里添加 本机外网ip ======================== -->
|
||||||
|
<!-- ==================这里添加 web内网ip 192.168.2.173======================== -->
|
||||||
|
<!-- ==================这里添加 web外网ip 39.107.68.127======================== -->
|
||||||
|
<!-- ==================这里添加 runcall 内外网Ip======================== -->
|
||||||
|
<node type="allow" cidr="192.168.2.178/24"/>
|
||||||
|
<node type="allow" cidr="39.107.70.84/24"/>
|
||||||
|
</list>
|
||||||
|
```
|
||||||
|
|
||||||
|
- 配置ESL
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vim /usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<configuration name="event_socket.conf" description="Socket Client">
|
||||||
|
<settings>
|
||||||
|
<param name="nat-map" value="false"/>
|
||||||
|
<!--ip 统一为0.0.0.0-->
|
||||||
|
<param name="listen-ip" value="0.0.0.0"/>
|
||||||
|
<!-- 端口号 默认8021 -->
|
||||||
|
<param name="listen-port" value="8021"/>
|
||||||
|
<!-- 密码统一Aicyber -->
|
||||||
|
<param name="password" value="Aicyber"/>
|
||||||
|
<!-- 允许acl白名单内的IP 访问 -->
|
||||||
|
<param name="apply-inbound-acl" value="domains"/>
|
||||||
|
<!--<param name="apply-inbound-acl" value="loopback.auto"/>-->
|
||||||
|
<!--<param name="stop-on-bind-error" value="true"/>-->
|
||||||
|
</settings>
|
||||||
|
</configuration>
|
||||||
|
```
|
||||||
|
|
||||||
|
- 配置VAD(可暂时省略)
|
||||||
|
|
||||||
|
把mod_vad.so(到已经配置好的服务器上去拉)和mod_G729.so(已经有了)放到/usr/local/freeswitch/mod目录下,并给可执行权
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x mod_vad.so
|
||||||
|
```
|
||||||
|
|
||||||
|
- 配置网关(可暂时省略)
|
||||||
|
|
||||||
|
在/usr/local/freeswitch/conf/sip_profiles/external 目录下上传网关模板gw1.xml(这个模板在动态生成xml时会用到)
|
||||||
|
|
||||||
|
手动添加网关配置(可暂时省略)
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<include>
|
||||||
|
<gateway name="gw1"><!--PSTN -->
|
||||||
|
<param name="realm" value="192.168.0.153"/>
|
||||||
|
<param name="register" value="false"/>
|
||||||
|
</gateway>
|
||||||
|
</include>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. 启动freeswitch
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freeswitch -nc
|
||||||
|
```
|
||||||
|
|
||||||
|
通过fs_cli可以进入freeswitch控制台(freeswitch服务启动需要等一段时间,而且可能会很长)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fs_cli --password=Aicyber
|
||||||
```
|
```
|
||||||
|
@ -1,307 +0,0 @@
|
|||||||
# 在ubuntu16.04系统上安装freeswitch1.6
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
## 操作系统和软件版本
|
|
||||||
|
|
||||||
ubuntu16.04
|
|
||||||
|
|
||||||
freeswitch v1.6
|
|
||||||
|
|
||||||
python2.7
|
|
||||||
|
|
||||||
lua5.3
|
|
||||||
|
|
||||||
## 准备工作
|
|
||||||
|
|
||||||
### 安装系统
|
|
||||||
|
|
||||||
最小安装ubuntu16.04系统,安装ssh server
|
|
||||||
|
|
||||||
### 网络等必要配置
|
|
||||||
|
|
||||||
根据实际网络环境和个要习惯来配置
|
|
||||||
|
|
||||||
- 静态IP:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo vim /etc/network/interfaces
|
|
||||||
```
|
|
||||||
|
|
||||||
示例(根据实际情况设置,照抄大概率无效)
|
|
||||||
|
|
||||||
```txt
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet static
|
|
||||||
address 192.168.0.234
|
|
||||||
netmask 255.255.255.0
|
|
||||||
gateway 192.168.0.1
|
|
||||||
dns-nameserver 219.148.204.66
|
|
||||||
dns-nameserver 219.149.6.99
|
|
||||||
dns-nameserver 114.114.114.114
|
|
||||||
```
|
|
||||||
|
|
||||||
- root登录:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo vim /etc/ssh/sshd_config
|
|
||||||
```
|
|
||||||
|
|
||||||
- root密码:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo passwd root
|
|
||||||
```
|
|
||||||
|
|
||||||
- 修改更新源:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo vim /etc/apt/sources.list
|
|
||||||
```
|
|
||||||
|
|
||||||
```txt
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ xenial main
|
|
||||||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
|
|
||||||
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
|
|
||||||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
|
|
||||||
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
|
|
||||||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
|
|
||||||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
|
|
||||||
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
|
|
||||||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
|
|
||||||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
|
|
||||||
```
|
|
||||||
|
|
||||||
> 在mirrors.aliyun.com里可以查看具体配置方法
|
|
||||||
|
|
||||||
- 更新系统
|
|
||||||
|
|
||||||
```bash
|
|
||||||
apt update && apt upgrade -y
|
|
||||||
```
|
|
||||||
|
|
||||||
### 安装依赖
|
|
||||||
|
|
||||||
- apt部分
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo apt install python-dev swig ffmpeg yasm unixodbc-dev libshout3-dev libmpg123-dev libmp3lame-dev libsndfile-dev autoconf automake devscripts libopus-dev libvorbis0a libogg0 libogg-dev libvorbis-dev gawk g++ git-core libjpeg-dev libncurses5-dev libtool-bin pkg-config libtiff5-dev libperl-dev libgdbm-dev libdb-dev gettext libssl-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libedit-dev libldns-dev libpq-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
如果需要开启mod_lua模块,还需要安装lua
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo apt install lua5.3 liblua5.3-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
- pip安装
|
|
||||||
|
|
||||||
```bash
|
|
||||||
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
|
||||||
python get-pip.py
|
|
||||||
pip install pydub
|
|
||||||
pip install python-ESL
|
|
||||||
pip install pika
|
|
||||||
pip install dbutils
|
|
||||||
```
|
|
||||||
|
|
||||||
### 下载源码
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/signalwire/freeswitch.git
|
|
||||||
cd freeswitch
|
|
||||||
git checkout v1.6
|
|
||||||
git remote rm origin
|
|
||||||
```
|
|
||||||
|
|
||||||
> 最后一句是断开本地目录和远程代码库的关联
|
|
||||||
|
|
||||||
## 安装freeswitch
|
|
||||||
|
|
||||||
- 配置lua(如果不需要mod_lua模块,可跳过)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cp /usr/include/lua5.3/*.h src/mod/languages/mod_lua/
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/lib/x86_64-linux-gnu/liblua.so
|
|
||||||
```
|
|
||||||
|
|
||||||
- 预处理
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./bootstrap.sh -j
|
|
||||||
```
|
|
||||||
|
|
||||||
- 预配置模块
|
|
||||||
|
|
||||||
```bash
|
|
||||||
vim modules.conf
|
|
||||||
```
|
|
||||||
|
|
||||||
打开注释
|
|
||||||
|
|
||||||
```conf
|
|
||||||
formats/mod_shout
|
|
||||||
languages/mod_python
|
|
||||||
event_handlers/mod_cdr_pg_csv
|
|
||||||
asr_tts/mod_unimrcp
|
|
||||||
```
|
|
||||||
|
|
||||||
如果不需要使用lua语言模块,则将下面内容加注释
|
|
||||||
|
|
||||||
```conf
|
|
||||||
#languages/mod_lua
|
|
||||||
```
|
|
||||||
|
|
||||||
- 预编译
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./configure --with-python=/usr/bin/python2.7 --with-lua=/usr/bin/lua5.3 --enable-core-pgsql-support
|
|
||||||
```
|
|
||||||
|
|
||||||
- 编译安装
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo make
|
|
||||||
sudo make mod_cdr_pg_csv-install
|
|
||||||
sudo make mod_unimrcp-install
|
|
||||||
sudo make install
|
|
||||||
```
|
|
||||||
|
|
||||||
- 安装声音包
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo make sounds-install
|
|
||||||
sudo make moh-install
|
|
||||||
sudo make cd-sounds-install
|
|
||||||
sudo make cd-moh-install
|
|
||||||
sudo make uhd-sounds-install
|
|
||||||
sudo make uhd-moh-install
|
|
||||||
```
|
|
||||||
|
|
||||||
- 建立软连接
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/
|
|
||||||
sudo ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/
|
|
||||||
```
|
|
||||||
|
|
||||||
- 配置mod
|
|
||||||
|
|
||||||
```bash
|
|
||||||
vim /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
|
|
||||||
```
|
|
||||||
|
|
||||||
打开注释
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<load module="mod_python"/>
|
|
||||||
<load module="mod_shout"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
添加配置
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<load module="mod_cdr_pg_csv"/>
|
|
||||||
<load module="mod_unimrcp"/>
|
|
||||||
<load module="mod_vad"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
如果不需要lua支持,则注释下面内容
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<!-- <load module="mod_lua"> -->
|
|
||||||
```
|
|
||||||
|
|
||||||
- 配置acl白名单
|
|
||||||
|
|
||||||
```bash
|
|
||||||
vim /usr/local/freeswitch/conf/autoload_configs/acl.conf.xml
|
|
||||||
```
|
|
||||||
|
|
||||||
根据自己网络的实际情况进行配置(照抄大概率无效)
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<list name="domains" default="deny">
|
|
||||||
<!-- domain= is special it scans the domain from the directory to build t$ -->
|
|
||||||
<node type="allow" domain="$${domain}"/>
|
|
||||||
<!-- use cidr= if you wish to allow ip ranges to this domains acl. -->
|
|
||||||
<!-- <node type="allow" cidr="192.168.0.0/24"/> -->
|
|
||||||
<node type="allow" cidr="192.168.0.112/24"/>
|
|
||||||
<node type="allow" cidr="192.168.0.50/24"/>
|
|
||||||
<!-- ==================这里添加 本机ip 127.0.0.1 ======================== -->
|
|
||||||
<!-- ==================这里添加 本机内网ip ======================== -->
|
|
||||||
<!-- ==================这里添加 本机外网ip ======================== -->
|
|
||||||
<!-- ==================这里添加 web内网ip 192.168.2.173======================== -->
|
|
||||||
<!-- ==================这里添加 web外网ip 39.107.68.127======================== -->
|
|
||||||
<!-- ==================这里添加 runcall 内外网Ip======================== -->
|
|
||||||
<node type="allow" cidr="192.168.2.178/24"/>
|
|
||||||
<node type="allow" cidr="39.107.70.84/24"/>
|
|
||||||
</list>
|
|
||||||
```
|
|
||||||
|
|
||||||
- 配置ESL
|
|
||||||
|
|
||||||
```bash
|
|
||||||
vim /usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml
|
|
||||||
```
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<configuration name="event_socket.conf" description="Socket Client">
|
|
||||||
<settings>
|
|
||||||
<param name="nat-map" value="false"/>
|
|
||||||
<!--ip 统一为0.0.0.0-->
|
|
||||||
<param name="listen-ip" value="0.0.0.0"/>
|
|
||||||
<!-- 端口号 默认8021 -->
|
|
||||||
<param name="listen-port" value="8021"/>
|
|
||||||
<!-- 密码统一Aicyber -->
|
|
||||||
<param name="password" value="Aicyber"/>
|
|
||||||
<!-- 允许acl白名单内的IP 访问 -->
|
|
||||||
<param name="apply-inbound-acl" value="domains"/>
|
|
||||||
<!--<param name="apply-inbound-acl" value="loopback.auto"/>-->
|
|
||||||
<!--<param name="stop-on-bind-error" value="true"/>-->
|
|
||||||
</settings>
|
|
||||||
</configuration>
|
|
||||||
```
|
|
||||||
|
|
||||||
- 配置VAD(可暂时省略)
|
|
||||||
|
|
||||||
把mod_vad.so(到已经配置好的服务器上去拉)和mod_G729.so(已经有了)放到/usr/local/freeswitch/mod目录下,并给可执行权
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod +x mod_vad.so
|
|
||||||
```
|
|
||||||
|
|
||||||
- 配置网关(可暂时省略)
|
|
||||||
|
|
||||||
在/usr/local/freeswitch/conf/sip_profiles/external 目录下上传网关模板gw1.xml(这个模板在动态生成xml时会用到)
|
|
||||||
|
|
||||||
手动添加网关配置(可暂时省略)
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<include>
|
|
||||||
<gateway name="gw1"><!--PSTN -->
|
|
||||||
<param name="realm" value="192.168.0.153"/>
|
|
||||||
<param name="register" value="false"/>
|
|
||||||
</gateway>
|
|
||||||
</include>
|
|
||||||
```
|
|
||||||
|
|
||||||
## 4. 启动freeswitch
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freeswitch -nc
|
|
||||||
```
|
|
||||||
|
|
||||||
通过fs_cli可以进入freeswitch控制台(freeswitch服务启动需要等一段时间,而且可能会很长)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
fs_cli --password=Aicyber
|
|
||||||
```
|
|
Loading…
Reference in New Issue
Block a user