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




No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails