Howto:Set up a FGCom server: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Moved from FGCOM)
 
m (Formel URL didn't work anymore.)
 
(41 intermediate revisions by 9 users not shown)
Line 1: Line 1:
For running a [[FGCom]] server you need Asterisk and depending on the amount of users much bandwith and CPU power. Because of puting pilots and [[Air Traffic Control]]lers in a VoIP conference the server-admin has to assure that there is enough network and CPU power to avoid drop-outs of the voice stream.
This page is for installing a '''FGCom Server'''. If you want to have voice communications within [[FlightGear]], you are probably wanting to install the [[FGCom|client]].  


==Pre-requirements==
This document is to assist in setting up hot spares as potential failover for the new server and for replacing that server if/when that becomes necessary. It is not expected that this will be a widely used document, nonetheless, the information contained is no less valuable for that.
Install Asterisk on top of your favorite distribution. Please refer to installation manuals (e.g. [http://www.asteriskguru.com/ Asterisk-Guru]) that you can find on the net. You do not need H.323 or SIP because the fgcom client uses IAX2 as VoIP signaling protocol. Only if you think about connecting external VoIP applications to FGCom you should consider to activate H.323 or SIP (but this is not the scope of this small howto).


Notice: You need to install the zaptel driver modules - even if you won't use any hardware for telecom interfacing. You need the ztdummy kernel module for the asterisk conference application MeetMe() because it simulates a hardware clock needed by this application. Further development of FGCOM might use app_conference which don't needs any timing device.
== Install Asterisk ==
You need an instance of Asterisk on the server, you can either install Asterisk via a package manager (if you're using CentOS/RHEL) or via the source code if you're on a different distro. For easiness (and because I can) I chose to do it via the package manager.
We used CentOS (this works for RedHat too) and the instructions for installing it on CentOS/RHEL are as follows:


For now we want to use /etc/asterisk as the base configuration directory.
=== CentOS/RHEL ===


==Setting up the radio frequencies==
==== Setting up the Package Manager ====
The radio frequencies are "simple" Conferences and realized due to the Asterisk application MeetMe().


===Part 1: General configuration===
In the ''''/etc/yum.repos.d'''' folder create the following files:
First you have to set up the general configuration of the system. Put the following at the top of your "extensions.conf" file:


  [general]
centos-asterisk.repo:
  static=yes
[asterisk-tested]
  writeprotect=yes
name=CentOS-$releasever - Asterisk - Tested
  ;
baseurl=http://packages.asterisk.org/centos/$releasever/tested/$basearch/
  [globals]
enabled=0
  ;
gpgcheck=0
  [macro-com]
#gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium
  exten => s,1,Answer()
  exten => s,n,MeetMe(${MACRO_EXTEN},qd)
[asterisk-current]  
  exten => s,n,Hangup()
name=CentOS-$releasever - Asterisk - Current
  ;
baseurl=http://packages.asterisk.org/centos/$releasever/current/$basearch/
  [macro-echo]
enabled=1
  exten => s,1,Answer()
gpgcheck=0
  exten => s,n,Echo()
#gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium
  exten => s,n,Hangup()
  ;
  [guest]
  ; ATC-Help
  exten => 01-ZZZZ-911.000,1,Macro(com)
  exten => 012525252591100,1,Dial(Local/01-ZZZZ-911.000)
  exten => 01-ZZZZ-910.000,1,Macro(echo)
  exten => 012525252591000,1,Dial(Local/01-ZZZZ-910.000)
  ;
  [default]
  include => guest
  ;
  ; Code:
  ; 01 - FlightGear
  ; 02 - Microsoft Flight-Simulator
  ; 03 - ...
  ;
  ; Air2Air
  exten => 01-ZZZZ-123.450,1,Macro(com)
  exten => 012525252512345,1,Dial(Local/01-ZZZZ-123.450)
  exten => 01-ZZZZ-122.750,1,Macro(com)
  exten => 012525252512275,1,Dial(Local/01-ZZZZ-122.750)


===Part 2: Adding your favorite (all?) frequencies===
centos-digium.repo:
For this you have simply to create an extension for every touple of airport/frequency in extensions.conf. The following is an example for [[Berlin Tempelhof Airport]] (EDDI). The information comes from the file "apt.dat.gz" of your FlightGear installation.
[digium-tested]
name=CentOS-$releasever - Digium - Tested
baseurl=http://packages.digium.com/centos/$releasever/tested/$basearch/
enabled=0
gpgcheck=0
#gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium
[digium-current]
name=CentOS-$releasever - Digium - Current
baseurl=http://packages.digium.com/centos/$releasever/current/$basearch/
enabled=1
gpgcheck=0
#gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium


  ; EDDI ATIS 126.020 - Berlin Tempelhof
==== Installing the Packages ====
   exten => 01-EDDI-126.020,1,Macro(com)
 
   exten => 010403030812602,1,Dial(Local/01-EDDI-126.020)
[root@localhost~]# yum install asterisk16 asterisk16-configs asterisk16-voicemail dahdi-linux dahdi-tools libpri
  ;
 
   ; EDDI BERLIN DEP 120.620 - Berlin Tempelhof
You will then see something like this:
  exten => 01-EDDI-120.620,1,Macro(com)
=========================================================================================
   exten => 010403030812062,1,Dial(Local/01-EDDI-120.620)
   Package                            Arch      Version                              Size
  ;
=========================================================================================
  ; EDDI BERLIN DIRECTOR 121.120 - Berlin Tempelhof
Installing:
   exten => 01-EDDI-121.120,1,Macro(com)
   asterisk16                        i386      1.6.0.15-1_centos5                  4.0 k
   exten => 010403030812112,1,Dial(Local/01-EDDI-121.120)
Installing for dependencies:
  ;
   asterisk-sounds-core-en-gsm        noarch    1.4.15-1_centos5                    1.7 M
  ; EDDI BERLIN ARR 126.420 - Berlin Tempelhof
   asterisk16-core                    i386      1.6.0.15-1_centos5                  11 M
   exten => 01-EDDI-126.420,1,Macro(com)
  asterisk16-dahdi                  i386      1.6.0.15-1_centos5                  837 k
   exten => 010403030812642,1,Dial(Local/01-EDDI-126.420)
   asterisk16-doc                    i386      1.6.0.15-1_centos5                  10 k
  ;
   asterisk16-voicemail              i386      1.6.0.15-1_centos5                  264 k
  ; EDDI GND 121.950 - Berlin Tempelhof
   dahdi-firmware                    noarch    2.0.1-1_centos5                    1.9 k
   exten => 01-EDDI-121.950,1,Macro(com)
   dahdi-firmware-oct6114-064        noarch    1.05.01-1_centos5                  165 k
  exten => 010403030812195,1,Dial(Local/01-EDDI-121.950)
   dahdi-firmware-oct6114-128        noarch    1.05.01-1_centos5                  166 k
  ;
   dahdi-firmware-tc400m              noarch    MR6.12-1_centos5                    1.7 M
  ; EDDI TWR 119.570 - Berlin Tempelhof
   dahdi-linux                        i386      2.2.0.2-1_centos5                  3.3 k
   exten => 01-EDDI-119.570,1,Macro(com)
   kernel                            i686      2.6.18-164.el5                      16 M
   exten => 010403030811957,1,Dial(Local/01-EDDI-119.570)
   kmod-dahdi-linux                  i686      2.2.0.2-1_centos5.2.6.18_164.el5    3.4 M
   ;
   kmod-dahdi-linux-fwload-vpmadt032  i686      2.2.0.2-1_centos5.2.6.18_164.el5    124 k
  ; EDDI BERLIN DIRECTOR 136.100 - Berlin Tempelhof
   libpri                            i386      1.4.10.1-1_centos5                  103 k
   exten => 01-EDDI-136.100,1,Macro(com)
   libss7                            i386      1.0.2-1_centos5                      63 k
   exten => 010403030813610,1,Dial(Local/01-EDDI-136.100)
   yum-kmod                          noarch    1.1.16-13.el5.centos                17 k
  ;
  ; EDDI TWR 118.100 - Berlin Tempelhof
Transaction Summary
   exten => 01-EDDI-118.100,1,Macro(com)
========================================================================================
   exten => 010403030811810,1,Dial(Local/01-EDDI-118.100)
Install    17 Package(s)       
  ;
Update      0 Package(s)        
  ; EDDI BERLIN DEP 119.500 - Berlin Tempelhof
Remove      0 Package(s)
   exten => 01-EDDI-119.500,1,Macro(com)
  exten => 010403030811950,1,Dial(Local/01-EDDI-119.500)
Total download size: 35 M
  ;
Is this ok [y/N]:
  ; EDDI BERLIN ARR 119.620 - Berlin Tempelhof
  exten => 01-EDDI-119.620,1,Macro(com)
  exten => 010403030811962,1,Dial(Local/01-EDDI-119.620)


What does the above mean? There are two lines (three with the comment) for each frequency: The first one sets up an extension named "01-EDDI-119.500". Yes, for VoIP you can use textual extensions but be careful if you want to setup your Asterisk-Server with POTS (=Plain old telephone service). Therefor you need the second line which is the same as above but without dashes and the letters in the decimal representation of the ASCII Code. The second line does only a "rewrite" of the numerical representation to the textual one.
Press {{Key press|Y}} and then {{Key press|Enter}}


For setting up all airports you can write your own simple script. But this maybe also not needed in further versions of FGCOM.
Downloading Packages:
(1/17): dahdi-firmware-2.0.1-1_centos5.noarch.rpm                                    | 1.9 kB    00:00
(2/17): dahdi-linux-2.2.0.2-1_centos5.i386.rpm                                        | 3.3 kB    00:00
(3/17): asterisk16-1.6.0.15-1_centos5.i386.rpm                                        | 4.0 kB    00:00
(4/17): asterisk16-doc-1.6.0.15-1_centos5.i386.rpm                                    |  10 kB    00:00
(5/17): yum-kmod-1.1.16-13.el5.centos.noarch.rpm                                      |  17 kB    00:00
(6/17): libss7-1.0.2-1_centos5.i386.rpm                                              |  63 kB    00:00
(7/17): libpri-1.4.10.1-1_centos5.i386.rpm                                            | 103 kB    00:00
(8/17): kmod-dahdi-linux-fwload-vpmadt032-2.2.0.2-1_centos5.2.6.18_164.el5.i686.rpm  | 124 kB    00:00
(9/17): dahdi-firmware-oct6114-064-1.05.01-1_centos5.noarch.rpm                      | 165 kB    00:00
(10/17): dahdi-firmware-oct6114-128-1.05.01-1_centos5.noarch.rpm                      | 166 kB    00:00
(11/17): asterisk16-voicemail-1.6.0.15-1_centos5.i386.rpm                            | 264 kB    00:01
(12/17): asterisk16-dahdi-1.6.0.15-1_centos5.i386.rpm                                | 837 kB    00:04
(13/17): dahdi-firmware-tc400m-MR6.12-1_centos5.noarch.rpm                            | 1.7 MB    00:08
(14/17): asterisk-sounds-core-en-gsm-1.4.15-1_centos5.noarch.rpm                      | 1.7 MB    00:08
(15/17): kmod-dahdi-linux-2.2.0.2-1_centos5.2.6.18_164.el5.i686.rpm                  | 3.4 MB    00:17
(16/17): asterisk16-core-1.6.0.15-1_centos5.i386.rpm                                  |  11 MB    00:57
(17/17): kernel-2.6.18-164.el5.i686.rpm                                              |  16 MB    00:23
-------------------------------------------------------------------------------------
Total                                                                        283 kB/s |  35 MB
      02:06   
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) " from
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]:


After editing the extensions.conf file you have to reload the extensions file (e.g. "asterisk -rx extensions reload").
Press {{Key press|Y}} and then {{Key press|Enter}} again


You can add further nice goodies to your extensions.conf: MorseCode() for morsing the code of the VOR (MorseCode() will only work in Asterisk >= 1.4), Recording of metar data and playing this recording back when using the frequency of the metar information, ...
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing    : kernel                                          [ 1/17]
  Installing    : asterisk16-core                                [ 2/17]
  Installing    : kmod-dahdi-linux                                [ 3/17]
  Installing    : asterisk16-doc                                  [ 4/17]
  Installing    : kmod-dahdi-linux-fwload-vpmadt032              [ 5/17]
  Installing    : asterisk-sounds-core-en-gsm                    [ 6/17]
  Installing    : dahdi-firmware-oct6114-064                      [ 7/17]
  Installing    : yum-kmod                                        [ 8/17]
  Installing    : dahdi-firmware-tc400m                          [ 9/17]
  Installing    : dahdi-firmware-oct6114-128                      [10/17]
  Installing    : asterisk16-voicemail                            [11/17]
  Installing    : libss7                                          [12/17]
  Installing    : libpri                                          [13/17]
  Installing    : dahdi-firmware                                  [14/17]
  Installing    : dahdi-linux                                    [15/17]
  Installing    : asterisk16-dahdi                                [16/17]
  Installing    : asterisk16                                      [17/17]
   
   
==Setting up user accounts==
Installed: asterisk16.i386 0:1.6.0.15-1_centos5
The user accounts are located in the file iax.conf (and perhaps also in sip.conf, but this is not necessary). The top of the file should look like this:
Dependency Installed: asterisk16-core.i386 0:1.6.0.15-1_centos5 ...
Complete!
[root@localhost yum.repos.d]#
 
When you are met with the screen above with the words ''''Complete!'''' on it then you are ready to move on to Part 2: Configuration Files
 
=== Debian/Ubuntu ===
This about covers it:
 
apt-get install asterisk
 
=== Install from Source ===
==== Downloading the Source ====
Downloading necessary packages: LIBPRI, DAHDI, AND Asterisk
 
cd /usr/src
wget http://www.asterisk.org/downloads/asterisk/releases/asterisk-1.6.2-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.11.3.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.3.0.1+2.3.0.tar.gz
 
==== Installing Libpri ====
 
tar -xvzf libpri-1.4.11.3.tar.gz
cd libpri-1.4.11.3
make
make install
 
==== Installing DAHDI ====
 
cd /usr/src
tar -xvzf dahdi-linux-complete-2.3.0.1+2.3.0.tar.gz
cd dahdi-linux-complete-2.3.0.1+2.3.0
make
make install
make config
 
==== Installing Asterisk ====
 
cd /usr/src
tar -xvzf asterisk-1.6.2-current.tar.gz
cd asterisk-1.6.2.11/
make clean
./configure
make
make install
make samples
make config
 
== Configuration Files ==
 
Regardless of what OS you are running Asterisk on and regardless of what method of installation you used to install it, there are 2 main configuration files that we need to work with and one file we need to generate and include:


  [general]
=== extensions.conf ===
  bandwith=low
If you are using an existing Asterisk server then add the following lines to the [default] context:
  disallow=lpc10
#include "fgcom.inc"
  jitterbuffer=yes
include => fgcom
  forcejitterbuffer=no
Or if you are using a new Asterisk install remove everything from ''''extensions.conf'''' and put in:
  tos=lowdelay
[general]
  autokill=yes
static=yes
  disallow=all
writeprotect=yes
  allow=alaw
;
  allow=gsm
[default]
  allow=ilbc
#include "fgcom.inc"
  allow=g726
include => fgcom
  allow=ulaw
  language=en
  maxauthreq=10
  context=guest
  ;
  [guest]
  type=user
  username=guest
  context=guest
  qualify=yes
  callerid=Guest IAX User
  host=dynamic
  ;


You may want to disallow more codecs or want to allow additional codecs (such as speex). But have in mind that the internal mixing of the conferences are done in "ulaw". But "ulaw" needs about 80 kBit/s because it does no compression. So you have to think about what's better for you: less bandwidth (per user) and more CPU usage or more bandwidth (per user) and less CPU usage... you should also consider the "sound" of some codecs may not have the 'real radio sound'.
=== iax.conf ===
[general]
bandwidth=low
disallow=lpc10
jitterbuffer=yes
forcejitterbuffer=no
tos=lowdelay
autokill=30000
codecpriority=host
disallow=all
allow=gsm
allow=ilbc
allow=g726
language=en
maxauthreq=30
context=fgcom
minregexpire=30
maxregexpire=10800
maxexpirey=10800
defaultexpirey=10800
;
[guest]
type=user
username=guest
secret=guest
context=fgcom
qualify=yes
callerid=Guest IAX User
host=dynamic
requirecalltoken=no
  ;


For each user you have to add a bunch of lines to your iax.conf file:
=== fgcom.inc ===
This is a special file generated using a script. It should be placed in the Asterisk config directory (/etc/asterisk/ normally).


  [<USERNAME>]
You need the gen_phonebook.pl script (https://sourceforge.net/p/flightgear/fgcom/ci/master/tree/server/gen_phonebook.pl?format=raw) and nav.dat.gz and apt.dat.gz from the git repository.
  type=user
  username=<USERNAME>
  secret=<PASSWORD>
  context=default
  host=dynamic
  nat=yes
  notransfer=yes


You just have to fill in the <USERNAME> and <PASSWORD>. After each change you have to reload the configuration (e.g. "asterisk -rx reload chan_iax2.so"). Perhaps you want to write scripts for automatic configuration and so on. But be warned: Further versions of fgcom may use the multiplayer servers for getting usernames and position data and you have to change your scripts.
Put them all in the same folder and run the script.


==Problems?==
[[Category:Multiplayer]]
If you have problems you can contact me via email at "dcoredump AT gmail.com".
[[Category:FGCom]]

Latest revision as of 11:08, 27 July 2015

This page is for installing a FGCom Server. If you want to have voice communications within FlightGear, you are probably wanting to install the client.

This document is to assist in setting up hot spares as potential failover for the new server and for replacing that server if/when that becomes necessary. It is not expected that this will be a widely used document, nonetheless, the information contained is no less valuable for that.

Install Asterisk

You need an instance of Asterisk on the server, you can either install Asterisk via a package manager (if you're using CentOS/RHEL) or via the source code if you're on a different distro. For easiness (and because I can) I chose to do it via the package manager. We used CentOS (this works for RedHat too) and the instructions for installing it on CentOS/RHEL are as follows:

CentOS/RHEL

Setting up the Package Manager

In the '/etc/yum.repos.d' folder create the following files:

centos-asterisk.repo:

[asterisk-tested]
name=CentOS-$releasever - Asterisk - Tested
baseurl=http://packages.asterisk.org/centos/$releasever/tested/$basearch/
enabled=0
gpgcheck=0
#gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium

[asterisk-current] 
name=CentOS-$releasever - Asterisk - Current
baseurl=http://packages.asterisk.org/centos/$releasever/current/$basearch/
enabled=1
gpgcheck=0
#gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium

centos-digium.repo:

[digium-tested]
name=CentOS-$releasever - Digium - Tested
baseurl=http://packages.digium.com/centos/$releasever/tested/$basearch/
enabled=0
gpgcheck=0
#gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium

[digium-current]
name=CentOS-$releasever - Digium - Current
baseurl=http://packages.digium.com/centos/$releasever/current/$basearch/
enabled=1
gpgcheck=0
#gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium

Installing the Packages

[root@localhost~]# yum install asterisk16 asterisk16-configs asterisk16-voicemail dahdi-linux dahdi-tools libpri

You will then see something like this:

=========================================================================================
 Package                            Arch       Version                              Size
=========================================================================================
Installing:
 asterisk16                         i386       1.6.0.15-1_centos5                  4.0 k
Installing for dependencies:
 asterisk-sounds-core-en-gsm        noarch     1.4.15-1_centos5                    1.7 M
 asterisk16-core                    i386       1.6.0.15-1_centos5                   11 M
 asterisk16-dahdi                   i386       1.6.0.15-1_centos5                  837 k
 asterisk16-doc                     i386       1.6.0.15-1_centos5                   10 k
 asterisk16-voicemail               i386       1.6.0.15-1_centos5                  264 k
 dahdi-firmware                     noarch     2.0.1-1_centos5                     1.9 k
 dahdi-firmware-oct6114-064         noarch     1.05.01-1_centos5                   165 k
 dahdi-firmware-oct6114-128         noarch     1.05.01-1_centos5                   166 k
 dahdi-firmware-tc400m              noarch     MR6.12-1_centos5                    1.7 M
 dahdi-linux                        i386       2.2.0.2-1_centos5                   3.3 k
 kernel                             i686       2.6.18-164.el5                       16 M
 kmod-dahdi-linux                   i686       2.2.0.2-1_centos5.2.6.18_164.el5    3.4 M
 kmod-dahdi-linux-fwload-vpmadt032  i686       2.2.0.2-1_centos5.2.6.18_164.el5    124 k
 libpri                             i386       1.4.10.1-1_centos5                  103 k
 libss7                             i386       1.0.2-1_centos5                      63 k
 yum-kmod                           noarch     1.1.16-13.el5.centos                 17 k

Transaction Summary
========================================================================================
Install     17 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s) 

Total download size: 35 M
Is this ok [y/N]:

Press Y and then Enter

Downloading Packages:
(1/17): dahdi-firmware-2.0.1-1_centos5.noarch.rpm                                     | 1.9 kB     00:00
(2/17): dahdi-linux-2.2.0.2-1_centos5.i386.rpm                                        | 3.3 kB     00:00
(3/17): asterisk16-1.6.0.15-1_centos5.i386.rpm                                        | 4.0 kB     00:00
(4/17): asterisk16-doc-1.6.0.15-1_centos5.i386.rpm                                    |  10 kB     00:00
(5/17): yum-kmod-1.1.16-13.el5.centos.noarch.rpm                                      |  17 kB     00:00
(6/17): libss7-1.0.2-1_centos5.i386.rpm                                               |  63 kB     00:00
(7/17): libpri-1.4.10.1-1_centos5.i386.rpm                                            | 103 kB     00:00
(8/17): kmod-dahdi-linux-fwload-vpmadt032-2.2.0.2-1_centos5.2.6.18_164.el5.i686.rpm   | 124 kB     00:00
(9/17): dahdi-firmware-oct6114-064-1.05.01-1_centos5.noarch.rpm                       | 165 kB     00:00
(10/17): dahdi-firmware-oct6114-128-1.05.01-1_centos5.noarch.rpm                      | 166 kB     00:00
(11/17): asterisk16-voicemail-1.6.0.15-1_centos5.i386.rpm                             | 264 kB     00:01
(12/17): asterisk16-dahdi-1.6.0.15-1_centos5.i386.rpm                                 | 837 kB     00:04
(13/17): dahdi-firmware-tc400m-MR6.12-1_centos5.noarch.rpm                            | 1.7 MB     00:08
(14/17): asterisk-sounds-core-en-gsm-1.4.15-1_centos5.noarch.rpm                      | 1.7 MB     00:08
(15/17): kmod-dahdi-linux-2.2.0.2-1_centos5.2.6.18_164.el5.i686.rpm                   | 3.4 MB     00:17
(16/17): asterisk16-core-1.6.0.15-1_centos5.i386.rpm                                  |  11 MB     00:57
(17/17): kernel-2.6.18-164.el5.i686.rpm                                               |  16 MB     00:23
-------------------------------------------------------------------------------------
Total                                                                        283 kB/s |  35 MB
     02:06     
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) " from 
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]:

Press Y and then Enter again

Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : kernel                                          [ 1/17] 
  Installing     : asterisk16-core                                 [ 2/17] 
  Installing     : kmod-dahdi-linux                                [ 3/17] 
  Installing     : asterisk16-doc                                  [ 4/17] 
  Installing     : kmod-dahdi-linux-fwload-vpmadt032               [ 5/17] 
  Installing     : asterisk-sounds-core-en-gsm                     [ 6/17] 
  Installing     : dahdi-firmware-oct6114-064                      [ 7/17] 
  Installing     : yum-kmod                                        [ 8/17] 
  Installing     : dahdi-firmware-tc400m                           [ 9/17] 
  Installing     : dahdi-firmware-oct6114-128                      [10/17] 
  Installing     : asterisk16-voicemail                            [11/17] 
  Installing     : libss7                                          [12/17] 
  Installing     : libpri                                          [13/17] 
  Installing     : dahdi-firmware                                  [14/17] 
  Installing     : dahdi-linux                                     [15/17] 
  Installing     : asterisk16-dahdi                                [16/17] 
  Installing     : asterisk16                                      [17/17] 

Installed: asterisk16.i386 0:1.6.0.15-1_centos5
Dependency Installed: asterisk16-core.i386 0:1.6.0.15-1_centos5 ...
Complete!
[root@localhost yum.repos.d]# 

When you are met with the screen above with the words 'Complete!' on it then you are ready to move on to Part 2: Configuration Files

Debian/Ubuntu

This about covers it:

apt-get install asterisk

Install from Source

Downloading the Source

Downloading necessary packages: LIBPRI, DAHDI, AND Asterisk

cd /usr/src
wget http://www.asterisk.org/downloads/asterisk/releases/asterisk-1.6.2-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.11.3.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.3.0.1+2.3.0.tar.gz

Installing Libpri

tar -xvzf libpri-1.4.11.3.tar.gz
cd libpri-1.4.11.3
make
make install

Installing DAHDI

cd /usr/src
tar -xvzf dahdi-linux-complete-2.3.0.1+2.3.0.tar.gz
cd dahdi-linux-complete-2.3.0.1+2.3.0
make
make install
make config

Installing Asterisk

cd /usr/src
tar -xvzf asterisk-1.6.2-current.tar.gz
cd asterisk-1.6.2.11/
make clean
./configure
make
make install
make samples
make config

Configuration Files

Regardless of what OS you are running Asterisk on and regardless of what method of installation you used to install it, there are 2 main configuration files that we need to work with and one file we need to generate and include:

extensions.conf

If you are using an existing Asterisk server then add the following lines to the [default] context:

#include "fgcom.inc"
include => fgcom

Or if you are using a new Asterisk install remove everything from 'extensions.conf' and put in:

[general]
static=yes
writeprotect=yes
;
[default]
#include "fgcom.inc"
include => fgcom

iax.conf

[general]
bandwidth=low
disallow=lpc10
jitterbuffer=yes
forcejitterbuffer=no
tos=lowdelay
autokill=30000
codecpriority=host
disallow=all
allow=gsm
allow=ilbc
allow=g726
language=en
maxauthreq=30
context=fgcom
minregexpire=30
maxregexpire=10800
maxexpirey=10800
defaultexpirey=10800
;
[guest]
type=user
username=guest
secret=guest
context=fgcom
qualify=yes
callerid=Guest IAX User
host=dynamic
requirecalltoken=no
;

fgcom.inc

This is a special file generated using a script. It should be placed in the Asterisk config directory (/etc/asterisk/ normally).

You need the gen_phonebook.pl script (https://sourceforge.net/p/flightgear/fgcom/ci/master/tree/server/gen_phonebook.pl?format=raw) and nav.dat.gz and apt.dat.gz from the git repository.

Put them all in the same folder and run the script.