ติดตั้ง FreeSWITCH 1.6.x บน Debian 8.x 64-bit (Credit: www.freeswitch.org)

1. Install OS

ติดตั้ง Debian 8.x 64-bit Minimal ตามลิ้งค์

Debian 8 64-bit Minimal Installation

เซ็ตอัพ fixed ip address บน Debian 8

 

2. Building from source - release branch

#wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

#echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list

#apt-get update

#apt-get install -y --force-yes freeswitch-video-deps-most

#git config --global pull.rebase true

#cd /usr/src

#wget https://files.freeswitch.org/releases/freeswitch/freeswitch-1.6.20.tar.gz

#tar zxvf freeswitch-1.6.20.tar.gz

#cd freeswitch-1.6.20

#./bootstrap.sh -j

#./configure

#make

#make install

#make hd-sounds-install

#make hd-moh-install

#make samples

create user 'freeswitch'
add it to group 'freeswitch'
change owner and group of the freeswitch installation

#cd /usr/local

#groupadd freeswitch

#adduser --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH open source softswitch" --ingroup freeswitch freeswitch --disabled-password

#chown -R freeswitch:freeswitch /usr/local/freeswitch/

#chmod -R ug=rwX,o= /usr/local/freeswitch/

#chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*


3. สร้าง freeswitch.service สำหรับ systemd

แก้ไขไฟล์ freeswitch.service ในโฟลเดอร์ /etc/systemd/system ดังนี้

=================================================

[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target

[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
; blank ExecStart= line flushes the list
ExecStart=
ExecStart=/usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -ncwait -nonat -rp
TimeoutSec=45s
Restart=on-failure
; exec
WorkingDirectory=/usr/local/freeswitch/bin
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007

[Install]
WantedBy=multi-user.target

=================================================

#systemctl daemon-reload

#systemctl start freeswitch

#systemctl stop freeswitch

คอนฟิกให้ start freeswitch เมื่อตอน boot server

#systemctl enable freeswitch