当前位置: 首页 > 工具软件 > GNU SIP Witch > 使用案例 >

Ubuntu 16.04 install FreeSWITCH v1.8

江子石
2023-12-01

Environment and Version

  • Linux OS and Version
Linux Version:Ubuntu 16.04.4 LTS
cat /etc/issue
Ubuntu 16.04.4 LTS
  • FreeSWITCH
FreeSWITCH Version: 1.8.5
freeswitch -version
FreeSWITCH version: 1.8.5+git~20190124T225359Z~31281a0bf1~64bit (git 31281a0 2019-01-24 22:53:59Z 64bit)

1. Install dependency for FreeSWITCH

# install dependency
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 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

2. Compile FreeSWITCH

2.1 git freeswitch v1.8

# load source code
git clone -b v1.8 https://freeswitch.org/stash/scm/fs/freeswitch.git
git clone -b v1.8 https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch

2.2 Compile FreeSWITCH

# Compile an Install
./bootstrap -j
./configure
make
make install

# symbolic link
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/

# install sounds file
make cd-sounds-install
make cd-moh-install

3.3 Errors and Solutions

3.3.1 compile freeswitch Error

1. [Error] root@host: /freeswitch# make

making all mod_signalwire
make[4]: Entering directory '/home/color/freeswitch/src/freeswitch/src/mod/applications/mod_signalwire'
Makefile:930: *** You must install libks to build mod_signalwire.  Stop.
make[4]: Leaving directory '/home/color/freeswitch/src/freeswitch/src/mod/applications/mod_signalwire'
Makefile:683: recipe for target 'mod_signalwire-all' failed
make[3]: *** [mod_signalwire-all] Error 1
make[3]: Leaving directory '/home/color/freeswitch/src/freeswitch/src/mod'
Makefile:591: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/color/freeswitch/src/freeswitch/src'
Makefile:3494: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/color/freeswitch/src/freeswitch'
Makefile:1255: recipe for target 'all' failed
make: *** [all] Error 2

1. [Solusions]root@host: /freeswitch# make

  • install cmake-3.13
cd directory/src
wget https://cmake.org/files/v3.13/cmake-3.13.3.tar.gz
tar -zxvf cmake-3.13.3.tar.gz
cd cmake-3.13.3 
./bootstrap
make
make install
  • Install libks and sigalwire
cd directory/src
git clone https://github.com/signalwire/libks.git
cd libks
cmake .
make
make install

cd directory/src
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c
cmake .
make
make install
cp /usr/local/lib/pkgconfig/*.pc /usr/lib/pkgconfig/
cp -f /usr/local/lib/* /usr/lib64/

2. [Error] fs_cli 无法登陆客户端

[ERROR] fs_cli.c:1679 main() Error Connecting [ ]
Usage: fs_cli [-H <host>] [-P <port>] [-p <secret>] [-d <level>] [-x command] [-t <timeout_ms>] [profile]

  -?,-h --help                    Usage Information
  -H, --host=hostname             Host to connect
  -P, --port=port                 Port to connect (1 - 65535)
  -u, --user=user@domain          user@domain
  -p, --password=password         Password
  -i, --interrupt                 Allow Control-c to interrupt
  -x, --execute=command           Execute Command and Exit
  -l, --loglevel=command          Log Level
  -U, --log-uuid                  Include UUID in log output
  -S, --log-uuid-short            Include shortened UUID in log output
  -q, --quiet                     Disable logging
  -r, --retry                     Retry connection on failure
  -R, --reconnect                 Reconnect if disconnected
  -d, --debug=level               Debug Level (0 - 7)
  -b, --batchmode                 Batch mode
  -t, --timeout                   Timeout for API commands (in miliseconds)
  -T, --connect-timeout           Timeout for socket connection (in miliseconds)
  -n, --no-color                  Disable color

2. [Solusions] fs_cli 无法登陆客户端

  • 查看端口8021,8022是否使用
netstat -tunlp | grep freeswitch 
  • 修改配置文件:ip最好改成本机,否者仍有可能拒绝访问
<!-- path:/usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml -->
<configuration name="event_socket.conf" description="Socket Client">
  <settings>
    <param name="nat-map" value="false"/>
    <!--<param name="listen-ip" value="::"/>-->
    <param name="listen-ip" value="127.0.0.1"/>
    <param name="listen-port" value="8021"/>
    <param name="password" value="ClueCon"/>
    <!--<param name="apply-inbound-acl" value="loopback.auto"/>-->
    <!--<param name="stop-on-bind-error" value="true"/>-->
  </settings>
</configuration>

3. [Setting] setting rtp-start-port and rtp-end-port

<!-- path:conf/autoload_configs/switch.conf.xml -->
<param name="rtp-start-port" value="16384"/>
<param name="rtp-end-port" value="16389"/>

4. [Setting] setting SIP Registration Port and default password

<!-- path:conf/vars.xml -->
<X-PRE-PROCESS cmd="set" data="default_password=10010"/>
<X-PRE-PROCESS cmd="set" data="internal_sip_port=10000"/>

4. [Setting] NAT

  • internal.xml
<!-- path:conf/sip_profiles/internal.xml -->
<param name="ext-rtp-ip" value="Public_IP"/>
<param name="ext-sip-ip" value="Public_IP"/>
  • vars.xml
<!-- path:conf/vars.xml -->
<X-PRE-PROCESS cmd="set" data="external_rtp_ip=Public_IP"/>
<X-PRE-PROCESS cmd="set" data="external_sip_ip=Public_IP"/>

4. FreeSWITCH Command

eval $${max-sips}查看坐席数
sofia status profile internal reg查看话机注册
fsctl max_sessions查看最大的session
global_setvar max-sips=100

5. info

 +---------- FreeSWITCH install Complete ----------+
 + FreeSWITCH has been successfully installed.     +
 +                                                 +
 +       Install sounds:                           +
 +       (uhd-sounds includes hd-sounds, sounds)   +
 +       (hd-sounds includes sounds)               +
 +       ------------------------------------      +
 +                make cd-sounds-install           +
 +                make cd-moh-install              +
 +                                                 +
 +                make uhd-sounds-install          +
 +                make uhd-moh-install             +
 +                                                 +
 +                make hd-sounds-install           +
 +                make hd-moh-install              +
 +                                                 +
 +                make sounds-install              +
 +                make moh-install                 +
 +                                                 +
 +       Install non english sounds:               +
 +       replace XX with language                  +
 +       (ru : Russian)                            +
 +       (fr : French)                             +
 +       ------------------------------------      +
 +                make cd-sounds-XX-install        +
 +                make uhd-sounds-XX-install       +
 +                make hd-sounds-XX-install        +
 +                make sounds-XX-install           +
 +                                                 +
 +       Upgrade to latest:                        +
 +       ----------------------------------        +
 +                make current                     +
 +                                                 +
 +       Rebuild all:                              +
 +       ----------------------------------        +
 +                make sure                        +
 +                                                 +
 +       Install/Re-install default config:        +
 +       ----------------------------------        +
 +                make samples                     +
 +                                                 +
 +                                                 +
 +       Additional resources:                     +
 +       ----------------------------------        +
 +       https://www.freeswitch.org                +
 +       https://freeswitch.org/confluence         +
 +       https://freeswitch.org/jira               +
 +       http://lists.freeswitch.org               +
 +                                                 +
 +       irc.freenode.net / #freeswitch            +
 +                                                 +
 +       Register For ClueCon:                     +
 +       ----------------------------------        +
 +       https://www.cluecon.com                   +
 +                                                 +
 +-------------------------------------------------+

Reference

 类似资料:

相关阅读

相关文章

相关问答