Last active
September 18, 2019 22:33
-
-
Save monobilisim/8363c874671567818923 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get autoremove -y | |
apt-get update -y | |
apt-get upgrade -y | |
apt-get install -y asterisk asterisk-modules asterisk-mp3 asterisk-mysql asterisk-voicemail asterisk-core-sounds-en asterisk-core-sounds-en-g722 asterisk-core-sounds-en-gsm asterisk-core-sounds-en-wav | |
export DEBIAN_FRONTEND=noninteractive # for mariadb-server | |
apt-get install -y apache2 mariadb-server mariadb-client php5 php5-curl php5-cli php5-mysql php5-gd php-pear curl sox mpg123 sudo unixodbc | |
systemctl disable asterisk.service | |
systemctl stop asterisk.service | |
rm /var/www/html/index.html | |
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/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 | |
a2enmod rewrite | |
service apache2 restart | |
cat >> /etc/odbcinst.ini << EOF | |
[MySQL] | |
Description = ODBC for MySQL | |
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so | |
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so | |
FileUsage = 1 | |
EOF | |
cat >> /etc/odbc.ini << EOF | |
[MySQL-asteriskcdrdb] | |
Description=MySQL connection to 'asteriskcdrdb' database | |
driver=MySQL | |
server=localhost | |
database=asteriskcdrdb | |
Port=3306 | |
Socket=/var/run/mysqld/mysqld.sock | |
option=3 | |
EOF | |
cd /usr/src | |
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgz | |
tar vxfz freepbx-13.0-latest.tgz | |
rm -f freepbx-13.0-latest.tgz | |
cd freepbx | |
rm /etc/asterisk/*.conf | |
./start_asterisk start | |
./install -n | |
cat >> /etc/systemd/system/freepbx.service << EOF | |
[Unit] | |
Description=FreePBX VoIP Server | |
After=mysql.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/usr/sbin/fwconsole start | |
ExecStop=/usr/sbin/fwconsole stop | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
systemctl enable freepbx.service | |
systemctl start freepbx.service | |
systemctl status freepbx.service | |
fwconsole chown | |
fwconsole reload | |
fwconsole moduleadmin installall | |
fwconsole moduleadmin upgradeall | |
fwconsole chown | |
fwconsole reload | |
fwconsole moduleadmin uninstall dahdiconfig | |
fwconsole moduleadmin delete dahdiconfig | |
fwconsole moduleadmin uninstall sipstation | |
fwconsole moduleadmin delete sipstation | |
fwconsole moduleadmin uninstall digium_phones | |
fwconsole moduleadmin delete digium_phones | |
fwconsole moduleadmin uninstall cxpanel | |
fwconsole moduleadmin delete cxpanel | |
fwconsole moduleadmin uninstall firewall | |
fwconsole moduleadmin delete firewall | |
fwconsole moduleadmin upgradeall | |
fwconsole chown | |
fwconsole reload | |
fwconsole chown |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment