Showing posts with label asterisk. Show all posts
Showing posts with label asterisk. Show all posts

Thursday, July 9, 2009

Configuring IP Phones with Asterisk

The Most cheapest way to talk in between.... Asterisk allows people to communicate using the internet.

First step : Download a Soft Phone ( xlite recommended)

download link : http://www.counterpath.com/x-lite.html&active=4

SIP Client Configuration: (Now I am talking about the SIP clients only)
Now, I will describe how you can register SIP users with asterisk. This includes the configuration of all Asterisk conf files and phone settings.

First, make sure Asterisk is installed. Most of the files to be configuration files are stored in the folder /etc/asterisk.

Example:
All information for SIP users is stored in sip.conf. Dialing Rules are read from extensions.conf. Voicemails are stored in voicemail.conf etc.

However, you do need a username and secret which will allow you to call someone who is registered. To receive a call, you must be a registered user and have an extension.

To Register SIP Users:

All users must be registered in sip.conf or users.conf and all valid extensions must be declared in extensions.conf

Follow these instructions:

-Registering a user in sip.conf or users.conf
-Registering a number in extensions.conf

1.
open the users.conf file in /etc/asterisk folder and enter the following user information

[1000]
username = 1000
disallow = all
allow = ulaw,alaw,gsm,g726,g729
host = dynamic
type=friend
secret = 1000
context = internaldemo
cid_number = 1000
hassip = yes
nat = no
canreinvite = no
dtmfmode = RFC2833
insecure = port

[1000]
This means we are registering user with extension '1000'.

secret - the password of the user '1000'.

host=dynamic
This sets dynamic IP for the host. You may also define this as a static IP

context=internaldemo
This defines the dial context for the user which in this case is internaldemo. In Asterisk, outgoing numbers are divided in groups called contexts in order to separate/define different needs for different user types. For example, a context for local calls, another for within the city, and another for international calls and so on.

The user registration process is now completed on Asterisk. Let us write a dialing rule for the user.

2 .Go to /etc/asterisk and open extensions.conf

Type the following

[
internaldemo]
exten = 123, 1, Dial(SIP/1000)

[
internaldemo]
This registers the context ‘internaldemo

exten => 123,1,Dial(SIP/1000)

when dialing number 123, Asterisk will first Dial the user (1000) xlite through SIP protocol. The command is : exten => number, priority, Dial(protocol/user). The priority determines the sequence in which the extensions will be executed.

We now have a registered SIP user and extension on Asterisk. Follow this same process to register another SIP user and extension in order to place calls.

Start by registering the second user in the same way in /etc/asterisk/users.conf

[1001]
username = 1001
disallow = all
allow = ulaw,alaw
host = dynamic
type=friend
secret = 1001
context = internaldemo
cid_number = 1001
hassip = yes
nat = no
canreinvite = no
dtmfmode = RFC2833
insecure = port

Register the extension (1234) in /etc/asterisk/extensions.conf in the same context
internaldemo.

[internaldemo]
exten = 123, 1, Dial(SIP/1000)
exten = 1234, 1, Dial(SIP/1001)


Now the configuration are ready. Start the asterisk pbx by typing asterisk -gvvvvvvvvvvc in the terminal. if u are already started type module reload in the asterisk CLI.


X-Lite Configuration

Take menu > System Settings > Sip Proxy > Default




Tuesday, July 7, 2009

Asterisk installation

Before we can start, make sure you have the following:
1. Computer with installed Linux OS (Fedora 7)
2. Asterisk's installation packages

1. Download the Asterisk Installation packages
asterisk 1.4.21.2
zaptel 1.4
Libpri 1.4.10.1
asterisk addons 1.4.8
(For Mp3 Support and MySql)

2. Obtain from a SVN server:

Do not forget that you need to have an installed SVN package. Use the following command:

# yum install subversion


2.1 Latest CVS Head Version

To get the latest head version use this command:

# svn checkout http://svn.digium.com/svn/asterisk/trunk asterisk
# svn checkout http://svn.digium.com/svn/zaptel/trunk zaptel
# svn checkout http://svn.digium.com/svn/libpri/trunk libpri


Check for the availability of some other packages:

rpm -q bison
rpm -q bison-devel
rpm -q ncurses
rpm -q ncurses-devel
rpm -q zlib
rpm -q zlib-devel
rpm -q openssl
rpm -q openssl-devel
rpm -q gnutls-devel
rpm -q gcc
rpm -q gcc-c++

If any of those packages are not installed install them by using yum

yum install bison
yum install bison-devel
yum install ncurses
yum install ncurses-devel
yum install zlib
yum install zlib-devel
yum install openssl
yum install openssl-devel
yum install gnutls-devel
yum install gcc
yum install gcc-c++



3. Compiling Asterisk on most Linux distributions

Extract the tar file and go to the folder where you extracted the files.
#cd /usr/src/asterisk


Important: Follow this installation order: libpri, zaptel, asterisk

-Installing libpri
#cd /usr/src/asterisk/libpri
#make clean
#make
#make install


-Installing zaptel
#cd /usr/src/asterisk/zaptel
#make clean

Note: If you are using kernel 2.6 enter the following command '#make linux26', before doing '#make install'.

-Installing asterisk

#cd /usr/src/asterisk/asterisk
#make clean

Note: If you want to use a mp3 files for music-on-hold enter the following command '#make mpg123', before doing '#make install'.

#make install

If this is your first installation perform 'make samples' to install sample configuration files.

Check your asterisk installation by stating your asterisk daemon by typing safe_asterisk and connect to its CLI (Command Line interface) by typing asterisk -gvvvvvvvvvvvr. Now type this command in the asterisk CLI "module reload".

Introducing New Technology -- Asterisk - The Complete PBX in Software

Hello Friends. Let's begin our journey into the world of Asterisk.

Asterisk is a software implementation of a telephone private branch exchange (PBX) originally created in 1999 by Mark Spencer of Digium. Like any PBX, it allows attached telephones to make calls to one another, and to connect to other telephone services including the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services.

Reference (http://en.wikipedia.org/wiki/Asterisk_(PBX))

LinkWithin

Related Posts with Thumbnails