Easy Steps asterisk Installation

vikaskumar2020
Joined: Mon 16 of Jan, 2006

Easy Steps asterisk Installation

Posted:Tue 15 of Mar, 2011 (05:05 UTC)
Asterisk is one best telephony solution which is free to use. There are lot of such yate are there to provide same type of solution and even more custom one. Due to easy of implementation the asterisk become more popular then anyone else. Asterisk is very easy to use and lot of open source and closed source panel are there to give the GUI model. As we all know the application are made never taking care of the requirement business faced. So anyone starting with plan asterisk and then create few phones registered and create trunk to make outbound calls, take inbound calls.
Installation of asterisk server:
Pre-requites for asterisk installation:

Asterisk require system running with kernel-1.2.6 and there header files much be present to our system directory to compile asterisk on our system. Asterisk is written in c we require gcc with there supporting lib such as termcap, and openssl. Asterisk addones require mysql header file to please install mysql lib, mysql client and header to compile asterisk-addon.

yum install bison bison-devel ncurses ncurses-devel zlib zlib-devel openssl openssl-devel gnutls-devel gcc gcc-c++ mysql-server mysql-client which flex make
Download all files:

  1. Zaptel
   2. libpri
   3. asterisk
   4. asterisk-sounds
   5. asterisk-addones

Installation of asterisk:

Copy all the files into you server (assuming you have copied all files into /us/src/)

30 Steps for installing asterisk on system:

   1. tar -xzf zaptel-1.4.12.1.tar.gz
   2. tar -xzf libpri-1.4.9.tar.gz
   3. tar -xzf asterisk-1.4.20.tar.gz
   4. tar -xzf asterisk-sounds-1.2.1.tar.gz
   5. tar -xzf asterisk-addons-1.4.7.tar.gz
   6. cd zaptel-1.4.12.1
   7. ./configure
   8. make
   9. make install
  10. make config
  11. service zaptel start
  12. cd ..
  13. cd libpri-1.4.9
  14. make
  15. make install
  16. cd ..
  17. cd asterisk-1.4.20
  18. ./configure
  19. make
  20. make install
  21. make samples
  22. make config
  23. cd ..
  24. cd asterisk-sounds
  25. make install
  26. cd ..
  27. cd asterisk-addons-1.4.7
  28. ./configure
  29. make
  30. make install
  31. service asterisk start

If all above comands run well then we have be installed new asterisk server at current system.
Creating first sip extension:

Please add following line into sip.conf (/etc/asterisk/sip.conf)
[common](!) ; this is template.
type=friend
context=internal
host=dynamic
disallow=all
allow=ulaw
allow=alaw
allow=g723
allow=g729
dtmfmode=rfc2833

[1000](common)
username=1000
secret=1000

[1001](common)
username=1001
secret=1001

[1002](common)
username=1002
secret=1002

[1003](common)
username=1003
secret=1003

[1004](common)
username=1004
secret=1004

Above we have created 5 extension that can be used any sip client (xlite,cisco sip phone, ATA). All user will get registered. If it doesnot do so then check out the firwall setting. Please put off those setting untill setup is completed.
Creating first Dialplan:

As all extension cannot talk each other unless we didnot configure its dial plan.  We have to open extension.conf (/etc/asterisk/extension.conf). Add following lines

[internal]
exten=> _XXXX,1,Dial(SIP/${EXTEN})

Now all the configured phone can talk. This make asterisk simple platform in PBX not much skills require to develop office PBX.
Creating first Sip trunk:

Asterisk can make outbound and inbound calls, for outbound we require a provide to terminate our calls, and did to get call routed to our system so for that we require to have public IP.

Add following code to sip.conf

[trunk]
type=friend
context=internal
host=<providers IP>
disallow=all
allow=ulaw
allow=alaw
allow=g723
allow=g729
dtmfmode=rfc2833

After updates sip.conf have

[common](!) ; this is template.
type=friend
context=internal
host=dynamic
disallow=all
allow=ulaw
allow=alaw
allow=g723
allow=g729
dtmfmode=rfc2833

[1000](common)
username=1000
secret=1000

[1001](common)
username=1001
secret=1001

[1002](common)
username=1002
secret=1002

[1003](common)
username=1003
secret=1003

[1004](common)
username=1004
secret=1004

[trunk]
type=friend
context=internal
host=<providers IP>
disallow=all
allow=ulaw
allow=alaw
allow=g723
allow=g729
dtmfmode=rfc2833

now  you have to add one line to extension.conf

exten => _XXXXXXX.,1,Dial(SIP/trunk1/${EXTEN})

So extension.conf look like
[internal]
exten=> _XXXX,1,Dial(SIP/${EXTEN})
exten => _XXXXXXX.,1,Dial(SIP/trunk1/${EXTEN})


As the above setting are simple create a IP-PBX with out bound trunk.