How to install Asterisk 1.8.4 on Debian 6.0.1

In my previous post I installed Asterisk on Ubuntu Server. In this post I install Asterisk 1.8.4 on Debian 6.0.1 “squeeze”.
I created a step by step guide to prevent you from the usually error messages during the installation.

After the upgrade on a fresh install, we need three packages to build up our Asterisk. Let’s install the build-essential, libxml2-dev, and ncurses-dev packages.

 
apt-get install build-essential libxml2-dev ncurses-dev 

You can find all versions of the Asterisk at the download section. Download the latest version, and extract it!

 
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.3.3.tar.gz 
tar zxvf asterisk-1.8.3.3.tar.gz 

Then install the Asterisk, config, and the shamples.

 
cd asterisk-1.8.3.3/ 
./configure 
make 
make install 
make config 
make samples 

Without the above-mentioned additional packages, you will face with these error messages during the ./configure command run.

Lack of build-essential package:

 
configure: error: in `/root/asterisk-1.8.3.3': 
configure: error: no acceptable C compiler found in $PATH 

Lack of libxml2-dev package:

 
checking for xml2-config... no 
configure: *** XML documentation will not be available because the 'libxml2' development package is missing. 
configure: *** Please run the 'configure' script with the '--disable-xmldoc' parameter option 
configure: *** or install the 'libxml2' development package. 

Lack of ncurses-dev package:

 
configure: error: *** termcap support not found (on modern systems, this typically means the ncurses development package is missing) 

When the installation finishes, we have a preconfigured Asterisk. To test the Asterisk with two softphones, let’s configure the sip.conf and the extensions.conf.

Here is the sip.conf file:

 
[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 

This config means that the Asterisk listen all IP, port 5060, and the TCP is enabled. It has two extensions defined for User One and User Two.

Here is the extensions.conf file:

 
[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. 

This config means that there are two accessible extensions existing.

After configuring the Asterisk, we need to start it.

 
/etc/init.d/asterisk start 

Asterisk_02

I use X-Lite to connect to the soft PBX. Let’s configure the X-Lite!

All data come from the sip.conf. The Account name, and the Display name are the callerid. The User ID and the Authorization name are the extension number – inside the square brackets. The Password is the sicret. The Domain is the IP address of the Asterisk server.

If all configurations are good, the X-Lite will inform you.

Asterisk_03

Let’s call from User One to User Two.

Here is the User One side:

Asterisk_04

Here is the User Two side:

Asterisk_05

Troubleshooting? We always need when we try a new thing. The firs tool is the tcpdump of course, but the asterisk have a good command line interface (Asterisk CLI) to debug the problem. To access the Asterisk CLI type

 
asterisk -vvvvvvr 

This screen shows a successful call from 1001 to 1002.

Asterisk_06

The Asterisk works now! CU next time! 😉

17 thoughts on “How to install Asterisk 1.8.4 on Debian 6.0.1”

  1. It is appropriate time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I wish to suggest you few interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more things about it!

  2. I’m also writing to let you understand what a exceptional discovery my cousin’s princess gained reading through your web site. She came to find too many things, which included what it’s like to have a great coaching heart to have most people without problems comprehend some grueling subject matter. You actually did more than our own expectations. Many thanks for supplying those practical, trusted, informative and as well as cool tips on that topic to Julie.

  3. having tried to run asterisk on unbuntu but came across some nasty problems being a novice who is learning i attempted to do this on vmware using debian 6 it started well but as i found with unbuntu there was a lack of ncurses, so i followed your path but recieved this on the very first line: E: Invalid operation build-essential. i have looked everywhere to see what my error is but my knowledge is primary school in comparison. please help

  4. now i have: configure: error: *** termcap support not found (on modern systems, this typically means the ncurses development package is missing)
    root@debian:/home/simon/asterisk-1.8.12.0# apt-get install ncurses-dev
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package ncurses-dev is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘ncurses-dev’ has no installation candidate

  5. Maybe I do not undestand the whole idea behind it, but setting

    “tcpenable=yes” in section [general] and setting “transport=udp” in phones section does not make any sense to me.

    I think you do NOT want Asterisk to listen on TCP-Port 5060 – I think you would never want to make VoIP calls over TCP.

    Furthermore it is a little security issue – you may already block unwanted connections to UDP-port 5060 but you could tend to forget to block the same TCP-port.

    From sip.conf as of Astersik 1.8.18.0:
    tcpenable=no ; Enable server for incoming TCP connections (default is no)

    1. Hi Ron,

      The idea was a rather old thing. Many years ago, when the Asterisk supported only UDP SIP, I used another soft PBX to translate UDP to TCP, because I connected it to an Exchange 2007 Server. The Exchange 2007 UM server only supported TCP SIP. Later the Asterisk supported TCP SIP, so I could connected it directly to Exchange Server. This is the reason why I used TCP SIP.

      1. Ah, okay, now I get the idea 😉

        I found your blog when I was searching for “Installing Asterisk on Debian” and therefor I considered your nice “tutorial” as a general template.

        Since you had something special in mind with that setup, maybe you would like to stress that in your posting so that others will be aware why you did that.

        Just a thought …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s