Installing asterisk on Raspberry Pi

The freely available asterisk is a software PBX that can run almost anywhere. I am operating it on a first generation Raspberry Pi and this series of documents describes how.

In my experience, asterisk is simple and sufficient..There is no need to use FreePBX. Adding another (huge) software system means lots more learning required, and unnecessary complications.

On some platforms, you might be able to install simply by apt-get install asterisk. I couldn't find the packages from my Pi.

To build and install version 16 of asterisk on a Raspberry Pi, follow these steps:
  • Run sudo apt-get update.
  • Run sudo apt-get upgrade.
  • Get source code from: wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
  • Untar it: tar zxvf asterisk-16-current.tar.gz
  • Go to the expanded folder, for example: pushd asterisk-16.6.2
  • Running sudo ./contrib/scripts/install_prereq install will install all the additional packages needed to build asterisk. They are huge. Instead of the install_prereq script, I have been successful installing only the following manually (taken from from here, or see snapshot in case the page has gone). All steps should be run with sudo.
    • apt-get install gcc make perl
    • apt-get install libxml2 libxml2-dev
    • apt-get install speex libspeexdsp-dev libspeex-dev
    • apt-get install ncurses-dev
    • apt-get install bison openssl libssl-dev
    • apt-get install sqlite3 libsqlite3-dev
    • apt-get install libncurses5-dev subversion git-core
    • apt-get install libjansson-dev
    • apt-get install uuid-dev
    • apt-get install build-essential libsrtp0-dev
    • apt-get install libedit-dev
  • Check asterisk requirements with: ./configure If there are errors, will need to investigate and fix.
  • Choose options with: make menuselect It is best to leave the default selections alone, except for perhaps sound files, unless you know what else some options may need.
  • Build with: sudo make which will take more than three hours with high CPU utilization.
  • Next: sudo make install
  • Unless you create all the configuration files manually yourself, you will need to: sudo make samples
  • Install initializing scripts with: sudo make config
  • Run sudo /etc/init.d/asterisk restart.

Wait a minute or so, and you should now be able to connect to the asterisk console by running sudo asterisk -r. My version shows 16.6.2.

Now, you are ready to continue to configure asterisk here.

There are many sources of asterisk documentation:

Like all complex technology, the documentation is somewhat self-referential and it takes considerable effort of bootstrapping before the documentation may become meaningful.

Updated December 2019

Comments

Popular posts from this blog

Things that go missing