VoIP with Asterisk Server

Let's introduce you with Asterisk server. 😊

What is Asterisk Server?

Asterisk is an open source framework for building communications applications. Asterisk turns an ordinary computer into a communications server. Asterisk powers IP PBX systems, VoIP gateways, conference servers and other custom solutions. It is used by small businesses, large businesses, call centers, carriers and government agencies, worldwide. Asterisk is free and open source. Asterisk is sponsored by Digium. For more information...
Let's see how to do setup for VoIP Communication using Asterisk server. Here, we see tel-communication only for IP based phones.

Let's take simple demo with Asterisk 👍

Follow list of the steps.
  1. Install virtual box. (download)
  2. Install Ubuntu in virtual box. (download)
  3. Enable virtual technology (follow this steps).
  4. Install Ubuntu in virtual machine.(How to install in virtual box?)
  5. Install Asterisk. 
To install Asterisk  server in Ubuntu following commands need to be executed using terminal.
How to install asterisk in Ubuntu?
  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. press 'y' to continue
  4. sudo apt-get install asterisk
  5. press 'y' to continue
  6. sudo asterisk -r
  7. sip show peers
We will be editing the following files:
  • sip.conf
  • extensions.conf
  • voicemail.conf
These files are located in:
  • /etc/asterisk
Making a backup of sip.conf and move to original sip.conf
sudo mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.orig

create and configure sip.conf
sudo vi /etc/asterisk/sip.conf

[general]
context=internal
allowguest=no
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=no
disallow=all
allow=ulaw
alwaysauthreject=yes
canreinvite=no
nat=yes
session-timers=refuse
localnet=192.168.1.0/255.255.255.0

[7001]
type=friend
host=dynamic
secret=123
context=internal

[7002]
type=friend
host=dynamic
secret=456
context=internal


You can save this file by first pressing ESC then letting go.
Followed by holding Shift and then letting go again.
Now type wq! followed by pressing enter.
File is saved now.

do backup for extensions.conf
sudo mv /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf.orig

Creating a new extensions.conf and configuring it
sudo vi /etc/asterisk/extensions.conf

[internal]
exten => 7001,1,Answer()
exten => 7001,2,Dial(SIP/7001,60)
exten => 7001,3,Playback(vm-nobodyavail)
exten => 7001,4,VoiceMail(7001@main)
exten => 7001,5,Hangup()

exten => 7002,1,Answer()
exten => 7002,2,Dial(SIP/7002,60)
exten => 7002,3,Playback(vm-nobodyavail)
exten => 7002,4,VoiceMail(7002@main)
exten => 7002,5,Hangup()

exten => 8001,1,VoicemailMain(7001@main)
exten => 8001,2,Hangup()

exten => 8002,1,VoicemailMain(7002@main)
exten => 8002,2,Hangup()


do backup for voicemail.conf
sudo mv /etc/asterisk/voicemail.conf /etc/asterisk/voicemail.conf.orig

create and config a new voicemail.conf 
sudo vi /etc/asterisk/voicemail.conf

[main]
7001 => 123
7002 => 456

Reloading Asterisk to apply the configuration, You can restart asterisk by any of the three following ways:
  • sudo asterisk -rx reload
  • sudo asterisk -r
  • sudo /etc/init.d/asterisk restart
for exit,
  • exit
Hey, It's all done about basic configuration. let's take next step config towards SIP Clients.
  • Install x-lite application in PC/Laptop.
  • Install linphone application in your android device.
- Config both client with SIP.conf files credentials and try to make call each other. that's it!
- It's all done about asterisk configuration with SIP clients.
- Now we able to make call each other via asterisk server using SIP protocol with two different SIP clients. 
- As you seen early, We can make n number of extensions and config it to enable VoIP.

Comments

  1. It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read. Best voip for business Services Provider

    ReplyDelete

Post a Comment

Popular posts from this blog

Building a Spring Boot MVC Application with MariaDB and Native JDBC

Exploring the New Features of Spring Framework 6.0.12 with Examples