Telephony Systems with Asterisk

Set proxy

Configuring Proxy Server Access

To enable all yum operations to use a proxy server, specify the proxy server details in /etc/yum.conf. The proxy setting must specify the proxy server as a complete URL, including the TCP port number. If your proxy server requires a username and password, specify these by adding proxy_username and proxy_password settings.

The settings below enable yum to use the proxy server mycache.mydomain.com, connecting to port 3128, with the username yum-user and the password qwerty.

	# The proxy server - proxy server:port number
		proxy=http://192.168.213.222:3128

 

Change ip-address Permanently

Under the /etc/sysconfig/network-scripts directory, you’ll see file for every network interface on your system. For example, if your interface is “eth0″, you’ll see ifcfg-eth0 file under this directory.

Modify the ifcfg-eth0 file and change the IPADDR field accordingly as shown below to change the ip-address.

 

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"

BOOTPROTO=none

NM_CONTROLLED="yes"

ONBOOT=yes

TYPE="Ethernet"

UUID="11111-2222-3333-4444"

IPADDR=192.168.1.2

PREFIX=24

GATEWAY=192.168.1.1

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System em1"

HWADDR=DD:BB:DD:AA:11:55

 

Restart the Network

Finally, restart the network service, for the system to pick-up the changes.

# service network restart

 

 

Configuration for CentOS7

Following software are configured in CentOS 7

            Asterisk 11.4.0

            DAHDI 2.7.0 (Digium Asterisk Hardware Device Interface)

            libpri 1.4.14

How to Install Asterisk on CentOS 6.4

1.      Log in to the system as super user

# su –
 

2.      Before begin, make sure the OS is upto date. Update and reboot if necessary

# yum update -y

 

3.       Disable SELinux by changing “enforcing” to “disabled” in /etc/selinux/config

open /etc/selinux/config

Find and set “selinux=disabled”
 

4.       Reboot the system

# reboot

 

5.      Resolve basic dependencies

Checkdependencies

# rpm –qa |grep –i make

 

6.       install dependencies

# yum install –y make
# yum install –y wget
# yum install –y openssl-devel
# yum install –y ncurses-devel
# yum install –y newt-devel
# yum install –y libxml2-devel
# yum install –y kernel-devel
# yum install –y gccgcc-c++
# yum install –y sqlite-devel
# yum install –y libuuid-devel
 
# check this
# rpm –ivhmake.rpm

 

7.       Download the asterisk tar files and store it in /usr/scr/asterisk

Following Links

 
http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
 
 

8.       Install asterisk

a.       Extract the tar files

        # tar xzvf asterisk*
        # tar xzvf libpri
        # tar xzvf dahdi

 

b.      install dahdi

Change directory

# cd /usr/src/dahdi-linux-complete*

 

Run following commands

        # make
        # make install
        # make config

 

c.       install Libpri

Change directory

# cd /usr/src/libpri*

run following commands

        # make
        # make install

 

d.      Install asterisk

change directory

          # cd /usr/src/asterisk*

for 64 bit computer

#./configure --libdir=/usr/lib64

#  make menuselect

 

Once menuselect is configured a menu will open in terminal exit the menu and proceed to next command Exit menu

 

# make

# make install

 

If the Installation is successful proceed run the following commands

#  make samples

#  make config

 

If there is any errors check if you have install dependencies or not after taking care or errors clean the installation directory using the command

 

9.       Start the services

# service dahdi start

# service asterisk start

 

Go to the aseterisk CLI use the command

# asterisk –rvvv

# installing asterisk is complete

Setting up PBX

Step 1

Creating SIP Accounts

Backup config file

# cd /etc/aseterisk

# mv sip.conf sip.conf.sample

 

Create a newfile using vi and add the following lines

# vi sip.conf

 

Add following lines

[demo-user1]

type=friend

host=dynamic

screet=myscret123

context=users

deny=0.0.0.0/0

permit=192.168.x.x/255.255.x.x

 

[demo-user2]

type=friend

host=dynamic

screet=myscret123

context=users

deny=0.0.0.0/0

permit=192.168.x.x/255.255.x.x

 

Reload sip file

# asterisk -rvvv

# sip reload

 

Configure extentions

# cd /etc/asterisk

# mv extensions.conf extentions.conf.sample

 

Create a new extensions.conf file using vi

# vi extentions.conf

 

Add following lines

[users]

exten=>4001,1,Dial(SIP/demo-user1,20)

exten=>4002,1,Dial(SIP/demo-user2,20)

 

Reload dialplan

# asterisk-rvvv

# dialplan reload

 

Step 03

Install soft phones

# tar xzvf zoiper

 

 

Run the executable file

#./zoiper…..

 

Then use a client software (such as Zoiper or X-Lite)

 

IMPORTANT:

If the clients not registering with the Asterisk server need to turn off firewall in CentOS

Disable Firewalld
To disable firewalld, run the following command as root:
# systemctl disable firewalld

Stop Firewalld
To stop firewalld, run the following command as root:
# systemctl stop firewalld

Check the Status of Firewalld
To check the status of firewalld, run the following command as root:
# systemctl status firewalld

 

 

Create user accounts at zoiper phone

User name :demo-user1

Password :xxxxxx

IP xxxxx

 

Linux Basic Commands used for installation

YUM (Yellowdog Updater Modified)

an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems

make
make utility is to determine automatically which pieces of a large program need to be re-complied

tar

You need to use the tar command to extract files from an archive or to create an archive (also known as tarball). A tarball or an archive is nothing but a single file that contains various individual files. It also includes information which allows your to restore files to their original form by one or more extraction programs such as tar command.

Where,

-x : Extract a tar ball.

-v : Verbose output or show progress while extracting files.

-f : Specify an archive or a tarball filename.

-j : Decompress and extract the contents of the compressed archive created by bzip2 program (tar.bz2 extension).

-z : Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).

 

 ./configure
The above command makes the shell run the script named ' configure ' which exists in the current directory