Thursday, October 7, 2010

Simple asterisk setup

Asterisk is an open source telephony system or PBX (private brach exchange). What this means is that you can setup your own telephony system at home, where you can call phones internal (like dialing extensions in a business) and also make outgoing calls to the outside world. The system can interface with almost any type of telephony hardware and can speak many communication protocols.

Below is a quick list of commands and configs that i've used to install asterisk and connect two softphones to the system.

Tested on Backtrack 4 (Will be installing on a Ubuntu 10.04 later).

Get the dependecies asterisk may require:

# apt-get -y install build-essential libncurses5-dev libcurl3-dev libvorbis-dev libspeex-dev unixodbc unixodbc-dev libiksemel-dev linux- headers-`uname -r`

Then insall asterisk:

# cd /usr/src
# wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
# tar -zxvf asterisk-1.4-current.tar.gz
# cd asterisk-1.4-current
# ./configure && make && make install && make samples

Then we can configure our sip.conf, and extensions.conf as follows

##### sip.conf #####

[general]
port = 5060
bindaddr = 0.0.0.0
context = default

[100]
type=friend
context=incoming-calls
secret=100
host=dynamic

[101]
type=friend
context=my-phones
secret=101
host=dynamic


################

##### extensions.conf #####

[others]

[incoming-calls]

exten => 100,1,Dial(SIP/100,10)
exten => 101,1,Dial(SIP/100,10)


################

You will have to configure your softphones to match the settings in the sip.conf file

References / Good Reading: