2017-03-25 18:41:47 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2017-04-01 05:48:04 +02:00
|
|
|
#move to script directory so all relative paths work
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
|
|
#includes
|
2017-04-01 05:58:23 +02:00
|
|
|
. ../config.sh
|
2017-04-01 05:48:04 +02:00
|
|
|
|
2017-04-01 09:48:01 +02:00
|
|
|
#set the current working directory
|
|
|
|
|
cwd=$(pwd)
|
|
|
|
|
|
2017-03-25 22:10:11 +01:00
|
|
|
#send a message
|
2017-03-25 18:41:47 +01:00
|
|
|
echo "Installing the FreeSWITCH source"
|
2017-03-25 22:10:11 +01:00
|
|
|
|
|
|
|
|
#install minimum dependencies
|
2017-03-27 12:54:08 +02:00
|
|
|
pkg install --yes autoconf automake curl git gmake ldns libedit libtool openssl pcre pkgconf speex sqlite3
|
|
|
|
|
pkg install --yes wget sudo libsndfile lua52 opus libmemcached libvorbis libogg tiff memcached
|
2017-03-25 22:10:11 +01:00
|
|
|
|
|
|
|
|
#additional dependencies
|
|
|
|
|
#pkg install --yes libshout mpg123 lame
|
|
|
|
|
|
|
|
|
|
#get the source
|
|
|
|
|
git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch
|
|
|
|
|
|
|
|
|
|
#prepare the source
|
|
|
|
|
cd /usr/src/freeswitch && /bin/sh /usr/src/freeswitch/bootstrap.sh -j
|
|
|
|
|
|
|
|
|
|
#enable the modules
|
|
|
|
|
sed -i' ' -e s:'#applications/mod_avmd:applications/mod_avmd:' /usr/src/freeswitch/modules.conf
|
|
|
|
|
sed -i' ' -e s:'#applications/mod_callcenter:applications/mod_callcenter:' /usr/src/freeswitch/modules.conf
|
|
|
|
|
sed -i' ' -e s:'#applications/mod_cidlookup:applications/mod_cidlookup:' /usr/src/freeswitch/modules.conf
|
|
|
|
|
sed -i' ' -e s:'#applications/mod_memcache:applications/mod_memcache:' /usr/src/freeswitch/modules.conf
|
|
|
|
|
sed -i' ' -e s:'#applications/mod_curl:applications/mod_curl:' /usr/src/freeswitch/modules.conf
|
|
|
|
|
#sed -i' ' -e s:'#formats/mod_shout:formats/mod_shout:' /usr/src/freeswitch/modules.conf
|
|
|
|
|
|
|
|
|
|
#configure the source (additional option --enable-system-lua)
|
|
|
|
|
/bin/sh configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --disable-fhs
|
|
|
|
|
|
|
|
|
|
#gmake
|
2017-03-25 18:41:47 +01:00
|
|
|
rm -rf /usr/local/freeswitch/{lib,mod,bin}/*
|
2017-03-25 22:10:11 +01:00
|
|
|
gmake install
|
|
|
|
|
gmake sounds-install moh-install
|
|
|
|
|
gmake hd-sounds-install hd-moh-install
|
|
|
|
|
gmake cd-sounds-install cd-moh-install
|
|
|
|
|
gmake uhd-sounds-install uhd-sounds-install
|
2017-03-25 18:41:47 +01:00
|
|
|
|
|
|
|
|
#move the music into music/default directory
|
|
|
|
|
mkdir -p /usr/local/freeswitch/sounds/music/default
|
|
|
|
|
mv /usr/local/freeswitch/sounds/music/*000 /usr/local/freeswitch/sounds/music/default
|
|
|
|
|
|
|
|
|
|
#configure system service
|
|
|
|
|
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
|
2017-04-02 17:22:40 +02:00
|
|
|
cp "$cwd/rc.d.freeswitch" /usr/local/etc/rc.d/freeswitch
|
|
|
|
|
chmod 0555 /usr/local/etc/rc.d/freeswitch
|
2017-03-25 22:10:11 +01:00
|
|
|
|
2017-04-25 02:51:57 +02:00
|
|
|
#enable the services
|
|
|
|
|
echo 'memcached_enable="YES"' >> /etc/rc.conf
|
2017-03-25 22:10:11 +01:00
|
|
|
echo 'freeswitch_enable="YES"' >> /etc/rc.conf
|
2017-04-23 13:09:17 +02:00
|
|
|
echo 'freeswitch_flags="-nc -nonat -u www -g www"' >> /etc/rc.conf
|
2017-03-25 22:10:11 +01:00
|
|
|
|
2017-04-25 02:51:57 +02:00
|
|
|
#start the services
|
2017-04-02 17:44:24 +02:00
|
|
|
service memcached start
|
2017-04-25 02:51:57 +02:00
|
|
|
service freeswitch start
|
|
|
|
|
|