2018年8月24日 星期五

NTP安裝設定

1.若沒NTP服務請先安裝
#yum install ntp

2.設定/etc/ntp.conf
# 1. 先處理權限方面的問題,包括放行上層伺服器以及開放區網用戶來源:
restrict default kod nomodify notrap nopeer noquery     <==拒絕 IPv4 的用戶
restrict -6 default kod nomodify notrap nopeer noquery  <==拒絕 IPv6 的用戶
restrict tock.stdtime.gov.tw   <==放行 tock.stdtime.gov.tw 進入本 NTP 伺服器
restrict tick.stdtime.gov.tw
restrict time.stdtime.gov.tw
restrict 127.0.0.1
restrict -6 ::1
#restrict 192.168.1.0 mask 255.255.255.0 nomodify

# 2. 設定主機來源,請先將原本的 [0|1|2].centos.pool.ntp.org 的設定註解掉:
server tock.stdtime.gov.tw prefer  <==以這部主機為最優先
server tick.stdtime.gov.tw
server time.stdtime.gov.tw

# 3.預設時間差異分析檔案與暫不用到的 keys 等,不需要更動它:
driftfile /var/lib/ntp/drift
keys      /etc/ntp/keys

3.啟動NTP服務
#systemctl start ntpd

4.將NTP預設起動
#chkconfig ntpd on

2018年8月21日 星期二

MySQL(MariaDB)將Latin1改成UTF-8

1. #vim /etc/my.cnf

2.將下列複製貼到檔案內
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake

3. #reboot

2018年8月16日 星期四

elastix安裝 G723 G729

1.下載 g723、g729 模組檔
http://asterisk.hosting.lv/下載相對應的模組檔
先找asterisk的版本再找相對應CPU的版本
現在的電腦應該都是對應到x86_64-core2-sse4

2.檔案存到asterisk/modules
路徑為/usr/lib/asterisk/modules(32bit)  /usr/lib64/asterisk/modules(64bit)

3.重新啟動asterisk服務
#service asterisk restart

4.啟用codec
編輯sip_general_custom.conf
加入
allow=g723
allow=g729

5.到 asterisk-cli 執行 core show translation recalc 10 確認是否有啟用