1、前期准備
yum install net-tools
關閉防火牆
//臨時關閉 systemctl stop firewalld //禁止開機啟動 systemctl disable firewalld setenforce 0
2、centos 7 安裝依賴包
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release yum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel python-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel libshout-devel libmpg123-devel lame-devel
3、安裝odbc,因為后面會涉及到odbc的安裝,所以先安裝odbc
yum install unixODBC-devel
yum install mysql-connector-odbc
安裝完成后編輯/etc/odbcinst.ini
# Example driver definitions # Driver from the postgresql-odbc package # Setup from the unixODBC package [PostgreSQL] Description = ODBC for PostgreSQL Driver = /usr/lib/psqlodbcw.so Setup = /usr/lib/libodbcpsqlS.so Driver64 = /usr/lib64/psqlodbcw.so Setup64 = /usr/lib64/libodbcpsqlS.so FileUsage = 1 # Driver from the mysql-connector-odbc package # Setup from the unixODBC package [MySQL] Description = ODBC for MySQL Driver = /usr/lib64/libmyodbc5.so Setup = /usr/lib64/libodbcmyS.so Driver64 = /usr/lib64/libmyodbc5.so Setup64 = /usr/lib64/libodbcmyS.so FileUsage = 1
編輯/etc/odbc.ini
[freeswitch] Description=MySQL realtime database Driver=/usr/lib64/libmyodbc5.so SERVER =數據庫地址 PORT =3306 DATABASE = freeswitch OPTION =67108864 CHARSET = UTF8 USER = 數據庫賬號 PASSWORD = 數據庫密碼 Threading = 0
輸入:isql -v freeswitch測試是否能夠連通
4、編譯freeswitch 1.8.5
freeswitch下載地址:http://files.freeswitch.org/freeswitch-releases/freeswitch-1.8.5.tar.bz2
* wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.8.5.tar.bz2 * tar xvjf freeswitch-1.8.5.tar.bz2 * cd freeswitch-1.8.5 * ./configure -C --enable-core-odbc-support #如果讀者不想使用mysql管理,只需要執行./configure即可 * make * make install
4.1.1 make中間出現的錯誤:
making all mod_signalwire make[4]: Entering directory `/usr/local/src/freeswitch/src/mod/applications/mod_signalwire' Makefile:916: *** You must install libks to build mod_signalwire. Stop. make[4]: Leaving directory `/usr/local/src/freeswitch/src/mod/applications/mod_signalwire' make[3]: *** [mod_signalwire-all] Error 1
根據報錯可以看出需要安裝需要安裝 libks 和 signalwire-c,安裝libks前需要先安裝cmake。
yum install libatomic.x86_64 #libks還會提示少libatomic,有的不會提示,為了保證順利安裝,建議yum安裝一下 cd /usr/local/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 gmake make install
安裝 libks
cd /usr/local/src git clone https://github.com/signalwire/libks.git cd libks cmake . make make install cp /usr/lib/pkgconfig/libks.pc /usr/lib64/pkgconfig/ #這個比較坑爹,不然還是還找不到libks模塊
安裝signalwire-c
cd /usr/local/src git clone https://github.com/signalwire/signalwire-c.git cd signalwire-c cmake . make make install cp /usr/local/lib/pkgconfig/*.pc /usr/lib64/pkgconfig/ cp -f /usr/local/lib/* /usr/lib64/
5、重新編譯安裝freeswitch:
cd /usr/local/freeswitch ./bootstrap.sh -j ./configure --enable-core-odbc-support #如果讀者不想使用mysql管理,只需要執行./configure即可 make make install
出現如下提示,則以完成安裝:
+---------- 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 + + + +-------------------------------------------------+ .=======================================================================================================. | _ _ ____ _ ____ | | / \ _ __ _ __ _ _ __ _| | / ___| |_ _ ___ / ___|___ _ __ | | / _ \ | '_ \| '_ \| | | |/ _` | | | | | | | | |/ _ \ | / _ \| '_ \ | | / ___ \| | | | | | | |_| | (_| | | | |___| | |_| | __/ |__| (_) | | | | | | /_/ \_\_| |_|_| |_|\__,_|\__,_|_| \____|_|\__,_|\___|\____\___/|_| |_| | | | | ____ _____ ____ ____ __ | | | _ \_ _/ ___| / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ | | | |_) || || | | | / _ \| '_ \| |_ / _ \ '__/ _ \ '_ \ / __/ _ \ | | | _ < | || |___ | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ | | |_| \_\|_| \____| \____\___/|_| |_|_| \___|_| \___|_| |_|\___\___| | | | | ____ _ ____ | | / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ | | | | | | | | |/ _ \ | / _ \| '_ \ / __/ _ \| '_ ` _ \ | | | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | | | \____|_|\__,_|\___|\____\___/|_| |_| (_) \___\___/|_| |_| |_| | | | .=======================================================================================================.
完成安裝之后,設置符號鏈接:
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/
安裝聲音文件
make cd-sounds-install
make cd-moh-install
到此,freeswitch 1.8.5則安裝完成。
