因為FS現在停止了1.8(更不要說1.6),當前是1.10版本,於是對這個版本進行了安裝配置的測試,小記如下:
1、初步安裝測試,1.10版本在centos7.7下可以安裝,運行OK
2、1.10版本的FS已經內置了mariadb(mysql)的數據庫支持,可以不再用ODBC來啟用mysql了(按FS官方的文檔,1.10版本主要就是優化了數據庫)
為測試這個版本,並主要測試使用內置mariadb數據庫,進行的安裝記錄如下:
=====使用 yum 安裝=====
1、centos7.7 最小安裝
2、這是centos7下面對 delta的補充安裝,並安裝wget備用
yum provides '*/applydeltarpm' yum install deltarpm wget
3、直接使用yum安裝Freeswitch,僅安裝英文語言包,啟用xml-cdr和mariadb(mysql)
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release yum install -y freeswitch-config-vanilla freeswitch-lang-en freeswitch-sounds-en-* freeswitch-sounds-music-* freeswitch-lua freeswitch-xml-cdr freeswitch-database-mariadb systemctl enable freeswitch
4、使用內置mariadb數據庫
注意,如果使用FS的mariadb支持就不能使用最新的mariadb,要用centos自帶的,否則mysql C connector版本不兼容!
yum install -y mariadb mariadb-sever service mariadb start systemctl enable mariadb mysql_secure_installation
上面修改root用戶密碼,后面需要創建freeswitch的空數據庫(建議用默認字符集)
5、修改FS配置文件,啟用mariadb
里面默認啟用的是pgsql,mariadb的被注釋了,啟用即可
vi /etc/freeswitch/autoload_configs/pre_load_modules.conf.xml
如果沒有這個文件,參考:
<configuration name="pre_load_modules.conf" description="Modules"> <modules> <!-- Databases --> <load module="mod_mariadb"/> <!-- <load module="mod_pgsql"/> --> </modules> </configuration>
6、修改FS配置文件,讓FS的核心使用mariadb(mysql)數據庫
需修改 core-db-dsn 或 odbc-dsn 數據庫連接的相關信息,按上面自己設置的內容連接,
連接串的格式為:
mariadb://Server=localhost;Database=freeswitch;Uid=freeswitch;Pwd=pass;
vi /etc/freeswitch/autoload_configs/switch.conf.xml vi /etc/freeswitch/autoload_configs/db.conf.xml vi /etc/freeswitch/sip_profiles/internal.xml vi /etc/freeswitch/sip_profiles/internal-ipv6.xml
7、啟動FS
service freeswitch start
小記說明:測試運行正常,安裝后配置文件中 mod_b64、mod_png、mod_av 這幾個默認存在的模塊都不可用,而且FS也沒有相關的包,
開發中需使用的ESL庫(libesl.a)也不可用(沒有相關包,安裝了 freeswitch.devel 包也不包含,必須自己編譯,
所以,還是要下載源代碼,又回到原點了)...,考慮到實際使用,看來源碼編譯安裝還是不可替代的!
所以嗎, yum安裝,僅對一般使用者,對有擴展開發的還是不行!!
===== 源代碼編譯 =====
1、centos7.7 最小安裝
2、FS的源代碼編譯基礎環境
這里使用yum-builddep工具,基於FS的yum包依賴庫批量安裝,簡單了很多:
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release yum-utils yum-builddep -y freeswitch yum install -y yum-plugin-ovl centos-release-scl rpmdevtools git yum install -y devtoolset-4-gcc*
scl enable devtoolset-4 'bash'
3、下面這個是對mod_av的補充
mod_av需要libavformat-dev,但centos沒有,通過第三方yum庫安裝ffmpeg-devel包實現(yum的FS版本里面是沒有mod_av、mod_b64、mod_png的,所以上面的安裝也就沒有):
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm yum install -y ffmpeg-devel
4、開始安裝
cd /usr/local/src git clone -b v1.10 https://github.com/signalwire/freeswitch.git freeswitch cd /usr/local/src/freeswitch ./bootstrap.sh -j ./configure --enable-portable-binary \ --prefix=/usr --localstatedir=/var --sysconfdir=/etc \ --with-gnu-ld --with-python --with-erlang --with-openssl \ --enable-core-odbc-support --enable-zrtp make make -j install make -j cd-sounds-install make -j cd-moh-install
不過我還是 習慣 所有 mod conf bin log db 等等 文件夾 都放在一起, 比如: /usr/local/freeswtich/
5、OK,又回到了熟悉的狀態,yum沒有的模塊都回來了
6、對FS1.10新添加的mariadb模塊的編譯安裝
cd /usr/local/src/freeswitch/src/mod/databases/mod_mariadb make make install
[轉自:http://blog.sina.com.cn/s/blog_539d6e0c01032c2q.html]
------------恢復內容開始------------
因為FS現在停止了1.8(更不要說1.6),當前是1.10版本,於是對這個版本進行了安裝配置的測試,小記如下:
1、初步安裝測試,1.10版本在centos7.7下可以安裝,運行OK
2、1.10版本的FS已經內置了mariadb(mysql)的數據庫支持,可以不再用ODBC來啟用mysql了(按FS官方的文檔,1.10版本主要就是優化了數據庫)
為測試這個版本,並主要測試使用內置mariadb數據庫,進行的安裝記錄如下:
=====使用 yum 安裝=====
1、centos7.7 最小安裝
2、這是centos7下面對 delta的補充安裝,並安裝wget備用
yum provides '*/applydeltarpm' yum install deltarpm wget
3、直接使用yum安裝Freeswitch,僅安裝英文語言包,啟用xml-cdr和mariadb(mysql)
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release yum install -y freeswitch-config-vanilla freeswitch-lang-en freeswitch-sounds-en-* freeswitch-sounds-music-* freeswitch-lua freeswitch-xml-cdr freeswitch-database-mariadb systemctl enable freeswitch
4、使用內置mariadb數據庫
注意,如果使用FS的mariadb支持就不能使用最新的mariadb,要用centos自帶的,否則mysql C connector版本不兼容!
yum install -y mariadb mariadb-sever service mariadb start systemctl enable mariadb mysql_secure_installation
上面修改root用戶密碼,后面需要創建freeswitch的空數據庫(建議用默認字符集)
5、修改FS配置文件,啟用mariadb
里面默認啟用的是pgsql,mariadb的被注釋了,啟用即可
vi /etc/freeswitch/autoload_configs/pre_load_modules.conf.xml
如果沒有這個文件,參考:
<configuration name="pre_load_modules.conf" description="Modules"> <modules> <!-- Databases --> <load module="mod_mariadb"/> <!-- <load module="mod_pgsql"/> --> </modules> </configuration>
6、修改FS配置文件,讓FS的核心使用mariadb(mysql)數據庫
需修改 core-db-dsn 或 odbc-dsn 數據庫連接的相關信息,按上面自己設置的內容連接,
連接串的格式為:
mariadb://Server=localhost;Database=freeswitch;Uid=freeswitch;Pwd=pass;
vi /etc/freeswitch/autoload_configs/switch.conf.xml vi /etc/freeswitch/autoload_configs/db.conf.xml vi /etc/freeswitch/sip_profiles/internal.xml vi /etc/freeswitch/sip_profiles/internal-ipv6.xml
7、啟動FS
service freeswitch start
小記說明:測試運行正常,安裝后配置文件中 mod_b64、mod_png、mod_av 這幾個默認存在的模塊都不可用,而且FS也沒有相關的包,
開發中需使用的ESL庫(libesl.a)也不可用(沒有相關包,安裝了 freeswitch.devel 包也不包含,必須自己編譯,
所以,還是要下載源代碼,又回到原點了)...,考慮到實際使用,看來源碼編譯安裝還是不可替代的!
所以嗎, yum安裝,僅對一般使用者,對有擴展開發的還是不行!!
===== 源代碼編譯 =====
1、centos7.7 最小安裝
2、FS的源代碼編譯基礎環境
這里使用yum-builddep工具,基於FS的yum包依賴庫批量安裝,簡單了很多:
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release yum-utils yum-builddep -y freeswitch yum install -y yum-plugin-ovl centos-release-scl rpmdevtools git yum install -y devtoolset-4-gcc*
scl enable devtoolset-4 'bash'
3、下面這個是對mod_av的補充
mod_av需要libavformat-dev,但centos沒有,通過第三方yum庫安裝ffmpeg-devel包實現(yum的FS版本里面是沒有mod_av、mod_b64、mod_png的,所以上面的安裝也就沒有):
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm yum install -y ffmpeg-devel
4、開始安裝
cd /usr/local/src git clone -b v1.10 https://github.com/signalwire/freeswitch.git freeswitch cd /usr/local/src/freeswitch ./bootstrap.sh -j ./configure --enable-portable-binary \ --prefix=/usr --localstatedir=/var --sysconfdir=/etc \ --with-gnu-ld --with-python --with-erlang --with-openssl \ --enable-core-odbc-support --enable-zrtp make make -j install make -j cd-sounds-install make -j cd-moh-install
不過我還是 習慣 所有 mod conf bin log db 等等 文件夾 都放在一起, 比如: /usr/local/freeswtich/
5、OK,又回到了熟悉的狀態,yum沒有的模塊都回來了
6、對FS1.10新添加的mariadb模塊的編譯安裝
cd /usr/local/src/freeswitch/src/mod/databases/mod_mariadb make make install
[轉自:http://blog.sina.com.cn/s/blog_539d6e0c01032c2q.html]
======親自嘗試(非轉載)======
還有以下mod的conf要改(我用到的)
autoload_configs/callcenter.conf.xml
autoload_configs/fifo.conf.xml
autoload_configs/voicemail.conf.xml
sip_profiles/external.xml
sip_profiles/external-ipv6.xml
咋知道有這么些要改的??
簡單,db文件夾下刪不掉的-->你懂的...
只有switch.conf 中的是`core-db-dsn`參數
其他的都是`odbc-dsn`參數 :)
沒看到有<!-- -->注釋的預置的,就自己加!
然后第一次啟動會報一些錯,因為沒表唄(嗯,數據庫,用戶要先創建,不說), 啟動完后, 重新啟動一次
不過第N次啟動任然會報錯 都是創建 index 重復的錯誤.....
然后還有個錯誤,mod_db報的,沒研究了:
可見非SQLite的coredb支持任然不完善吧,O(∩_∩)O哈哈~