Building Asterisk: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
mNo edit summary
Line 1: Line 1:
Recent changes to this doc: I am now using the pjsip library
Recent changes to this doc: I am now using the pjsip library


* 2016-Jan-16 Asterisk 13.7
* 2015-Dec-10 Building on the new [[Vastra]].
* 2015-Dec-10 Building on the new [[Vastra]].
* 2015-Jun-23 Adding XMPP support.
* 2015-Jun-23 Adding XMPP support.
Line 17: Line 18:
   uw-mailutils libc-client2007e-dev libssl-dev libpam0g-dev
   uw-mailutils libc-client2007e-dev libssl-dev libpam0g-dev


For calendars
For calendars, which I don't have working yet but all the same this is what you need,


  sudo apt-get -y install libical-dev libgcal-dev davical libneon27-dev
  sudo apt-get -y install libical-dev libgcal-dev davical libneon27-dev
Line 23: Line 24:
=== PJSIP ===
=== PJSIP ===


The PJSIP upgrade for SIP for Asterisk is done using plproject.
The PJSIP upgrade for SIP for Asterisk is done using plproject. I have built it but not using it yet.
Read about it here: https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject
Read about it here: https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject


Line 38: Line 39:
  svn checkout http://svn.asterisk.org/svn/libpri/branches/1.4 libpri
  svn checkout http://svn.asterisk.org/svn/libpri/branches/1.4 libpri


==== conservative option: Pjproject download from site ====
==== Production code option: Pjproject download from site ====


  cd ~/src
  cd ~/src
Line 64: Line 65:


More about [[PJSIP]]
More about [[PJSIP]]
=== Building Kamailio 4.2 ===
Not using Kamailio yet. But here are some instructions anyway.
sudo apt-get install bison flex
make cfg
emacs modules.list (add db_mysql to include_modules)
make all
sudo make install


=== Dahdi ===
=== Dahdi ===


Dahdi is the part of Asterisk that supports the PSTN hardware.
Dahdi is the part of Asterisk that supports the PSTN hardware.
You used to need Dahdi for conference call support. There are two folders, dahdi-linux and dahdi-tools.
You used to need Dahdi for MeetMe, which I am not using. There are two folders, dahdi-linux and dahdi-tools.
Currently I only install Dahdi if I need the support for a PCI card.


  sudo apt-get install  linux-headers-`uname -r`
  sudo apt-get install  linux-headers-`uname -r`
Line 94: Line 85:
== Asterisk ==
== Asterisk ==


If you are building from scratch then do
I use officially released code right now, not development releases.
You can git clone to get development trunk or use this.


wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar xzvf asterisk-13-current.tar.gz
cd asterisk-13.7.0
  ./configure -with-imap=system
  ./configure -with-imap=system
  make menuselect # in add-ons turn on format-mp3 if you do this you need the next step
  # in add-ons turn on format-mp3 if you do this you need the next step
  ./contrib/scripts/get_mp3_source.sh
  ./contrib/scripts/get_mp3_source.sh
  make -j 7
# I turn off a bunch of things I will never use
# note items marked XXX will not be built because of missing dependencies
make menuselect
# Using all the processor cores is MUCH FASTER... I have 8 on [[Bellman]] so I use them all
  make -j 8
  sudo make install
  sudo make install
  sudo make samples  # optionally...
  # sudo make samples  # optionally... installs all those files into /etc/asterisk/
  sudo make progdocs # optionally...
  # sudo make progdocs # optionally...


If you are rebuilding (for example to add pjsip late in the game) then do:
If you are rebuilding (for example to add pjsip late in the game) then update.
(you can check in menuselect under 'resources' to make sure res-pjsip is included now)
(you can check in menuselect under 'resources' to make sure res-pjsip is included now)
   
   
Line 110: Line 110:
  ./configure
  ./configure
  make clean
  make clean
  make menuselect ; in add-ons turn on format-mp3 if you do this you need the next step
  # etc as above
./contrib/scripts/get_mp3_source.sh
make -j 6
sudo make install


== Packaging for Debian ==
== Packaging for Debian ==
Line 121: Line 116:
== Working with the Asterisk REST interface (ARI) ==
== Working with the Asterisk REST interface (ARI) ==


I wonder why this is not on its own page.
[[Asterisk REST Interface]]
 
In order to try out the Asterisk REST interface (ARI)
you need Apache set up and running (or NGINX perhaps) and you need PHP.
 
Well, there are other ways to do REST but that's the stack I chose.
 
There is a PHP project going called [[PHPARI]].


[[Category: VOIP]]
[[Category: VOIP]]

Revision as of 03:04, 17 January 2016

Recent changes to this doc: I am now using the pjsip library

  • 2016-Jan-16 Asterisk 13.7
  • 2015-Dec-10 Building on the new Vastra.
  • 2015-Jun-23 Adding XMPP support.
  • 2015-Jun -- Both vastra2 and bellman have been upgraded to Debian 8 and Asterisk 13.4 (trunk on Bellman)
  • 2015-Apr-11 -- Working on my Mac in the Novato public library using the Wildsong PBX virtualbox as my build environment.
  • 2015-Apr-12 -- rebuilding the copy of Asterisk that runs my home PBX on Bellman.

Prerequisites

sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install build-essential subversion git ncurses-dev \
 libncurses5 libxml2 libxml2-dev doxygen libcurl4-openssl-dev \
 libncurses5-dev uuid-dev libjansson-dev libsqlite3-dev libspeex-dev python-gobject libresample1-dev libiksemel-dev\
 unixodbc unixodbc-bin unixodbc-dev libltdl-dev libmpg123-dev libmyodbc \
 uw-mailutils libc-client2007e-dev libssl-dev libpam0g-dev

For calendars, which I don't have working yet but all the same this is what you need,

sudo apt-get -y install libical-dev libgcal-dev davical libneon27-dev

PJSIP

The PJSIP upgrade for SIP for Asterisk is done using plproject. I have built it but not using it yet. Read about it here: https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject

Developer option: Source download via version control

Download the pjsip code from pjsip.org, unpack, or get the experimental svn version. Likewise the asterisk code.

cd ~/src/asterisk/
svn checkout http://svn.pjsip.org/repos/pjproject/trunk pjproject-trunk
svn checkout http://svn.asterisk.org/svn/asterisk/trunk asterisk-trunk
git clone git://git.asterisk.org/dahdi/linux dahdi-linux
git clone git://git.asterisk.org/dahdi/tools dahdi-tools
svn checkout http://svn.asterisk.org/svn/libpri/branches/1.4 libpri

Production code option: Pjproject download from site

cd ~/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://www.pjsip.org/release/2.4.5/pjproject-2.4.5.tar.bz2

Pjproject build

Video support

apt-get install libv4l-dev fswebcam qv4l2 v4l-utils sdl yuv openh264

Suggested flags to configure the build:

cd pjproject-trunk
./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG'
make dep
make -j 6
sudo make install
sudo ldconfig

More about PJSIP

Dahdi

Dahdi is the part of Asterisk that supports the PSTN hardware. You used to need Dahdi for MeetMe, which I am not using. There are two folders, dahdi-linux and dahdi-tools. Currently I only install Dahdi if I need the support for a PCI card.

sudo apt-get install   linux-headers-`uname -r`
cd dahdi-linux
make -j 6 all
sudo make install
sudo make config
cd ../dahdi-tools
autoconf
./configure
make -j 6
sudo make install

Asterisk

I use officially released code right now, not development releases. You can git clone to get development trunk or use this.

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar xzvf asterisk-13-current.tar.gz
cd asterisk-13.7.0

./configure -with-imap=system
# in add-ons turn on format-mp3 if you do this you need the next step
./contrib/scripts/get_mp3_source.sh
# I turn off a bunch of things I will never use
# note items marked XXX will not be built because of missing dependencies
make menuselect
# Using all the processor cores is MUCH FASTER... I have 8 on Bellman so I use them all
make -j 8
sudo make install
# sudo make samples  # optionally... installs all those files into /etc/asterisk/
# sudo make progdocs # optionally...

If you are rebuilding (for example to add pjsip late in the game) then update. (you can check in menuselect under 'resources' to make sure res-pjsip is included now)

git fetch
./configure
make clean
# etc as above

Packaging for Debian

Working with the Asterisk REST interface (ARI)

Asterisk REST Interface