So, I know bash scripts aren’t allowed here so what i post is not one but with a simple modification it might help those who boldly go (this works on DO/Buster)
#!/bin/nofuckingwayits a scriptforbash, if i was it would just be #!bin/bash, but it's not ;-)
# stage 1 setup base environment for DO, maybe others
#make as swap file for the needy
dd if=/dev/zero of=/.swapfile bs=1M count=1000
chmod 600 /.swapfile
mkswap /.swapfile
echo -e "/.swapfile\tswap\tswap" >> /etc/fstab
swapon -a
# get apt ready to apt
apt-get -y update
apt-get -y upgrade
# get php7.0 ready
apt install -y software-properties-common ca-certificates apt-transport-https curl gnupg2
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list
# install node/npm , (don't use 10+)
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
#fix the Cementos/Debian libicu thingy
echo 'icuinfo 2>/dev/null|grep "\"version\""|sed "s/.*\">\(.*\)<.*/\1/g"' > /usr/bin/icu-config
chmod +x /usr/bin/icu-config
#stage 2 install the needed debs
apt-get install -y mlocate asterisk apache2 libapache2-mod-fcgid build-essential openssh-server apache2 mariadb-server \
mariadb-client bison flex php7.0 php7.0-curl php7.0-cli php7.0-pdo php7.0-mysql php7.0-mbstring php7.0-xml \
sox libncurses5-dev libssl-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake \
libtool autoconf git unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libicu-dev \
libcurl4-openssl-dev libical-dev libneon27-dev libsrtp2-dev libspandsp-dev sudo subversion libtool-bin \
python-dev unixodbc dirmngr postfix sudo mc traceroute rsync sngrep ffmpeg
#set a reduced security for defult freepbx keys
sed -i 's/^CipherString.*/CipherString = DEFAULT@SECLEVEL=1/' /etc/ssl/openssl.cnf
#stage 3 install FreePBX
systemctl stop asterisk
rm -rf /etc/asterisk
mkdir /etc/asterisk
touch /etc/asterisk/{modules,cdr}.conf
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib/asterisk
rm -rf /var/www/html
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.0/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
sed -i 's/^memory_limit.*$/memory_limit = 256M/g' /etc/php/7.0/apache2/php.ini
a2enmod rewrite
service apache2 restart
cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
tar vxfz freepbx-15.0-latest.tgz
rm -f freepbx-15.0-latest.tgz
cd freepbx
./start_asterisk start
./install -n
#last stage get, the basic modules working for UCP
fwconsole ma upgradeall
fwconsole ma downloadinstall certman
fwconsole ma downloadinstall userman
fwconsole ma downloadinstall ucp
#fix notifications so oly the good guys remain
mysql asterisk -e 'delete from notifications'
fwconsole r
#should be ready go . . .
exit 0
Currently, there is a problem with pm2 on restaring the machine, I fix it with
fwconsole downloadinstall ucp,
a while after boot ( do the proper systemd enable rc-local thing )
wbrtc is dependent on ucp so include that disable/enable around the downloadinstall
(Thanks to all the behind the scenes dudes who got me going on this)
The included script (install) and archive (install.tar.gz) will build
FreePBX 13, 14, or 15 plus Asterisk 13, 15, 16, or 16-GVSIP on a Raspberry Pi.
iptables, dnsmasq, and exim4 are also installed.
Installation takes a approximately 35 minutes to complete on a Raspberry Pi 4B.
If that’s Ron’s script, that compiles asterisk. That’s a terrible idea because then you don’t have all the QA resources of the distro you’re using managing security updates.
Now, some people may WANT to compile their own asterisk, and they may have some odd reason to do so, but 99% of people don’t (even if they think they do!)
The script I posted takes about 2 or 3 minutes to run, depending on your network speed.
So , if you want CDR’s then you are as yet SOL , an effective libmaodbc.so is for me elusive on Buster, even if compiled from source, I imagine it is also not working on any hardware platform.
And the “adaptive odbc cdr/cel” /libicu (UCP) also ?
what does “fwconsole pm2 --list” issue?
Are the the cdr/cel tables being populated?
But to answer, Yes, on Stretch it all works with php5.6 or php7.0, On Debian 10 (either amd64 or arm) not so much. None will be happy with php7.+ not even Stretch
Wasn’t this whole thing started of with attempting FreePBX 15 on Buster on a Pi4 (or any cpu for that matter) ?
This is where I will wait for mariadb to catch up. . .
I’m referring specifically to the packages for Maria-ODBC. The rest of that wiki is for Stretch, though it is mostly correct for Buster also. Yes, with those packages on Debian 10, I have working odbc / cdr / cel.
Excellent!, Where did you get your mariadb odbc connector (libmaodbc.so) from? 3.1.1 nor 3.1.2 doesn’t work in Debian10 for me, neither on a DO x86 or a PI4. I must be missing something
Excellent, already had the compile from source thing, followed your /etc/odbc*.ini setup, which I had effed up and now my script is slick as a soacs, Thanks so much
One of the reasons I prefer compiling Asterisk instead of using a package is I get the the latest release and don’t have to wait several months for it to be packaged:
And I totally agree, but that is easily script-able, but you have to wait several minutes for it to be installed, ( I can wait 8 minutes, 25 minutes kicks my add in ) and so far this is just a POC (that looks solid) ,
Thus I prefer the “asterisk latest” as a separate process to do that, as a point of note on Buster you get asterisk 16 dot a while ago , but on Stretch it is a very long while ago. I wonder who is the “Debian VoIP Team”
Couple of notes for scripts that “swings both ways”
I think libsrtp?-dev is as yet platform dependent and as yet
I recently started using libsrtp2-dev (on RPi) and the last I checked, nothing complained on either Stretch or Buster. I don’t do any SRTP, however, so I’m assuming it’s working.
ucp v14.0.3.6 and ucp v15.0.6.6 (both EDGE modules) now use pkg-config instead of libicu-dev to determine the underlying OS, allowing UCP to install and run on both Stretch and Buster.
The 35 minutes on an RPi includes updating Raspbian, updating FreePBX modules to EDGE versions (optional, but pretty much required on FreePBX 15), installing additional sounds, installing iptables, exim4, and dnsmasq, and a number customizations. When the script finishes, everything is up to date and ready to go.