Skip to content

Instantly share code, notes, and snippets.

@basamoahjnr
Created July 27, 2019 12:03
Show Gist options
  • Save basamoahjnr/183b3e8d9532ce2899d62030cd81aa0d to your computer and use it in GitHub Desktop.
Save basamoahjnr/183b3e8d9532ce2899d62030cd81aa0d to your computer and use it in GitHub Desktop.
Asterisk16 CentOS Install
sudo yum upgrade -y
sudo yum -y install yum-plugin-fastestmirror
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
sudo yum --enablerepo=elrepo-kernel install kernel-lt -y
sudo yum --enablerepo=elrepo-kernel -y swap kernel-headers -- kernel-lt-header -y
sudo yum --enablerepo=elrepo-kernel -y swap kernel-tools-libs -- kernel-lt-tools-libs -y
sudo yum --enablerepo=elrepo-kernel -y install kernel-lt-tools
sudo yum --enablerepo=elrepo-kernel -y swap kernel-devel -- kernel-lt-devel
sudo yum -y remove kernel
sudo setenforce 0
sudo sed -i 's/\(^SELINUX=\).*/\SELINUX=permissive/' /etc/selinux/config
sudo firewall-cmd --zone=public --permanent --add-service=sip
sudo firewall-cmd --zone=public --permanent --add-service=sips
sudo firewall-cmd --zone=public --permanent --add-port=2727/udp
sudo firewall-cmd --zone=public --permanent --add-port=10000-20000/udp
sudo firewall-cmd --permanent --list-services
sudo firewall-cmd --permanent --list-ports
sudo yum group -y install "Development Tools"
sudo yum install net-tools git wget vim net-tools sqlite-devel psmisc ncurses-devel libtermcap-devel newt-devel libxml2-devel libtiff-devel gtk2-devel libtool libuuid-devel subversion crontabs cronie-anacron -y
sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
sudo tar -zxvf asterisk-16-current.tar.gz
cd asterisk-16*
sudo ./contrib/scripts/install_prereq install
sudo ./contrib/scripts/get_mp3_source.sh
sudo ./configure --libdir=/usr/lib64 --with-jansson-bundled --with-pjpproject-bundled
sudo make menuselect
sudo make
sudo make install
sudo make samples
sudo make config
sudo ldconfig
sudo groupadd asterisk
sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk
sudo usermod -aG audio,dialout asterisk
sudo cho:wn -R asterisk.asterisk /var/run/asterisk
sudo chown -R asterisk.asterisk /etc/asterisk
sudo chown -R asterisk.asterisk /var/lib/asterisk
sudo chown -R asterisk.asterisk /var/log/asterisk
sudo chown -R asterisk.asterisk /var/spool/asterisk
sudo chown -R asterisk.asterisk /usr/lib64/asterisk
cd ..
sed -i "/END INIT INFO/a AST_USER='asterisk'\nAST_GROUP='asterisk'" /etc/init.d/asterisk
sed -i "s|exit 0|/usr/local/sbin/amportal restart\nexit 0|" /etc/rc.local
sudo sed -i "s|;runuser|runuser|" /etc/asterisk/asterisk.conf
sudo sed -i "s|;rungroup|rungroup|" /etc/asterisk/asterisk.conf
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment