asterisk_post

Having a problem with the installation of the Asterisk server? Read us for a simple procedure.

Asterisk is an open source framework build for communication applications. A communication server made of a normal computer by using Asterisk. IP PBX systems, VoIP gateways, conference server etc. are powered by Asterisk. It is used by small businesses, large businesses, call centres, carriers and government agencies, worldwide. Asterisk is the free and open source. Asterisk Development is one of the more user-friendly communications frameworks that are equipped with up to date networks and features enhanced media capabilities.

Asterisk Server Installation:

Pre-requisites for Asterisk installation:

  • System running with kernel-1.2.6 and their header files must be present in our system directory to compile asterisk on our system.
  • It should be written in c we require gcc with their supporting lib such as termcap, and open SSL.
  • Asterisk add-on requires MySQL header file to install the MySQL library, MySQL client and header to compile asterisk add-ons.
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: Download below mentioned files as pre-requisites steps for the asterisk installation.

  1. Zaptel (http://downloads.asterisk.org/pub/telephony/zaptel/zaptel-1.4.12.1.tar.gz)
  2. libpri (http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz)
  3. Asterisk (http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-1.8.30.0.tar.gz)
  4. Asterisk-sounds (http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-sounds-1.2.1.tar.gz)
  5. Asterisk add-ons (http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.4.7.tar.gz)

Step for Installation of an asterisk:

Copy all the files into your server (assuming you have copied all files into /us/src/) 30 Steps for installing asterisk on the system:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tar -xzf zaptel-1.4.12.1.tar.gz
tar -xzf libpri-1.4.9.tar.gz
tar -xzf asterisk-1.4.20.tar.gz
tar -xzf asterisk-sounds-1.2.1.tar.gz
tar -xzf asterisk-addons-1.4.7.tar.gz
cd zaptel-1.4.12.1
./configure
make
make install
make config
service zaptel start
cd ..
cd libpri-1.4.9
make
make install
cd ..
cd asterisk-1.4.20
./configure
make
make install
make samples
make config
cd ..
cd asterisk-sounds
make install
cd ..
cd asterisk-addons-1.4.7
./configure
make
make install
service asterisk start

Step for Installation of an asterisk:

Copy all the files into your server (assuming you have copied all files into /us/src/) 30 Steps for installing asterisk on the system:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tar -xzf zaptel-1.4.12.1.tar.gz
tar -xzf libpri-1.4.9.tar.gz
tar -xzf asterisk-1.4.20.tar.gz
tar -xzf asterisk-sounds-1.2.1.tar.gz
tar -xzf asterisk-addons-1.4.7.tar.gz
cd zaptel-1.4.12.1
./configure
make
make install
make config
service zaptel start
cd ..
cd libpri-1.4.9
make
make install
cd ..
cd asterisk-1.4.20
./configure
make
make install
make samples
make config
cd ..
cd asterisk-sounds
make install
cd ..
cd asterisk-addons-1.4.7
./configure
make
make install
service asterisk start
If all above commands run well then we have been installed new asterisk server on the current system.

Creating first sip extension:

Please add following line into sip.conf (/etc/asterisk/sip.conf)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[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 extensions that can be used any sip client (xlite,cisco sip phone, ATA). All users will get registered. If it does not work then check out the firewall settings. Please disable those settings until setup is completed.

Creating First Dialplan:

As all extension cannot talk each other unless we did not 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 the entire configured phone can talk. This makes asterisk simple platform in PBX, not many skills require to develop office PBX.

Creating First SIP Trunk:

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

Add following code to sip.conf:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[trunk]
type=friend
context=internal
host=
disallow=all
allow=ulaw
allow=alaw
allow=g723
allow=g729
dtmfmode=rfc2833
 
After the update our sip.conf looks as follows:
 
[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=
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 our extension.conf looks like:
 
[internal]
exten=> _XXXX,1,Dial(SIP/${EXTEN})
exten => _XXXXXXX.,1,Dial(SIP/trunk1/${EXTEN})
As the above setting, it is simple to create an IP-PBX with the outbound trunk. Gventure will provide you one of the best services and will fulfil all of your demands in the Asterisk Development.

Tagged: