Take a look at the things that interest us.

Creating a basic Sip Account set up for Asterisk

Wesley Wesley 2 years

In this post, I would like to show you a quick example of how to create a few sip accounts in Asterisk and make your first call within minutes.


How to register a simple sip account in Asterisk

To register a sip account in Asterisk, we'll need to add a few parameters to our pjsip.conf file. First, let's move to our Asterisk directory and open the pjsip.conf file.

$ cd /etc/asterisk
$ vi /pjsip.conf

Now let's add the following parameters to the file and save it.

# pjsip.conf
allow_overlap = no
disable_tcp_switch => y


password = 12345678

type = endpoint
context = extensions
disallow = all
allow = ulaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
ice_support = yes
direct_media = no

username = 1000

auth = 1000
outbound_auth = 1000
aors = 1000

username = 1001

auth = 1001
outbound_auth = 1001
aors = 1001

username = 1002

auth = 1002
outbound_auth = 1002
aors = 1002

username = 1003

auth = 1003
outbound_auth = 1003
aors = 1003

username = 1004

auth = 1004
outbound_auth = 1003
aors = 1004

In this example, we have created 4 sip accounts: 1000 till 1004, they all use the password 12345678.

How to make a simple call with Asterisk

Now it's time to set up everything for our first call, we'll need to update two files in Asterisk. Let's open our pjsip.conf file again.

$ vi /pjsip.conf

Now let's add the following parameters to the top of the file and save it. Make sure to also update your global and local IP.

# pjsip.conf
type = transport
protocol = udp
bind =
external_media_address = <my-global-ip>
external_signaling_address = <my-global-ip>
local_net = <my-local-ip>/

Next is the extension.conf file.

$ vi extensions.conf

Let's add the following parameters to the bottom of the file and save it.

# extensions.conf
exten => _1XXX,1,Ringing
exten => _1XXX,n,Wait(2)
exten => _1XXX,n,Dial(PJSIP/${EXTEN},60,tT)
exten => _1XXX,n,Answer()
exten => _1XXX,n,Hangup

The last step is to restart our Asterisk with the following command.

$ systemctl restart asterisk

Your sip accounts are now ready for use and you're able to make your first calls. Now it's time to register two sip accounts and test it out.

Creating a basic Sip Account set up for Asterisk 2021-08-24 08:06:30

There are no comments.


Have questions about our services?

Contact our Sales team to get answers.

Contact Us