https://blog.csdn.net/shizidushu/article/details/141127680
https://blog.csdn.net/lxcw_sir/article/details/136905959
https://www.opensourcelisting.com/how-to-install-freeswitch-on-ubuntu-22-04/#google_vignette
apt install -y openssh-server net-tools vim git
apt install -y gcc g++ autoconf automake make cmake yasm uuid-dev libvpx-dev unixodbc-dev ncurses-dev zlib1g-dev libjpeg-dev libtiff-dev liblua5.1-0-dev libsqlite3-dev libsndfile-dev libavformat-dev libswscale-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libedit-dev libtool libldns-dev libopus-dev libpq-dev
ldconfig && ldconfig -p | grep libks
1.conf/vars.xml 修改external_rtp_ip 、external_sip_ip 为本机IP
<X-PRE-PROCESS cmd="stun-set" data="external_rtp_ip=10.161. "/>
<X-PRE-PROCESS cmd="stun-set" data="external_sip_ip=10.161. "/>
--------------------
2.修改: 默认密码<X-PRE-PROCESS cmd="set" data="default_password=0212"/>
------------------------------------------
3.autoload_configs/modules.conf 注释掉的 module
<!-- <load module="mod_signalwire"/> -->
mod_signalwire
mod_verto
mod_av
4.conf\sip_profiles\internal.xml,external.xml,internal-ipv6.xml,external-ipv6.xml
<param name="rtp-timeout-sec" value="300"/>
<param name="rtp-hold-timeout-sec" value="1800"/>
参数名称过期了换成 rtp-timeout-sec-》media_timeout ,rtp-hold-timeout-sec-》media_hold_timeout
<param name="media_timeout" value="300"/>
<param name="media_hold_timeout" value="1800"/>
------------------------------------
5.播号计划放在dialplan\default目录下,因为在default.xml定义了这个引用,按f6重启生效
ivr_menus目录只定义菜单
-----------------
6.配置postgresql
6.1、switch.conf.xml
<param name="core-db-dsn" value="pgsql://hostaddr=10.161.83.24 dbname=freeswitch user=freeswitch password='12345' options='-c client_min_messages=NOTICE' application_name='freeswtich'"/>
!!!!!!!!-----<param name="auto-create-schemas" value="false"/> ------- !!!!!!!!--------这个一定要配置为FALSE ,否则清库
6.2、cdr_pg_csv.conf.xml
<!-- See parameters for PQconnectdb() at http://www.postgresql.org/docs/8.4/static/libpq-connect.html -->
<param name="db-info" value="host=10.161.83.24 dbname=freeswitch user=freeswitch password='12345' connect_timeout=10" />
<!-- Log a-leg (a), b-leg (b) or both (ab) -->
<param name="legs" value="ab"/> ---使用ab
<!-- CDR table name -->
<param name="db-table" value="cdr"/> ---启用
6.3、db.conf.xml、voicemail.conf.xml、internal.xml、internal-ipv6.xml、external.xml、external-ipv6.xml、fifo.conf.xml、callcenter.conf.xml
<param name="odbc-dsn" value="pgsql://hostaddr=10.161.83.24 dbname=freeswitch user=freeswitch password='12345' options='-c client_min_messages=NOTICE' application_name='freeswtich'"/>
db.conf.xml:第3行
voicemail.conf.xml:第69行
internal.xml:第238行
internal-ipv6.xml:第66行
external.xml:第54行
external-ipv6.xml:第56行
fifo.conf.xml:第4行
callcenter.conf.xml :第4行
-------------------------------以上都是新增-----
6.4、vars.xml
<X-PRE-PROCESS cmd="set" data="json_db_handle=pgsql://hostaddr=10.161.83.24 dbname=freeswitch user=freeswitch password='12345' options='-c client_min_messages=NOTICE'"/>
第440行
-------------------------------以上都是新增-----
6.5、modules.conf.xml
reload mod_cdr_pg_csv
<!-- 配置posggresql启用 -->
<load module="mod_cdr_pg_csv"/> -------------------------------是新增-----
<!-- 配置posggresql启用 -->
modules.conf.xml 关闭csv 启用数据库方式
<!-- <load module="mod_cdr_csv"/>-->
6.6 建表
create table cdr (
id serial primary key,
local_ip_v4 inet not null,
caller_id_name varchar,
caller_id_number varchar,
destination_number varchar not null,
context varchar not null,
start_stamp timestamp with time zone not null,
answer_stamp timestamp with time zone,
end_stamp timestamp with time zone not null,
duration int not null,
billsec int not null,
hangup_cause varchar not null,
uuid uuid not null,
bleg_uuid uuid,
accountcode varchar,
read_codec varchar,
write_codec varchar,
sip_hangup_disposition varchar,
ani varchar
);
---------------
7. 配置网关: 在conf\dialplan\public 目录下增加文件my_did.xml ,内容如下
<include>
<extension name="public_did">
<condition field="destination_number" expression="^(8234x)$">
<action application="sleep" data="1000"/>
<action application="set" data="domain_name=$${domain}"/>
<action application="transfer" data="5000 XML default"/>
</condition>
</extension>
</include>
------------------------------------------
8. 在vars.xml 中修改对接的端口
<!-- Internal SIP Profile -->
<X-PRE-PROCESS cmd="set" data="internal_sip_port=5060"/>
<X-PRE-PROCESS cmd="set" data="internal_tls_port=5061"/>
<!-- External SIP Profile -->
<X-PRE-PROCESS cmd="set" data="external_sip_port=5560"/>
<X-PRE-PROCESS cmd="set" data="external_tls_port=5081"/>
-------------------------------
9.配置网关: 在C:\Program Files\FreeSWITCH\conf\sip_profiles\external 目录下增加文件my_gate.xml ,内容如下
<include>
<gateway name="mygate">
<param name="realm" value="192.168 :5060"/>
<param name="username" value="0108234x"/>
<param name="register" value="false"/>
</gateway>
</include>
10.配置打电话调用网关: 在C:\Program Files\FreeSWITCH\conf\dialplan\default 目录下增加文件mycall.xml ,内容如下
<include>
<extension name="mygatex">
<condition field="destination_number" expression="^mygatex(\d+)$">
<action application="bridge" data="{sip_invite_call_id=${sip_call_id}}sofia/gateway/mygatex/$1"/>
</condition>
</extension>
</include>
10.开启ESL
event_socket.conf 启用并配置
<param name="apply-inbound-acl" value="socket"/>
acl.conf 增加
<list name="socket" default="allow">
<node type="allow" cidr="110.161.22.117"/>
</list>
11. 监听以挂断为判断,如多个未挂断,则以最新的一个,进行监听编码如下设置:
vars.xml放开注释:
/// PCMA 提前
//<X-PRE-PROCESS cmd = "set" data="global_codec_prefs= "/>
//<X-PRE-PROCESS cmd = "set" data="outbound_codec_prefs= "/>
//<X-PRE-PROCESS cmd = "set" data="inbound_codec_prefs= "/>
<X-PRE-PROCESS cmd="set" data="global_codec_prefs= "/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs= "/>
<X-PRE-PROCESS cmd="set" data="inbound_codec_prefs= "/>
12.配置分机分叉
conf/sip_profiles/internal.xml
<!-- Can be 'true' or 'contact' -->
<param name="multiple-registrations" value="true"/>
cd /usr/local/src/
git clone https://github.com/signalwire/libks.git
cd libks
cmake .
make && make install
cd /usr/local/src/
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c/
cmake .
make && make install
ln -sf /usr/local/lib/pkgconfig/signalwire_client2.pc /usr/lib/pkgconfig/signalwire_client2.pc
cd /usr/local/src/
git clone http://git.videolan.org/git/x264.git
cd x264
## 若不安装 mod_av 采用此命令: ./configure --prefix=/usr/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared --disable-asm
./configure --disable-asm
make && make install
mod_pg模块,意思就是不能装pg17,,最好是postgrep15
wget http://archive.ubuntu.com/ubuntu/pool/main/p/postgresql-14/libpq5_14.15-0ubuntu0.22.04.1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/p/postgresql-14/libpq-dev_14.15-0ubuntu0.22.04.1_amd64.deb
dpkg -i libpq5_14.15-0ubuntu0.22.04.1_amd64.deb
dpkg -i libpq-dev_14.15-0ubuntu0.22.04.1_amd64.deb
mod_python3安装
./configure --prefix=/usr/local --enable-shared CFLAGS=-fPIC
make && make install
find / -name libpython3
ln -s /usr/local/lib/libpython3.12.so.1.0 /usr/lib/libpython3.12.so.1.0
pip3 install setuptools thread threadpool
./configure -enable-core-odbc-support --enable-core-pgsql-support --enable-core-mysql-support --with-python3=/usr/local/bin/python3 --with-python=no --with-openssl
make -j 32
sudo make install
sudo ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/
sudo ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin
sudo ln -s /usr/local/freeswitch/conf /etc/freeswitch
groupadd freeswitch
adduser --quiet --system --home /usr/local/freeswitch --ingroup freeswitch freeswitch --disabled-password
chown -R freeswitch:freeswitch /usr/local/freeswitch/
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
systemctl daemon-reload
systemctl enable freeswitch.service
-------------------------- FreeSWITCH configuration --------------------------
Locations:
prefix: /usr/local/freeswitch
exec_prefix: /usr/local/freeswitch
bindir: ${exec_prefix}/bin
confdir: /usr/local/freeswitch/conf
libdir: ${exec_prefix}/lib
datadir: /usr/local/freeswitch
localstatedir: /usr/local/freeswitch
includedir: /usr/local/freeswitch/include/freeswitch
certsdir: /usr/local/freeswitch/certs
dbdir: /usr/local/freeswitch/db
grammardir: /usr/local/freeswitch/grammar
htdocsdir: /usr/local/freeswitch/htdocs
fontsdir: /usr/local/freeswitch/fonts
logfiledir: /usr/local/freeswitch/log
modulesdir: /usr/local/freeswitch/mod
pkgconfigdir: ${exec_prefix}/lib/pkgconfig
recordingsdir: /usr/local/freeswitch/recordings
imagesdir: /usr/local/freeswitch/images
runtimedir: /usr/local/freeswitch/run
scriptdir: /usr/local/freeswitch/scripts
soundsdir: /usr/local/freeswitch/sounds
storagedir: /usr/local/freeswitch/storage
cachedir: /usr/local/freeswitch/cache
添加到/etc/systemd/system/freeswitch.service:
[Unit]
Description=freeswitch
After=network.target
[Service]
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
Environment="ORACLE_HOME=/usr/lib/oracle/19.24/client64"
Environment="${ORACLE_HOME}/network/admin"
Environment="USER=freeswitch"
Environment="GROUP=freeswitch"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/chown -R ${USER}:${GROUP} /usr/local/freeswitch
ExecStart=/usr/local/freeswitch/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}
TimeoutSec=45s
Restart=always
[Install]
WantedBy=multi-user.target
mod_h323安装:
3.2.1下载h323plus-v1_26_5.tar.gz和ptlib-2.12.8.tar.bz2
参考网址:http://www.h323plus.org/source/
3.2.2解压对应的模块,开始安装:
ptlib依赖flex
yum -y install flex
安装 ptlib
进入ptlib源码目录:
cd ptlib-2_10_9_6
./configure
make&make install
安装h323plus
进入h323plus源码目录
cd h323plus-1_28_0
./configure
make&make install
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/feiyonggao123_/article/details/136646440
mrcp和科大讯飞/阿里的对接
https://nvidia.csdn.net/675a7ee0f3b8a55e4e980800.html mrcp服务器安装参考
mod_unimrcp模块安装
因为FreeSWITCH最新版本已经去掉了unimrcp模块的默认安装,所以如果需要使用mod_unimrcp的话,需要在FreeSWITCH 1.10.11部署完成之后,再部署unimrcp和mod_unimrcp模块,freeswitch自带的源码里面,没有mod_unimrcp模块了。如果不需要使用mrcp做机器人业务,则该步骤忽略可跳过,不影响freeswitch的正常启动使用。
5.1 mod_unimrcp安装:
mod_unimrcp安装
1、下载并安装:unimrcp-deps-1.6.0.tar.gz
cd /usr/local/src/
wget https://www.unimrcp.org/project/component-view/unimrcp-deps-1-6-0-tar-gz/download -O unimrcp-deps-1.6.0.tar.gz –no-check-certificate
tar xvzf unimrcp-deps-1.6.0.tar.gz
cd unimrcp-deps-1.6.0
cd libs/apr
./configure –prefix=/usr/local/apr
make && make install
cd ../apr-util
./configure –prefix=/usr/local/apr
make && make install
2、下载并安装:unimrcp
cd /usr/local/src/
git clone https://github.com/unispeech/unimrcp.git
cd unimrcp
./bootstrap
./configure
make && make install
3、下载并安装:mod_unimrcp
cd /usr/local/src/
git clone https://github.com/freeswitch/mod_unimrcp.git
cd mod_unimrcp
./bootstrap.sh
./configure
make
make install
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/feiyonggao123_/article/details/136646440
https://juejin.cn/post/7410587194274545715
转载请注明:SuperIT » freeswitch编译安装