https://wiki.asterisk.org/wiki/display/AST/Installing+Asterisk+From+Source
Get Requirements
We need gcc, g++ and some libraries:
sudo apt-get install build-essential libxml2-dev ncurses-dev
Get the source, compile and install
cd ~/Downloads
# get the source code
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.5.0.tar.gz
# untar it
tar -xf asterisk-1.8.5.0.tar.gz
cd asterisk-1.8.5.0
# clean the build directory (of crap from previous runs)
make distclean
# configure and compile Asterisk:
./configure
make
# install Asterisk on your machine:
sudo make install
# install the initscript:
sudo make config
# install the logrotation script:
sudo make install-logrotate
# install the sample configuration files in /etc/asterisk:
sudo make samples
You may not have sudo
installed on your Debian machine. In this case run su
before the first command starting with sudo and continue with the commands without the leading sudo
. After the last sudo ...
command you can quit the super user mode via [Ctrl]-[d]
.
Configure Asterisk
sip configuration
- Configure Asterisk to listen at all IPs, port 5060 via TCP.
- Define two extensions, for user one and user two.
Change your /etc/asterisk/sip.conf
accordingly:
[general]
context = default
bindport = 5060
bindaddr = 0.0.0.0
tcpbindaddr = 0.0.0.0
tcpenable = yes
[1001]
type = friend
callerid = User One <1001>
secret = 1001
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 1001
disallow = all
allow = ulaw
transport = udp
[1002]
type = friend
callerid = User Two <1002>
secret = 1002
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 1002
disallow = all
allow = ulaw
transport = udp
extensions configuration
Configure two accessible extensions using the following /etc/asterisk/extensions.conf
:
[general]
static=yes
writeprotect=no
[default]
exten => 1001,1,Answer()
exten => 1001,n,Dial(SIP/1001,20,tr)
exten => 1001,n,Hangup
exten => 1002,1,Answer()
exten => 1002,n,Dial(SIP/1002,20,tr)
exten => 1002,n,Hangup.
When you are finished configuring Asterisk, (re)start it:
/etc/init.d/asterisk restart
Debug Asterisk
You can watch Asterisk in action. Just start the Asterisk CLI:
asterisk -vvvvvvr
Resources
- Asterisk download page: http://www.asterisk.org/downloads
- Blog post on installing it on Debian: http://letitknow.wordpress.com/2011/05/16/how-to-install-asterisk-1-8-4-on-debian-6-0-1/
- Unfortunateley there is no entry for Asterisk on the German Ubuntuusers.de Wiki (Page to come nearest: http://wiki.ubuntuusers.de/Internet-Telefonie)
- On Mac OS X you may be able to install Asterisk via homebrew: https://github.com/mxcl/homebrew/blob/master/Library/Formula/asterisk.rb