Speech:Summer 2013:Asterisk installation instructions

= Asterisk Installation Instructions = This guide explains how to install the Asterisk call menu system on one of the UNHM speech servers.

= Guide = The following is one of the guides used to install Asterisk.


 * Asterisk installation on SUSE
 * http://www.asteriskguru.com/tutorials/asterisk_installation_compilation_suse.html

= Required Packages = Install the following packages using **yast** (note: this requires internet access)
 * ncurses
 * ncurses-devel
 * libxml2 - Maybe optional
 * libxml2-devel
 * SQLite3
 * sqlite3
 * sqlite3-devel
 * OpenSSL
 * libopenssl-devel

= Setup =


 * Unzip Asterisk
 * tar -xf asterisk-11-current.tar.gz
 * Change to Asterisk Directory
 * cd asterisk-11.4.0

= Configure Asterisk =


 * Type the following to configure Asterisk
 * ./configure


 * You will see the following message if it configured correctly

configure: Menuselect build configuration successfully completed .$$$$$$$$$$$$$$$=..                  .$7$7..          .7$$7:.               .$$:.                 ,$7.7            .$7.     7$$$$           .$$77        ..$$.       $$$$$            .$$$7      ..7$   .?.   $$$$$   .?.       7$$$.    $.$.   .$$$7. $$$$7 .7$$$.      .$$$.  .777.   .$$$$$$77$$$77$$$$$7.      $$$,  $$$~      .7$$$$$$$$$$$$$7.       .$$$. .$$7          .7$$$$$$$7:          ?$$$. $$$          ?7$$$$$$$$$$I        .$$$7 $$$      .7$$$$$$$$$$$$$$$$      :$$$.  $$$       $$$$$$7$$$$$$$$$$$$    .$$$.   $$$        $$$   7$$$7  .$$$    .$$$.    $$$$             $$$$7         .$$$.     7$$$7            7$$$$        7$$$        $$$$$                        $$$          $$$$7.                       $$  (TM) $$$$$$$.          .7$$$$$$  $$            $$$$$$$$$$$$7$$$$$$$$$.$$$$$$              $$$$$$$$$$$$$$$$.                 configure: Package configured for: configure: OS type : linux-gnu configure: Host CPU : i686 configure: build-cpu:vendor:os: i686 : pc : linux-gnu : configure: host-cpu:vendor:os: i686 : pc : linux-gnu :

= Build Asterisk =
 * Type the following to build asterisk
 * make


 * You will see the following message if successfull

+- Asterisk Build Complete -+ + Asterisk has successfully been built, and + + can be installed by running:             + +                                          + +                make install               + +---+

= Install Asterisk =


 * Type the following to install Asterisk
 * make install
 * You will see the following message if successfull

+ Asterisk Installation Complete ---+ +                                          + +    YOU MUST READ THE SECURITY DOCUMENT    + +                                          + + Asterisk has successfully been installed. + + If you would like to install the sample  + + configuration files (overwriting any     + + existing config files), run:              + +                                          + +                make samples               + +                                          + +-  or -+ +                                          + + You can go ahead and install the asterisk + + program documentation now or later run:  + +                                          + +               make progdocs               + +                                          + + **Note** This requires that you have      + + doxygen installed on your local system   + +---+

= Install Sample Configuration =


 * Type the follwoing to install the Asterisk sample configuration
 * make samples

= Configure Asterisk =


 * Navigate to the asterisk configuration folder
 * cd /etc/asterisk

Modules

 * Open the modules configuration file for editing
 * nano modules.conf
 * Paste the following into the file

[modules] autoload=no load=pbx_config.so load=chan_sip.so load=chan_iax2.so load=res_rtp_asterisk.so load=app_hangup.so load=app_dial.so load=codec_ulaw.so load=codec_gsm.so


 * This tells asterisk what modules to load
 * Save and quit

Extensions

 * Open the extensions configuration file for editing
 * nano extensions.conf
 * Paste the following into the file

[default] exten => _.,1,Hangup [demo] exten => 2600,1,Dial(IAX2/guest@pbx.digium.com/s@default) same => n,Hangup


 * This file configures asterisk to handle greetings and menus. As well, calls can be routed this way.
 * This configuration tells asterisk to answer calls on extension 2600 and routes the call to the digium test server.
 * Save and quit

Sip

 * Open the sip configuration file for editing
 * nano sip.conf
 * Paste the following into the file

[general] context=default allowguest=no [test_phone_unhm] type=friend host=dynamic secret=learn123 context=demo


 * This configures the sip phone part of asterisk.
 * Here, the phone is called test_phone_unhm and uses the password learn123
 * As well, we can restrict who can dial in by the host configuration. Right now it's dynamic IP.
 * Save and quit

Iax

 * Open the iax configuration file for editing
 * iax.conf
 * Paste the following into the file

[demo] type=peer username=asterisk secret=supersecret host=216.207.245.47


 * This configures the iax phone part of asterisk.
 * We may not need this if we are doing full sip
 * Save and quit

= Ports =

Open Ports

 * Asterisk will need port 5060 to receive incoming calls
 * To open ports, open Yast
 * Select Security and Users on the left hand screen
 * Select Firewall on the right hand screen

Verify Open Ports

 * Use NMAP to see if port 5060 is open
 * nmap -sU -p 5060 127.0.0.1

= Validation =
 * To start asterisk, type the following
 * asterisk
 * Verify it's running
 * ps -a | grep asterisk
 * Log into the console
 * asterisk -r
 * Type the following to exit
 * exit
 * Try and connect to asterisk using sip phone
 * Use the following to connect
 * Name of the phone configured above
 * Password above
 * IP address of the computer
 * You should be able to dial in with extension 2600 and hear the demo from the digium server.

Stop Asterisk

 * Log into the console
 * Type the following into the console
 * core stop now