Setting of own telephone station with the help of Asterisk software. In 1999 Digium company created Asterisk, the innovative telephonic solution that made revolution in telecommunication sphere. With this invention a necessity to buy expensive telephone station with poor functional was reduced. Now it’s possible to call the company without connection of numerous additional equipment and phone devices. From this article, you may get more details concerning installation of this station for ameliorating affairs.

On our website you can purchase virtual numbers of most possible countries, connect PBX based on Asterisk and create personal telephonic system for controlling calls with wide opportunities of additional phone services. Read more about our additional features here.

What is Asterisk and how it works?

That is a program presenting alternate telephone station with open initial code. It has all opportunities and range of additional features for calls control. In order to organize phone system with the help of Asterisk you don’t need to connect lines or connect other equipment. You just need to download software from official site of developer to your server and make needed settings. This software is compliant with operating systems as Linux, OpenBSD, Solaris, FreeBSD and some others.

What are the functions of phone station based on Asterisk?

This program is used by companies for setting telephone systems in office. To IP PBX Asterisk you can connect virtual telephone numbers (mobile or landline) with needed quantity of lines, but also toll free 800 numbers for desired region. Accepting calls will be done without additional equipment to convenient destination course.

VoIP telephony permits making redirection to:

  • Your IP-address;
  • Alternate mobile number;
  • SIP (IP-telephone).

Use Asterisk system for calls operations

Make forwarding to such destinations

Freezvon recommends to install free forwarding to IP address, SIP account (we provide it for free when you buy a number). You can learn more about costs for virtual numbers we provide in more than 120 countries.

Asterisk settings allow plugging in any additional functions for call managing:

  • Call forwarding (conditional and unconditional) – possibility to forward call from one subscriber to another;
  • Holding the call – a possibility to send active call for holding in order to dial to another number and then to resume it back;
  • Forwarding of calls – forward calls to any destination;
  • Call history – saved info about incoming or outgoing calls (their status, time etc.) in a special text file;
  • Voicemail – a possibility to create voice messages about missed calls;
  • Call recording – record all company calls;
  • Conference call – capacity to hold conversations for more than two subscribers simultaneously;
  • IVR-menu – interactive menu for informing callers about company.

Asterisk permits having lots of internal numbers for free corporate telecommunication within the company, unlimited SIP-accounts, free virtual DID number etc.

Goods of utilization Asterisk as telephonic system

PBX based on Asterisk is better than traditional phone stations. Its main advantages are:

  • It’s possible to download this software free from official website;
  • There is no necessity in hard equipment for installation, just availability of server;
  • Wide possibilities of work with calls;
  • Ability to connect multichannel numbers to Asterisk;
  • Possibility of free talking between colleagues;
  • Organization of corporate billing;
  • Unlimited SIP accounts.

Asterisk is ignored with other softwares for instance CRM or C1 permitting to organize work of company.

It's possible to check pricing for VoIP telephony services by cliciking on button below.

Costs for VoIP telephone numbers

Instructions on how to set up Asterisk to receive calls.

After registering, you will receive an email with your "SIP-settings". Add the necessary sip trunk settings to perform its registration.

Data that must be entered to configure Asterisk:

  • The name is - SIP_ID of the user.
  • Username - your sip-login from personal account.
  • Password - your password from sip, from the "SIP-settings" section of your personal account.
  • Domain - the IP address of the server or its name from which calls will come.
  • Context = this is the name of the script that tells Asterisk to perform various actions on call processing, depending on where it came from.

* CallerID (number or name of the caller) for incoming calls is transmitted by the provider in the automatic mode in the data packet (VoIP packet). You can always use Asterisk to make calls through our SIP trunk, but this requires separate settings, depending on your system and needs.

Editing sip.conf

register => <sip account>:<yourpassword>@sip.freezvon.com
[freezvon]
host=sip.freezvon.com
insecure=invite,port
type=friend
fromdomain=sip.freezvon.com
disallow=all
allow=alaw
allow=ulaw
dtmfmode=auto
secret=<yourpassword>
username=<sip account>
context=freezvon-in
qualify=yes
directmedia=no
nat=force_rport,comedia

In this case, the freezvon name of the trunk, <sip account> is the sip account number that will come in the letter with the settings, <yourpassword> — the password for the sip account. Save the file and give the command in the sip reload asterisk console to re-read it:

asterisk_cli

Right here in the console, you can check the registration of your peer with the provider with the help of the command:

sip show peers

asterisk_cli

Trunk registration with the command:

sip show registry

asterisk_cli

Trunk configured, in fact, connected the number. But this is not enough to make and receive calls. Need to edit dialplan.

Dial-plan — call routing plan

To make outgoing and receiving incoming calls, you need to edit the file etc/asterisk/extensions.conf and bring it to the following form:

;Outgoing calls
[freezvon-out]

;Call to three-digit extension numbers
exten => _XXX,1,Dial(SIP/${EXTEN})

;Call to an external number in which four or more digits via a trunk
exten => _XXX.,1,Dial(SIP/${EXTEN}@freezvon)

With such a dialplan, when dialing a three-digit number, you call the local number, and when dialing any city number, you can call it without any additional digits. Immediately dial the number.

;Incoming calls from freezvon trunk
[freezvon-in]
;Incoming calls from freezvon trunk are directed to extension 100
exten => _X.,1,Dial(SIP/100)

The context [freezvon-in] describes the behavior of an incoming call. In our case, all incoming calls from the freezvon trunk will be sent to the internal Vulture number 100

Save the dial-plan and reboot the asterisk with a single reload, command, or separately reboot the sip reload and dialplan reload commands:

asterisk_cli

Connecting subscribers and checking internal calls

You need to make some general settings and add users. We will work with the configuration file /etc/asterisk/sip.conf

[general]
allowoverlap=no
udpbindaddr=0.0.0.0
tcpenable=no
transport=udp
srvlookup=yes
allowguest=no

[100]
type=friend
context=freezvon-out
secret=<hardpassword>
host=dynamic
nat=force_rport,comedia
qualify=yes
canreinvite=no
dtmfmode=auto
disallow=all
allow=alaw
allow=ulaw

Asterisk security on CentOS with fail2ban

If your asterisk has an external ip address, or a port is sent to it from an external ip, then you need to protect against brute force and other multiple connections. We organize protection using the well-known and popular fail2bantool. It's easy to do, fail2ban upports astersik out of the box. Simply install it and activate some settings.

Install fail2ban on the server with asterisk:

#yum install -y fail2ban

We include recording in the event log file of type security. To do this, open the file /etc/asterisk/logger.conf and uncomment the line:

security => security

Re-read log storage settings:

# asterisk -x "logger reload"

A new security file has appeared in the / var / log / asterisk folder. We will transfer his records to fail2ban for analysis. Open the /etc/fail2ban/jail.conf file, look for the [asterisk] section there and change the path to the log file and add the jail activation line:

logpath = /var/log/asterisk/security
enabled = true

Run fail2ban and add to autorun:

# systemctl start fail2ban
# systemctl enable fail2ban

In order for fail2ban to work, iptables must be running and configured. I also note that by default, fail2ban in centos 7 uses firewalld commands. If you have disabled it and are using bare iptables, then you need to delete the /etc/fail2ban/jail.d/00-firewalld.conf file and restart fail2ban. If this is not done, it will not work.

This completes the detailed and feature-rich asterisk configuration.

For more details, it’s possible to contact our technical department via Skype, email, helping live chat or by telephone number. They will help you to install special service as virtual PBX most requested service on our site.