Skip to content

Instantly share code, notes, and snippets.

@andrius
Last active December 6, 2016 22:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save andrius/362e36361cd0cf15281c to your computer and use it in GitHub Desktop.
Save andrius/362e36361cd0cf15281c to your computer and use it in GitHub Desktop.
Install Asterisk with OPUS support on top of FreePBX distro (CentOS 6.5 32-bit!!! + FreePBX 2.1.1)
amportal stop
yum -y update
yum -y groupinstall core && yum install -y tmux patch screen gcc gcc-c++ lynx bison mysql-devel mysql-server sqlite-devel sqlite libsqlite3x-devel php php-mysql php-pear php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron wget odbc-devel unixODBC unixODBC-devel mysql-connector-odbc libtool libtool-ltdl libtool-ltdl-devel libcurl-devel libogg-devel libvorbis-devel speex-devel freetds-devel net-snmp-devel corosynclib-devel popt-devel lua-devel portaudio-devel libresample-devel neon-devel libical-devel openldap-devel gmime22-devel sqlite2-devel libedit-devel libuuid-devel openssl-devel doxygen kernel-headers-`uname -r` kernel-devel-`uname -r` glibc-headers
cp -R /etc/asterisk /etc/asterisk-backup
yum remove asterisk11*
# yum install libsrtp-devel
cd /usr/src
wget --continue http://srtp.sourceforge.net/srtp-1.4.2.tgz
tar zxvf srtp-1.4.2.tgz
cd srtp
./configure
make
make install
# download SpanDSP (need to support faxing)
cd /usr/src
wget --continue http://soft-switch.org/downloads/spandsp/spandsp-0.0.6pre21.tgz
tar -zxf spandsp-0.0.6pre21.tgz
cd spandsp-0.0.6
make clean
./configure
make all
make install
# download OPUS
cd /usr/src
git clone https://github.com/andrius/asterisk-opus.git
wget --continue http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar -zxf opus-1.1.tar.gz
cd opus-1.1
make clean
./configure --prefix=/usr
make all
make install
# download asterisk PBX
cd /usr/src
wget --continue http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11.11.0.tar.gz
tar -zxf asterisk-11.11.0.tar.gz
cd asterisk-11.11.0
contrib/scripts/get_mp3_source.sh
patch -p1 -u < ../asterisk-opus/asterisk-11.11.0-opus+vp8.patch
./bootstrap.sh
./configure --with-crypto --with-ssl --with-srtp
# make menuselect
make all
make install
# make samples
make config
make progdocs
make install-logrotate
# install asterisk utilities
cp -R ./contrib/scripts/astcli /usr/local/bin/
mkdir -p /var/punchblock/record
chown -R asterisk:asterisk /var/punchblock
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /etc/asterisk
chown -R asterisk:asterisk /var/{lib,log,spool}/asterisk
chown -R asterisk:asterisk /usr/lib/asterisk
amportal start
@svetlichny
Copy link

Hello, found your gist via google and got a beginner question about this: what if I've done everything listed here line by line but asterisk -rx "core show translation" doesn't show opus codec? I've checked it in menuselect and so forth, but it's absent, and aterisk's CLI doesn't recognize opus command. Could you please point out in what direction to search?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment