海自东来 發表於 2022-9-26 14:17:00

freeswitch-ubuntu安装

<p><strong><span style="font-size: 18px">一,软件及环境准备:</span></strong></p>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">ubuntu版本18.04:<span style="color: rgba(0, 56, 132, 1); text-decoration: underline">https://releases.ubuntu.com/18.04.6/ubuntu-18.04.6-live-server-amd64.iso</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(57, 57, 57, 1)">freeswitch 版本1.10.7:<span style="color: rgba(0, 56, 132, 1); text-decoration: underline">https://files.freeswitch.org/freeswitch-releases/freeswitch-1.10.7.-release.tar.gz</span></span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(0, 56, 132, 1); text-decoration: underline">spandsp包:https://codeload.github.com/freeswitch/spandsp/zip/refs/heads/master</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(0, 56, 132, 1); text-decoration: underline">sofia-sip包:https://codeload.github.com/freeswitch/sofia-sip/tar.gz/refs/tags/v1.13.9</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><strong><span style="font-size: 18px">二,环境及软件下载后更改镜像源 为163</span></strong></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">ubuntu souces源 :</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">gedit /etc/apt/sources.list</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><strong><span style="font-size: 18px">三,进入到环境安装依赖包:</span></strong></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">apt-get update</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">apt-get install -y autoconf git libtool g++ zlib1g-dev libjpeg-dev libcurl4-openssl-dev libspeex-dev libldns-dev libedit-dev libssl-dev pkg-config yasm liblua50-dev libopus-dev libsndfile1-dev libpq-dev libreadline-dev lua5.2 lua5.2-doc liblua5.2-dev libtiff5 libtiff5-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y vim</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y g++</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y zlib1g-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libjpeg-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libsqlite3-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libcurl4-gnutls-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libpcre3-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libspeexdsp-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libedit-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libssl-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libopus-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y liblua5.2-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libldns-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">sudo apt-get install -y libsndfile1-dev</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">sudo apt-get install python3-pip</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">sudo apt-get install unixodbc unixodbc-dev</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">sudo apt-get install python3-pip</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">sudo apt install libavformat-dev</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">sudo apt install libswscale-dev</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-size: 18px"><strong><span style="font-family: monospace">四:<span style="font-family: monospace">安装spandsp/<span style="font-family: monospace">sofia-sip:(安装freeswitch 前安装好)</span></span></span></strong></span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">1,安装sofia-sip:</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">git cloen https://github.com/freeswitch/sofia-sip.git </span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">如果网络不太好,git可能下载不下来,可以直接下载sofia-sip的zip压缩包</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">cd sofia-sip</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">./bootstrap.sh</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">./configure</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">make</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">make install</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">2,安装spandsp:</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">git clone https://github.com/freeswitch/spandsp</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">如果网络不太好,git可能下载不下来,可以直接下载spandsp的zip压缩包</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">cd spandsp</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">./bootstrap.sh</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">./configure</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">make</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">make install</span></div>
</div>
</div>
</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">=============</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-size: 18px; font-weight: bold">五 安装freeswitch</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-size: 18px; font-weight: bold">1,进入到安装目录:</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-size: 18px; font-weight: bold">cd /usr/local/freeswitch-1.10.7.-release</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">
<p>./configure &nbsp;-C --enable-core-odbc-support</p>
<p>make</p>
<p>make install</p>
</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-size: 18px; font-weight: bold">六 配置freeswitch任何路径启动</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#将freeswitch作符号软链接</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#fs_cli作符号软链接</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-size: 18px"><strong><span style="font-family: monospace">七 相应配置文件更改</span></strong></span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">
<p><span style="background-color: rgba(255, 0, 0, 1)"><span style="font-family: 等线">1,阿里云不支持</span>ipv6<span style="font-family: 等线">,做处理</span></span></p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">vi /usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">
<p>&nbsp;&lt;param name="listen-ip" value="::"/&gt;<span style="font-family: 等线">修改为</span></p>
<p>&nbsp;&nbsp;<span style="background-color: rgba(255, 0, 0, 1)">&nbsp;&nbsp;&lt;param name="listen-ip" value="127.0.0.1"/&gt;</span></p>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926160613512-43401444.png"></p>
<p><strong>&nbsp;<span style="font-family: 等线">对相应</span><span style="font-family: 等线">IPv6文件做处理</span></strong></p>
<p>ls /usr/local/freeswitch/conf/sip_profiles/internal-ipv6.xml</p>
<p>ls /usr/local/freeswitch/conf/sip_profiles/external-ipv6.xml</p>
<p>ls&nbsp; /usr/local/freeswitch/conf/sip_profiles/external-ipv6</p>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926160831013-1195621510.png"></p>
<p>&nbsp;</p>
<p>cp /usr/local/freeswitch/conf/sip_profiles/internal-ipv6.xml /usr/local/freeswitch/conf/sip_profiles/internal-ipv6.xml_bak</p>
<p>cp /usr/local/freeswitch/conf/sip_profiles/external-ipv6.xml /usr/local/freeswitch/conf/sip_profiles/external-ipv6.xml_bak</p>
<p>cp /usr/local/freeswitch/conf/sip_profiles/external-ipv6 /usr/local/freeswitch/conf/sip_profiles/external-ipv6_bak -ra</p>
<p><span style="background-color: rgba(255, 0, 0, 1)"><span style="font-family: 等线">2,为了安全修改</span>SIP默认端口和分机默认密码</span></p>
<p><strong>vi /usr/local/freeswitch/conf/vars.xml</strong></p>
<p>&lt;X-PRE-PROCESS cmd="set" data="default_password=1234"/&gt;</p>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926161255236-551692361.png"></p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp; <strong><span style="font-family: 等线">修改成其他随机端口</span></strong></p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="internal_sip_port=5060"/&gt;</p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="external_sip_port=5080"/&gt;</p>
<p>&nbsp;</p>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926161358285-1725941326.png"></p>
<p>&nbsp;</p>
<p><span style="background-color: rgba(255, 0, 0, 1)"><strong><span style="font-family: 等线">请根据自己情况修改编码</span></strong></span></p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/&gt;</p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/&gt;</p>
<p><strong>&nbsp;&nbsp;OPUS G722 VP8删除了,修为</strong></p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA"/&gt;</p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA"/&gt;</p>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926161605986-1438110954.png"></p>
<p><span style="background-color: rgba(255, 0, 0, 1)"><strong>&nbsp;<span style="font-family: 等线">阿里云专有网络,请设置为公网</span>IP</strong></span></p>
<p>&nbsp;&lt;X-PRE-PROCESS cmd="set" data="external_sip_ip=阿里云公网IP"/&gt;</p>
<p>&nbsp;&nbsp;&lt;X-PRE-PROCESS cmd="set" data="external_rtp_ip=阿里云公网IP"/&gt;</p>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926161702984-1254676722.png"></p>
<p>&nbsp;</p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="background-color: rgba(255, 0, 0, 1)">3,<strong>/usr/local/freeswitch/conf/sip_profiles/external.xml</strong></span>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-rtp-ip" value="auto-nat"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-sip-ip" value="auto-nat"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;<strong>&nbsp;<span style="font-family: 等线">修改为</span></strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-rtp-ip" value="$${external_rtp_ip}"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-sip-ip" value="$${external_sip_ip}"/&gt;</p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926162059639-138826828.png">
<p>&nbsp;</p>
<p><span style="background-color: rgba(255, 0, 0, 1)">4,<strong>/usr/local/freeswitch/conf/sip_profiles/internal.xml</strong></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-rtp-ip" value="auto-nat"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-sip-ip" value="auto-nat"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;<strong>&nbsp;<span style="font-family: 等线">修改为</span></strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-rtp-ip" value="$${external_rtp_ip}"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="ext-sip-ip" value="$${external_sip_ip}"/&gt;</p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926162229157-407557189.png">
<p>&nbsp;&nbsp;</p>
<p><span style="background-color: rgba(255, 0, 0, 1)">5,<strong><span style="font-family: 等线">修改配置文件</span><span style="font-family: 等线">4--</span></strong><strong><span style="font-family: 等线">打开</span>NAT支持</strong></span></p>
<p>&nbsp;&nbsp;<span style="background-color: rgba(255, 0, 0, 1)">&nbsp;/usr/local/freeswitch/conf/sip_profiles/external.xml&nbsp;</span></p>
<p><span style="background-color: rgba(255, 0, 0, 1)">&nbsp;&nbsp;&nbsp;and</span></p>
<p><span style="background-color: rgba(255, 0, 0, 1)">&nbsp;&nbsp;&nbsp;/usr/local/freeswitch/conf/sip_profiles/internal.xml</span></p>
<p><span style="font-family: 等线">找到下面内容,去除注释,如果找不到自己添加</span></p>
<p><span style="background-color: rgba(0, 255, 255, 1)">&lt;param name="aggressive-nat-detection" value="true"/&gt;</span></p>
<p><span style="background-color: rgba(0, 255, 255, 1)">&lt;param name="NDLB-force-rport" value="true"/&gt;</span></p>
<p><span style="background-color: rgba(255, 0, 0, 1)">&nbsp;vi /usr/local/freeswitch/conf/sip_profiles/external.xml</span></p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926162618225-891316036.png">
<p>&nbsp;<span style="background-color: rgba(255, 0, 0, 1)">vi /usr/local/freeswitch/conf/sip_profiles/internal.xml</span></p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926162842400-1868506372.png">
<p>&nbsp;<span style="background-color: rgba(255, 0, 0, 1)">&nbsp;6,<span style="font-family: 等线">以上配置</span> <span style="font-family: 等线">都是在</span> public里面,这个是任意Ip都可以呼入的,请在业务通过flow和calleeid字段控制一下,防止非法呼入。</span></p>
<p>&nbsp;<span style="font-family: 等线">也可以直接配置</span>ACL,只有指定的IP才可以呼入。<span style="font-family: 等线">(如下配置</span><span style="font-family: 等线">ACL)</span></p>
<p>&nbsp;<strong>/usr/local/freeswitch/conf/sip_profiles/external.xml</strong></p>
<p><span style="font-family: 等线">在这句</span> &nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="local-network-acl" value="localnet.auto"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-family: 等线">这之后</span><span style="font-family: 等线">加</span><span style="font-family: 等线">入</span>&nbsp;&nbsp;&nbsp;&lt;param name="apply-inbound-acl" value="callin"/&gt;</p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926163310270-77147249.png">
<p>&nbsp;</p>
<p>7,<span style="background-color: rgba(255, 0, 0, 1)"><strong>cat /usr/local/freeswitch/conf/autoload_configs/acl.conf.xml</strong></span></p>
<p><span style="font-family: 等线">加入</span>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;list name="callin" default="deny"&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;node type="allow" cidr="可以呼入的IP1/32"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;node type="allow" cidr="可以呼入的IP3/32"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;node type="allow" cidr="0.0.0.0/0"/&gt; 这个写法就是允许任意IP</p>
<p>--&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/list&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-family: 等线; background-color: rgba(255, 0, 0, 1)">这之前加入</span></p>
<p>&nbsp;&nbsp;&lt;/network-lists&gt;</p>
<p>&lt;/configuration&gt;</p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926164034929-912721921.png">
<p>&nbsp;<span style="background-color: rgba(255, 0, 0, 1)">8,<span style="font-family: 等线">大并发优化</span></span></p>
<p>df</p>
<p>tmpfs &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;977004 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 &nbsp;&nbsp;&nbsp;977004 &nbsp;&nbsp;0% /dev/shm</p>
<p><span style="font-family: 等线">看到这个就是创建了</span></p>
<p>&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926164245915-1280135558.png"></p>
<p>&nbsp;<span style="background-color: rgba(255, 0, 0, 1)"><span style="font-family: 等线">1)修改配置文件</span><span style="font-family: 等线">1:</span>usr/local/freeswitch/conf/autoload_configs/switch.conf.xml</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="max-sessions" value="20000"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="sessions-per-second" value="2000"/&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="core-db-name" value="/dev/shm/core.db" /&gt;</p>
<p>&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926164258261-1181505749.png"></p>
<p>&nbsp;&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926164306404-1183024477.png"></p>
<p>&nbsp;<span style="background-color: rgba(255, 0, 0, 1)">&nbsp;2)<span style="font-family: 等线">修改配置文件</span><span style="font-family: 等线">2:</span>/usr/local/freeswitch/conf/sip_profiles/internal.xml</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&lt;param name="dbname" value="share_presence"/&gt;--&gt;</p>
<p><span style="font-family: 等线">修改为</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="dbname" value="/dev/shm/sofia_reg_internal.db"/&gt;</p>
<p>&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926164403119-445271723.png"></p>
<p>&nbsp;<span style="background-color: rgba(255, 0, 0, 1)"><span style="font-family: 等线">3)修改配置文件</span><span style="font-family: 等线">3:</span>/usr/local/freeswitch/conf/sip_profiles/external.xml</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&lt;param name="dbname" value="share_presence"/&gt;--&gt;</p>
<p><span style="font-family: 等线">修改为</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param name="dbname" value="/dev/shm/sofia_reg_external.db"/&gt;</p>
<p>&nbsp;<img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926164416367-2088712362.png"></p>
<p>&nbsp;&nbsp;八 <span style="font-size: 18px; font-weight: bold"> freeswitch 命令操作</span></p>
</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace; background-color: rgba(255, 0, 0, 1)">===============启动命令================</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#详细启动日志并进入控制台模式命令</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">freeswitch -c -nonat -rp</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#退出详细模式启动命令</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">shutdown</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#后台启动freeswitch服务(推荐使用)</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">freeswitch -nc -nonat</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#进入控制台模式命令</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">fs_cli</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#退出控制台命令</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">/exit </span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#关闭freeswitch命令</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">freeswitch -stop</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace; background-color: rgba(255, 0, 0, 1)">===============查询服务命令=============</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#查看freeswitch安装路径</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">whereis freeswitch</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">查看进程号</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">ps -ef | grep freeswithch</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">查看freeswitch端口是否被监听</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">netstat -anp | grep 5060</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#查看freeswitch的运行状态</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">status(控制台模式执行)</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">#查看freewitch内置用户是否注册</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">sofia status profile internal reg(控制台模式执行)</span></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px">&nbsp;</div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><strong><span style="font-family: monospace; font-size: 18px">九,启动,进入控制台</span></strong></div>
<div style="white-space: pre-wrap; line-height: 1.75; font-size: 14px"><strong><strong><span style="font-family: monospace; font-size: 18px"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926141309457-1966523080.png"></span></strong></strong>
<p>&nbsp;</p>
<p><span style="font-size: 18px"><strong>十,安装freeswitch 可能遇到的问题 见freeswitch常见问题</strong></span></p>
<p><strong><strong>十一,</strong></strong><span style="font-size: 21px; font-weight: bold">Linux下Mysql_odbc的安装<span style="font-size: 21px; font-family: &quot;等线 Light&quot;; font-weight: bold">配置odbc</span></span></p>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">1,安装方式1:apt-get install libmyodbc</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">2,有的系统安装不了&nbsp;libmyodbc只能直接安装</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;<span style="font-family: monospace">cd /usr/local/</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">下载对应系统ubuntu18.04 对应版本</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">wget <span style="font-family: monospace">https://cdn.mysql.com//Downloads/Connector-ODBC/8.0/mysql-connector-odbc_8.0.30-1ubuntu18.04_amd64.deb</span></span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">wget <span style="font-family: monospace">https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-client-plugins_8.0.30-1ubuntu18.04_amd64.deb</span></span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;<span style="font-family: monospace">进行安装</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">dpkg -i mysql-community-client-plugins_8.0.30-1ubuntu18.04_amd64.deb</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: monospace">dpkg -i mysql-connector-odbc_8.0.30-1ubuntu18.04_amd64.deb</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;<span style="font-family: monospace"><span style="font-family: monospace"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926155218344-358477308.png"></span></span>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: SimSun, STSong">3,配置文件 </span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="font-family: SimSun, STSong">安装好<span style="font-family: SimSun, STSong">odbc之后就是写相关配置文件了,配置文件自动生成在/etc/目录下,分别是:odbc.ini 和 odbcinst.ini ;odbc.ini需要写的是将要连接的数据库信息和连接驱动,odbcinst.ini需要写的是odbc驱动所需要链接的库,下文写下我的小例子</span></span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><strong><span style="color: rgba(255, 0, 0, 1)">vi /etc/odbc.ini</span></strong></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">Description = THE Database for test</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">Trace = On</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">TraceFile = staderr</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(255, 0, 0, 1)">Driver = mysql</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(255, 0, 0, 1)">SERVER = 10.1.12.18</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(255, 0, 0, 1)">USER = deploy</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">PASSWORD = 123456</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">PORT = 3306</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="color: rgba(255, 0, 0, 1)">DATABASE = autodialer</span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">charset = UTF8</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">option = 3</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">======</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><span style="background-color: rgba(255, 0, 0, 1)"><strong>vi /etc/odbcinst.ini</strong></span></div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">&nbsp;&nbsp;</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">Driver=/usr/lib64/libmyodbc8a.so</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">SETUP=/usr/lib64/libmyodbc8a.so</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">UsageCount=2</div>
</div>
<p>4,安装数据库,同时创建数据库<span style="color: rgba(255, 0, 0, 1)">autodialer</span></p>
<p><span style="color: rgba(255, 0, 0, 1)">CREATE DATABASE autodialer DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;</span></p>
<p><span style="color: rgba(255, 0, 0, 1)">5,执行如下命令:</span></p>
<p>&nbsp;myodbc-installer -d -a -n "MYSQL" -t "DRIVER=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so;SETUP=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so"</p>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">成功如下图</div>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px"><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926155826373-391587598.png">
<p>6,最后执行:isql -v autodialer</p>
<div style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px">成功显示:</div>
</div>
<p><img src="https://img2022.cnblogs.com/blog/853519/202209/853519-20220926155919052-1338707445.png"></p>
<p><span style="background-color: rgba(255, 0, 0, 1); font-size: 14pt"><strong><span style="font-family: 等线">到这里有关</span>mysql-odbc的安装配置终于完成</strong></span></p>
<p>&nbsp;</p>
</div>
</div><br><br>
来源:https://www.cnblogs.com/wuchangsoft/p/16730694.html
頁: [1]
查看完整版本: freeswitch-ubuntu安装