Unlimited Free IP calling (VoIP) with Asterisk

How to call using IP for FREE — Asterisk VoIP Setup Guide

This is How Terrorist’s & Mafia Communicate Securely

XIT
8 min readOct 24, 2023

Follow XIT on medium & UglyCompany on Telegram for more..

Have you ever wondered how you can talk to your friends or family on the phone without it costing 💸? Well, there’s a magical thing called the internet that can help you do just that! Imagine you have a special telephone that talks through the internet, and it’s called VoIP. Just like sending messages on WhatsApp or talking on the phone with your grandparents on Skype, VoIP helps us talk for free using the internet. Today, we’re going to learn about a super cool wizard called Asterisk, which helps set up this special internet telephone so you can talk to your friends and family all around the world, just like magic!

Step-by-Step Asterisk Installation & Usage

Step 1: Get a Ubuntu Server (You can purchase or get it free using Amazon AWZ / Azure etc). Make sure that all TCP & UDP ports on your Ubuntu Server are opened before begining the installation.

Step 2: Connect your ubuntu server using SSH software like MobaXterm. Follow the steps below:

  1. Download & Install MobaXterm Home Edition (Installer edition).
  2. Open MobaXterm on your computer.
  3. Click on the “Session” tab.
  4. Choose “SSH” from the dropdown menu.
  5. Enter the IP address or hostname of your Ubuntu SSH server in the “Remote host” field.
  6. Specify the SSH port, which is usually 22.
  7. Select your preferred authentication method (password or key).
  8. Enter your Ubuntu username in the “Login” field.
  9. Provide your password or key based on your chosen authentication method.
  10. To save the session for future use, click “Session settings” and name your session under “Saved Sessions.”
  11. Finally, click “OK” to connect to your Ubuntu SSH server.

Step 3: Run the following commands for Asterisk installation:

1) Update your Ubuntu system and upgrade installed packages.

sudo apt update && sudo apt upgrade

2) Install essential tools like wget, build-essential, and subversion. Type “Y” and hit enter to continue.

sudo apt install wget build-essential subversion

3) Navigate to the /usr/src/ directory.

cd /usr/src/

4) Download the Asterisk source code. You can get the latest Asterisk file from : http://downloads.asterisk.org/pub/telephony/asterisk/. It will be as: asterisk-<latestVersion>-current.tar.gz

sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-21-current.tar.gz

5) Extract the downloaded Asterisk source code.

The command might be different accordingly to your downloaded asterisk version. Just replace the version number. In this case we are installing v21 so ‘asterisk-21-current.tar.gz’

sudo tar zxf asterisk-21-current.tar.gz

6) Change the directory to the extracted Asterisk source code folder.

The command might be different accordingly to your downloaded asterisk version. Just replace the version number. In this case we are installing v21 so ‘asterisk-21’

cd asterisk-21.*/

7) Get MP3 source files.

sudo contrib/scripts/get_mp3_source.sh

8) Install necessary prerequisites for Asterisk. For country code put any VALID country code. i.e: 91

sudo contrib/scripts/install_prereq install

9) Configure the Asterisk source code for your system.

sudo ./configure

10) Open a menu to customize Asterisk options. Once the menu is opened, then select “format_mp3” then click Save & Exit button.

sudo make menuselect
select “format_mp3” option from menu & click Save & Exit button

11) Compile Asterisk using two processor cores (adjust this number based on your Ubuntu Server’s CPU).

sudo make -j2

12) Finally, Install Asterisk on your Ubuntu server.

sudo make install

13) Install configuration samples for Asterisk.

sudo make samples

14) Configure Asterisk.

sudo make config

15) Update the shared library cache.

sudo ldconfig

16) Start the Asterisk service.

sudo systemctl start asterisk

17) Open the Asterisk command-line interface.

sudo asterisk -vvvr

18) Once its successfully connected, disconnect is and execute the following command to allow incoming UDP traffic on port 5060 for communication over Asterisk.

sudo ufw allow 5060/udp

19) Now navigate to asterisk folder using following command.

cd /etc/asterisk/

20) Now navigate to asterisk folder & replace the extensions.conf, sip.conf & voicemail.conf files with the below code. (create new files with same names and upload it with the given code.)

Note: If you can’t find the “sip.conf” file in your Asterisk configuration directory (/etc/asterisk/), it may be because newer versions of Asterisk have transitioned to using the PJSIP configuration file, which is typically named “pjsip.conf” for SIP configuration. If you don’t have a “sip.conf” file, you should check for a “pjsip.conf” file in the same directory (/etc/asterisk/). You can use the “pjsip.conf” file to configure SIP settings and endpoints.

sip.conf (edit ‘externip’ parameter with your Ubuntu server’s public IP in below code)

[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
externip=<YOUR-UBUNTU-SERVERs-PUBLIC-IP>

[7001]
type=friend
host=dynamic
secret=xit
context=internal
[7002]
type=friend
host=dynamic
secret=xit
context=internal

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()

voicemail.conf

[main]
7001 => xit
7002 => xit

21) Now, Once everything is done as given in the above steps, follow the below procedure to make and setup clients for making and receiving calls.

Open the Asterisk command-line interface using the below command:

sudo asterisk -vvvr

Load the chain_sip.so module within the Asterisk command-line interface.

module load chan_sip.so

Reload the modules once.

reload

To display the host status enter the below command to get a table view of hosts and the list of processes running.

sip show peers

That’s it! Now, its time to setup our clients. I will list below the various softwares for platforms like Android, iPhone & Windows which I’ve personally used while testing asterisk for my needs.

Android SIP Apps:

  1. Linphone (offers voice and video calling)
  2. Zoiper (support for multiple accounts and various VoIP protocols)
  3. CSipSimple (integrates with the native Android dialer)
  4. Acrobits Softphone (HD audio and video calling)
  5. Grandstream Wave (supports SIP and integrates with Grandstream IP phones)
  6. SessionTalk SIP Softphone (clear call quality)
  7. Bria Mobile (premium SIP and VoIP client, good advanced features for mainly business users)
  8. Groundwire (secure voice and video calls with encryption options)
  9. 3CX VoIP Phone (use with 3CX Phone System, this app offers SIP functionality for businesses)
  10. Media5-fone (supports integration with a range of IP PBX systems)

iPhone SIP Apps:

  1. Zoiper (support for multiple accounts and various VoIP protocols)
  2. Linphone (offers voice and video calling)
  3. 3CX (use with 3CX Phone System, this app offers SIP functionality for businesses)
  4. Acrobits Softphone (HD audio and video calling)
  5. Bria Mobile (premium SIP and VoIP client, good advanced features for mainly business users)
  6. Groundwire (secure voice and video calls with encryption options)
  7. SessionTalk SIP Softphone (clear call quality)
  8. PortSIP Softphone (customizable SIP client for iOS users)
  9. Media5-fone (supports SIP and integrates with a range of IP PBX systems)
  10. Phoner 2nd Phone Number Text (SIP capabilities and a second phone number for various communication needs)

Windows SIP Apps:

  1. MicroSIP (free and open source lightweight and easy-to-use SIP softphone)
  2. 3CX Phone System (integrated SIP functionality for business users)
  3. X-Lite (voice and video calling capabilities)
  4. Bria for Windows (premium SIP softphone with advanced features)
  5. Zoiper (user-friendly interface)
  6. Phoner (free SIP client to make VoIP calls)
  7. Linphone (provides SIP calling with video and chat features)
  8. Jitsi (open-source platform supports video conferencing capabilities)
  9. Ekiga (offers voice and video calls)
  10. PortSIP Softphone (offers customizable SIP capabilities for various communication needs)

For the configuration that we did in this blog, use the below credentials for both the clients (as we added only 2 clients here).

Client 1

Username: 7001
Domain: <YOUR-UBUNTU-SERVERs-PUBLIC-IP>
Password: xit
Transport Type: UDP
Hide Caller ID / Media Encryption: <it’s upto you bro>

Client 2

Username: 7002
Domain: <YOUR-UBUNTU-SERVERs-PUBLIC-IP>
Password: xit
Transport Type: UDP
Hide Caller ID / Media Encryption: <it’s upto you bro>

You can also add more clients using those 3 files which we edited in Step 20. Below is an attached screenshot for how the configuration should look like on windows MicroSIP software as an example.

If you learnt anything from this blog, we’d appreciate your engagement — give it a clap and consider sharing to help spread the knowledge. Also Follow XIT on medium & UglyCompany on Telegram. Your support means a lot to us!

A supporter is worth a thousand followers. 😊

--

--

XIT

SHHH! The voice of none is stronger than the voice of one.