Asterisk, how to create a SIP account

This guide shows you how to register 2 users on the Asterisk PBX and add 1-1 extension to each user. One of the users can be connected with Ozeki. Before you start to configure this solution it is assumed that you have already installed your Asterisk PBX on a Linux distribution. This guide is made using a Fedora distribution.

In this solution, two configuration files (users.conf, extensions.conf) will be modified. You can download these files from here:
Download: config_files.zip (32 kb)

Configure Asterisk

Start a terminal at the Linux server and login as superuser. For this, type su and login with the administrator password (Figure 1).

su

login user
Figure 1 - Login as superuser

Then navigate to the config directory of Asterisk (Figure 2). In this example it is located in the etc directory.

cd /etc/asterisk/
navigate to config dir
Figure 2 - Navigate to the config directory

The users.conf contains the settings that can be used by clients to register to the PBX. Open this file with a plain text editor. In this example I use a built-in text editor: vi (Figure 3).

vi users.conf

edit users.conf file
Figure 3 - Edit users.conf file

In this example I will register two users. User 100 for a landline phone and user 101 for Ozeki (Figure 4).

To do this, I insert the following lines into the config file:

[100]
type=friend
username=100
callerid=100
secret=100
context=test
host=dynamic
allow=all
			
[101]
type=friend
username=101
callerid=101
secret=101
context=test
host=dynamic
allow=all

register two users
Figure 4 - Register two users

Finally, quit the editor by pressing Escape button and type :wq (Figure 5).

         :wq
         

save and exit
Figure 5 - Save and exit

Next open extensions.conf file for editing the dial plan (Figure 6).

         vi extensions.conf
         

open the extensions file
Figure 6 - Open extensions.conf file

In extensions.conf file you can find the user's dial plans. Now set the dial plan for the created user accounts (Figure 7).

In this example I will use the following dial plan:

[test]
exten => 100,1,Dial(SIP/100)
exten => 101,1,Dial(SIP/101)
         

dial plans
Figure 7 - Dial plans

Insert the dial plan, save the file and exit (Figure 8).

         :wq
         

save dial plans
Figure 8 - Save Dial plan

Start asterisk service by typing: service asterisk start. The service will start with the new configuration (Figure 9).

         service asterisk start
         

start asterisk service
Figure 9 - Start asterisk service


Now the configuration is complete so you can start your phone lines and connect them with Ozeki.

More information