Certain packages are needed in order to install astersik properly. please run the below commands for installing the below packages uing yum.

rpm --import 
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4 (Centos4)
rpm --import 
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4 (Centos5)
yum -y install screen kernel-devel
yum -y install kernel-source bison openssl-devel mysql
yum -y install mysql-server mysql-devel gcc libtermcap
yum -y install libtermcap-devel newtnewt-devel zlib-devel
yum -y install ncurses-devel gcc-c++ compat-gcc-32
yum -y install compat-gcc-32-c++

Now create and setup the yum repositories for asterisk installation, I have found it to be an easy method of asterisk installtion using yum.

touch /etc/yum.repos.d/atrpms.repo

vi /etc/yum.repos.d/atrpms.repo

Then add the below entries to it and save.

[atrpms]
name=CentOS $releasever – $basearch – ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1

yum -y install asterisk asterisk-addons asterisk-core-sounds-en asterisk-extra-sounds-en

Now you are done.. with asterisk installation.

Start the asterisk service

/etc/init.d/asterisk start

Configure a sip server now and make your asterisk a ready to use sip server.

We configure SIP users in /etc/asterisk/sip.conf, and a standard SIP configuration looks something like this:

[linu]
type=friend
username=linu
secret=linu
host=dynamic
canreinvite=yes
context=default
callerid=”Linu” <100>
mailbox=100

[linux]
type=friend
username=linux
secret=linux
host=dynamic
canreinvite=yes
context=default
callerid=”Linu” <110>
mailbox=110

The above SIP configuration is fairly simple, but has all of the basic configuration entries that we would require for most clients. Once our SIP client has authenticated against our Asterisk system, we can call out on Digium `demo’ extension ­Simply dial 500 and we should get a voice telling us we’re connecting to Digium, followed by their IVR system. If extension 500 fails, checking the Asterisk console will give some cryptic information to aid in debugging the problem. Because the outbound connection to Digium is using IAX, it should work on any network.

Configuring an extension to call our SIP phone is done through /etc/asterisk/extensions.conf, and we can simply add a 100 extension to the default context. The extensions.conf file is split into numerous contexts, so depending upon how the call comes in, or how we choose to route the call, various contexts are used. Within contexts, extensions are defined as lists of priorities, with each being called in turn until we either get to the end, or one of the calls jumps us to a different priority.

For example, a busy device will jump us to the current extension + 101, so we can drop people in voicemail, rather than simply hang up on them. Our extension 100 configuration would look something along the lines of the following:

Now we add something to /etc/asterisk/extensions.conf for configuring the two sip accounts with extension 100 and 110

[default]
exten => 100,1,Dial(SIP/linu,20,Ttr)
exten => 100,2,VoiceMail(u100)
exten => 100,3,Hangup()
exten => 100,102,VoiceMail(b100)
exten => 100,103,Hangup()

[default]
exten => 110,1,Dial(SIP/linux,20,Ttr)
exten => 110,2,VoiceMail(u110)
exten => 110,3,Hangup()
exten => 110,102,VoiceMail(b110)
exten => 110,103,Hangup()

reload your astersik configuration.

/etc/init.d/astersik reload.

Now that you need to have installed X-lite software in your pc for testing sip, start it up, you should see two windows, the main phone interface window and the configuration window.

       
   
 



Enabled Yes

Display Name Linu

Username Linu

Authorisation User Linu

Password Linu

SIP Proxy The IP address of your Asterisk server

Domain/Realm The IP address of your Asterisk server (if you have an FQDN

(domain name) then you can use that )

Register Always
Now you are done with your sip server.

This is a cool article which is proved to be working and please try it now friends.