Nityas World - Official Blog Of Nityanand Parab
Asterisk installation and configuration for VOIP 
Monday, January 14, 2008, 03:14 PM - VOIP
Posted by Administrator
Using VOIP with the help of asterisk software

There will be two things we have to take into consideration.First is the server configuration and second is the client configuration.For the server we have used Asterisk 1.4.17 on RHEL 4 and for the client side we have used X-lite ver 3 on Windows XP box.

Download the Asterisk 1.4.17 from here. We downloaded the tar file. The command to extract the tar file is.
tar xzvf filename.tgz

After extracting the contents it creates a directory. Change to that directory

Then issue commands as follows one after another
./configure
make
make install
make samples
(Note: if you have downloaded the rpm then ./configure command will not be required)

This will load the asterisk program on the Linux box
Run the command
asterisk –vvvc
to start asterisk with verbose mode so it will display the progress or errors if any getting generated during the sessions.

We have to modify the following files in order to make asterisk functional

/etc/asterisk/sip.conf and /etc/asterisk/extensions.conf and voicemail.conf(if voicemail required)


I will show you the minimal configuration you will need to get the Asterisk working.
A.
Add the following lines at the end of sip.conf

[test1]
type=friend
secret=123
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=internal
mailbox=444@test1

test1 is the username
secret is the password
host is the servername or the ip address of the Asterisk server(you can keep it dynamic also)
If your asterisk server is beyond nat then you have to use nat=yes option and if it is in the same network then nat=no.
canreinvite= yes will allow RTP voice traffic to bypass Asterisk and canreinvite= no will not allow RTP voice traffic to bypass Asterisk
context will be defined in extensions.conf
If you are going to use voicemail support then we have to add the line
mailbox=444@test1 Here 444 is the extension to dial for voicemail retrieve or to get the voicemail and test1 is the username.

Create more users in sip.conf like below and save the file

[test1]
type=friend
secret=123
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=internal
mailbox=444@test1

[test2]
type=friend
secret=123
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=internal
mailbox=555@test2

Also keep the domain as you like, in our case we had kept it as mydomain.com by changing the option
domain=mydomain.com

Save the file.

B.
Now we have to edit extensions.conf file
Add the below lines at the end of extensions.conf

[internal]

exten => 103,1,Dial(SIP/test2,10)
exten => 103,2,VoiceMail(555@test2)
exten => 555,1,VoiceMailMain,555@test2

exten => 102,1,Dial(SIP/test1,10)
exten => 102,2,VoiceMail(444@test1)
exten => 444,1,VoiceMailMain,444@test1

Here we are defining context as internal which will be in brackets [internal]
We will take first line
exten will represent extension
103 is the extension for user test2
1 is the priority
Dial is the command to execute SIP with the username test2 and 10 is the delay in seconds for which the call will be on the ring and then it will passed on to the voicemail.

On the second line we will give same extension with 2 as the priority which will be for defining voicemail and the command will be VoiceMail
555 will be the extension to dial voicemail for that particular user and test2 is of course the username in our case.

On the third line we are defining parameters to retrieve the voicemail.
555 is the extension number for user test2 to retrieve his voicemail
1 is the priority
VoiceMailMain is the function
555@test2 is extension@username

C.
Then for the voicemail we will need to edit /etc/voicemail.conf and add the following lines at the end of it.

[test2]
555 => 123,test2,test2@localhost

Here we will define the options for test2 user in the bracket mention the username [test2]
555 is the extension to retrieve the voicemail for user test2
123 is the password for accessing test2 user's voicemail
test2 is the username and test2@localhost is username@localhost. So the mail will get dropped in this mailbox on the server.

Save the file.

D.
We also have to modify the /etc/dovecot.conf file
dovecot.conf is the file mainly used for IMAP service. If the service is not installed please load it first from the RHEL cd.Otherwise you will not get
dovecot.conf file in /etc

Uncheck the below option in dovecot.conf
protocols = imap imaps

in the below option add the asterisk server address
imap_listen = [Asterisk server IP address]

Save the file.

This completes the server configuration of VOIP with asterisk server.Please either stop iptables service or add the rule for asterisk on the server, otherwise the
communication will not happen between Asterisk server and client machines.



We will start now with the client side configuration of VOIP.The client must be able to communicate with server.We used Windows XP and the client was X-lite ver 3.Download the x-lite software from this location

Double Click on the X-Lite setup Icon.
X-Lite Installation Wizard will open.
Click next on the X-Lite Setup wizard.
Accept the License Agreement and Click Next.
Keep destination location as it is and Click Next.
Installation will start and complete the X-Lite Setup.Click Finish.Select the checkmark on this screen which says "Start the x-lite after installation"
X-Lite will launch and Call Quality information will ask for quality of Product (Yes/No) Click Yes.
Session Initiation Protocol (SIP) Account wizard will open for adding the users.
At first Properties of Account1 window will pop up where we can enter the account details.

In User details give the information for the user test2 which we have added in sip.conf of Asterisk server
Give display name as test2
User name as test2
Password as 123
Authorization user name as test2
Domain name as mydomain.com

In Domain proxy

Uncheck "Register with domain and receive incoming calls" option
For send outbound via option select the proxy checkmark and give the IP address of Asterisk server
Click on apply and then Ok.

This completes the x-lite configuration.Add other users on different client machines.To make a call to user dial his extension number like 100 or 101 as defined in the sip.conf file and then press call button.

To get the voicemail dial the number for voicemail which is set for that particular user in our case it was 555 for test2.It will ask for password.Give the password configured in voicemail.conf for that user.The server will give the options to read out the voicemails one by one.

This is the basic configuration only.Asterisk gives you numerous options.To configure those options and find out more technical information visit
asteriskguru.com and voip-info.org


Other categories

Cisco Jokes Photos Tutorials Voip Goa




<<First <Back | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Next> Last>>