2017-03-25 18:41:47 +01:00
|
|
|
#!/bin/sh
|
2017-03-25 22:10:11 +01:00
|
|
|
|
2017-04-01 05:50:08 +02:00
|
|
|
#move to script directory so all relative paths work
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
|
|
#includes
|
2017-04-01 05:59:29 +02:00
|
|
|
. ../config.sh
|
2017-04-01 05:50:08 +02:00
|
|
|
|
2017-04-01 09:50:18 +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:53:39 +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
|
2017-03-25 18:41:47 +01:00
|
|
|
|
2017-03-25 22:10:11 +01:00
|
|
|
#get the source
|
2024-08-24 18:11:54 +02:00
|
|
|
git clone https://github.com/signalwire/freeswitch.git /usr/src/freeswitch
|
2017-03-25 18:41:47 +01:00
|
|
|
|
2017-03-25 22:10:11 +01:00
|
|
|
#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
|
|
|
|
|
|
2017-04-01 09:50:18 +02:00
|
|
|
#set the original working directory
|
|
|
|
|
cd $cwd
|
|
|
|
|
|
2017-03-25 18:41:47 +01:00
|
|
|
#configure system service
|
|
|
|
|
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
|
2017-04-01 09:50:18 +02:00
|
|
|
cp "$(dirname $0)/rc.d.freeswitch /usr/local/etc/rc.d/freeswitch
|
2017-03-25 22:10:11 +01:00
|
|
|
chmod u-w,ugo+x /usr/local/etc/rc.d/freeswitch
|
|
|
|
|
|
|
|
|
|
#enable the service
|
|
|
|
|
echo 'freeswitch_enable="YES"' >> /etc/rc.conf
|
2017-04-25 10:35:19 +02:00
|
|
|
echo 'freeswitch_flags="-nc -nonat -u www -g www"' >> /etc/rc.conf
|
2017-03-25 22:10:11 +01:00
|
|
|
|
|
|
|
|
#start the service
|
2017-04-25 10:34:44 +02:00
|
|
|
service memcached start
|