From 0260b66242f082898303aa38e81ef5695f656c52 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 9 Feb 2024 13:32:45 -0700 Subject: [PATCH 1/4] Add libsox-fmt-all for mp3 support --- debian/resources/switch/source-release.sh | 2 +- devuan/resources/switch/source-release.sh | 2 +- ubuntu/resources/switch/source-release.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index b13c44d..f7f217d 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -16,7 +16,7 @@ apt install -y pkg-config flac libgdbm-dev libdb-dev gettext sudo equivs mlocat apt install -y liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev libpcre3-dev apt install -y devscripts libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libopus-dev libmemcached-dev apt install -y libshout3-dev libmpg123-dev libmp3lame-dev yasm nasm libsndfile1-dev libuv1-dev libvpx-dev -apt install -y libavformat-dev libswscale-dev libvlc-dev python3-distutils sox +apt install -y libavformat-dev libswscale-dev libvlc-dev python3-distutils sox libsox-fmt-all #install dependencies that depend on the operating system version if [ ."$os_codename" = ."stretch" ]; then diff --git a/devuan/resources/switch/source-release.sh b/devuan/resources/switch/source-release.sh index 2adafa6..eef9a39 100755 --- a/devuan/resources/switch/source-release.sh +++ b/devuan/resources/switch/source-release.sh @@ -2,7 +2,7 @@ echo "Installing the FreeSWITCH source" DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y -q ntpdate libapache2-mod-log-sql-ssl libfreetype6-dev git-buildpackage doxygen yasm nasm gdb git build-essential automake autoconf 'libtool-bin|libtool' python uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev libvlccore-dev vlc-nox pkg-config ccache libpng-dev libvpx-dev libyuv-dev libopenal-dev libbroadvoice-dev libcodec2-dev libflite-dev libg7221-dev libilbc-dev libmongoc-dev libsilk-dev libsoundtouch-dev libmagickcore-dev liblua5.2-dev libopus-dev libsndfile-dev libopencv-dev libavformat-dev libx264-dev erlang-dev libldap2-dev libmemcached-dev libperl-dev portaudio19-dev python-dev libsnmp-dev libyaml-dev libmp4v2-dev -apt-get install -y -q ntp unzip libpq-dev memcached libshout3-dev libvpx-dev libmpg123-dev libmp3lame-dev +apt-get install -y -q ntp unzip libpq-dev memcached libshout3-dev libvpx-dev libmpg123-dev libmp3lame-dev sox libsox-fmt-all # E: Unable to locate package libyuv-dev # E: Unable to locate package libbroadvoice-dev diff --git a/ubuntu/resources/switch/source-release.sh b/ubuntu/resources/switch/source-release.sh index 8625cfc..94e1948 100755 --- a/ubuntu/resources/switch/source-release.sh +++ b/ubuntu/resources/switch/source-release.sh @@ -15,7 +15,7 @@ apt install -y autoconf automake devscripts g++ git-core libncurses5-dev libtool liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev libpcre3-dev \ devscripts libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libopus-dev libmemcached-dev \ libshout3-dev libmpg123-dev libmp3lame-dev yasm nasm libsndfile1-dev libuv1-dev libvpx-dev \ - libavformat-dev libswscale-dev libspandsp-dev pip libpq-dev libvlc-dev uuid-dev sox + libavformat-dev libswscale-dev libspandsp-dev pip libpq-dev libvlc-dev uuid-dev sox libsox-fmt-all # additional dependencies apt install -y swig3.0 unzip sox wget From b7538125e239dca9763993f861596f970cd8c63e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 12 Feb 2024 12:15:41 -0700 Subject: [PATCH 2/4] Create source-release.sh --- centos/resources/switch/source-release.sh | 129 ++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 centos/resources/switch/source-release.sh diff --git a/centos/resources/switch/source-release.sh b/centos/resources/switch/source-release.sh new file mode 100644 index 0000000..65d4587 --- /dev/null +++ b/centos/resources/switch/source-release.sh @@ -0,0 +1,129 @@ +#!/bin/sh + +#move to script directory so all relative paths work +cd "$(dirname "$0")" + +#includes +. ../config.sh +. ../colors.sh + +#upgrade packages +apt update && apt upgrade -y + +yum -y install memcached curl gdb + +#install build dependencies +yum install -y autoconf automake libtool gcc-c++ ncurses-devel zlib-devel libjpeg-devel openssl-devel libcurl-devel pcre-devel lua-devel libedit-devel libuuid-devel speex-devel libogg-devel libvorbis-devel curl-devel ldns-devel libsndfile-devel libtheora-devel + +#install additional depdendencies +yum install -y libjpeg-devel sqlite-devel libpng-devel libtiff-devel libX11-devel e2fsprogs-devel openldap-devel libyuv-devel +yum install -y sox sqlite3 unzip + +#we are about to move out of the executing directory so we need to preserve it to return after we are done +CWD=$(pwd) + +#install the following dependencies if the switch version is greater than 1.10.0 +if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then + + # libks build-requirements + apt install -y cmake uuid-dev + + # libks + cd /usr/src + git clone https://github.com/signalwire/libks.git libks + cd libks + cmake . + make -j $(getconf _NPROCESSORS_ONLN) + make install + + # libks C includes + export C_INCLUDE_PATH=/usr/include/libks + + # sofia-sip + cd /usr/src + #git clone https://github.com/freeswitch/sofia-sip.git sofia-sip + wget https://github.com/freeswitch/sofia-sip/archive/refs/tags/v$sofia_version.zip + unzip v$sofia_version.zip + cd sofia-sip-$sofia_version + sh autogen.sh + ./configure --enable-debug + make -j $(getconf _NPROCESSORS_ONLN) + make install + + # spandsp + cd /usr/src + git clone https://github.com/freeswitch/spandsp.git spandsp + cd spandsp + git reset --hard 0d2e6ac65e0e8f53d652665a743015a88bf048d4 + #/usr/bin/sed -i 's/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/g' /usr/src/spandsp/configure.ac + sh autogen.sh + ./configure --enable-debug + make -j $(getconf _NPROCESSORS_ONLN) + make install + ldconfig +fi + +cd /usr/src + +#check for master +if [ $switch_branch = "master" ]; then + #master branch + echo "Using version master" + rm -r /usr/src/freeswitch + git clone https://github.com/signalwire/freeswitch.git + cd /usr/src/freeswitch + ./bootstrap.sh -j +fi + +#check for stable release +if [ $switch_branch = "stable" ]; then + echo "Using version $switch_version" + #1.8 and older + if [ $(echo "$switch_version" | tr -d '.') -lt 1100 ]; then + wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.zip + unzip freeswitch-$switch_version.zip + cd /usr/src/freeswitch-$switch_version + fi + + #1.10.0 and newer + if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then + wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip + unzip freeswitch-$switch_version.-release.zip + mv freeswitch-$switch_version.-release freeswitch-$switch_version + cd /usr/src/freeswitch-$switch_version + #apply patch + #patch -u /usr/src/freeswitch/src/mod/databases/mod_pgsql/mod_pgsql.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/mod_pgsql.patch + fi +fi + +# enable required modules +#sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_avmd:applications/mod_avmd:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_av:formats/mod_av:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_callcenter:applications/mod_callcenter:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_cidlookup:applications/mod_cidlookup:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_memcache:applications/mod_memcache:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_nibblebill:applications/mod_nibblebill:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_curl:applications/mod_curl:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_translate:applications/mod_translate:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#formats/mod_pgsql:formats/mod_pgsql:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#say/mod_say_es:say/mod_say_es:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#say/mod_say_fr:say/mod_say_fr:' + +#disable module or install dependency libks to compile signalwire +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'applications/mod_signalwire:#applications/mod_signalwire:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'endpoints/mod_skinny:#endpoints/mod_skinny:' +sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'endpoints/mod_verto:#endpoints/mod_verto:' + +# prepare the build +#./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --disable-fhs +./configure -C --enable-portable-binary --disable-dependency-tracking --enable-debug \ +--prefix=/usr --localstatedir=/var --sysconfdir=/etc \ +--with-openssl --enable-core-pgsql-support + +# compile and install +make -j $(getconf _NPROCESSORS_ONLN) +make install + +#return to the executing directory +cd $CWD From 1e19d61b183c8267a81342be986825de3c775496 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 12 Feb 2024 17:12:39 -0700 Subject: [PATCH 3/4] Update source-release.sh --- centos/resources/switch/source-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centos/resources/switch/source-release.sh b/centos/resources/switch/source-release.sh index 65d4587..765bd04 100644 --- a/centos/resources/switch/source-release.sh +++ b/centos/resources/switch/source-release.sh @@ -8,7 +8,7 @@ cd "$(dirname "$0")" . ../colors.sh #upgrade packages -apt update && apt upgrade -y +yum update && yum upgrade -y yum -y install memcached curl gdb From 86b84e122db0e105d31eb906614d8676df1cdc25 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 19 Feb 2024 22:07:48 -0700 Subject: [PATCH 4/4] Update Raspbian 12 ARM to use PHP 8.2 Makes the install work for the Raspberry Pi --- debian/resources/php.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/resources/php.sh b/debian/resources/php.sh index 539930d..66272ca 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -31,6 +31,9 @@ elif [ ."$cpu_architecture" = ."arm" ]; then if [ ."$os_codename" = ."bullseye" ]; then php_version=7.4 fi + if [ ."$os_codename" = ."bookworm" ]; then + php_version=8.2 + fi else #11.x - bullseye #10.x - buster