This site is intended to provide documentation on FreePBX usage, How-To Guides, related Asterisk, Linux, VoIP and Networking help and any other relevant information to the operation of a FreePBX based system. This is a community effort and we need your help to build upon and improve this documentation. If you have a particularly strong strength in documentation and editing, your help would be appreciated and you can contact the FreePBX team directly to see how you could get more deeply involved.
Documentation Porting Info We are currently in the process of moving the documentation from the old Aussie VoIP wiki to this site. If you have a minute, you can help.
Getting Started
This guide is meant for people brand new to open source IP telephony.
Contents:
Where to go from here
Read more detailed documentation in the administration guide, or more specific tips and in-depth information in the technical corner. You may also consider attending one of the official training courses, the Open Telephony Training Seminar. There are also other ways to get support.
Some other useful sites:
There are several components that make up a FreePBX system. The main ones are outlined here.
Server
This is the system that runs FreePBX, Asterisk, and the rest of your telephony stack. Although it is possible to run this as a virtual machine, it is not recommended for production systems. Typically this is a physical machine sitting on the same LAN as your phones.
Phones
Obviously without phones, a PBX is not going to be able to do a whole lot. There are a lot of possibilities here: there are IP phones, analog phones, softphones. With FreePBX, you can even route calls to external numbers (eg, a cell phone).
Another way is to connect analog phones is with an ATA (analog telephone adapter), which is a network device. They have an ethernet port, and one or more fxs ports. They talk SIP or IAX2 over ethernet back to your asterisk system, and as far as Asterisk is concerned, they appear just like any other IP phone. The benefit to these devices is you can locate them closer to the phone, and just use your ethernet network instead of running analog wiring to the phone.
PSTN Interface
Like phones, there are many ways to interface to the PSTN (public switched telephone network - the rest of the world). On the phone company side of things, there are many ways to provide interfaces:
There are many ways to connect all these interfaces to Asterisk:
VoIP PSTN Interface
Using a Voice over IP provider is another way to get connected to the PSTN. Most businesses do NOT use VoIP as their primary connection because it's unreliable compared to direct PSTN connections. It's susceptible to other internet traffic hogging bandwidth, and there are more points of failure (your ISP, your provider, your provider's ISP, and everyone else in between).
The provider will have PRI/T1 lines, and some kind of hardware and/or software that provides it to you as SIP or IAX2 (some providers even use Asterisk for this). There are all sorts of business models around this, but typically:
Installing the FreePBX application
FreePBX is an application the is built on the LAMPA stack, so in theory any system running this stack could run FreePBX.
The links below can help you get the application installed. Once it is installed, you'll want to go the Administration Guide to learn about setting up your new PBX.
Should you get stuck, go to the Support Center for help.
We do most of our development on CentOS, so we highly recommend that you use the same setup. In fact, for a pain free installation why not buy it pre-installed on a server from our online store.
Once the product is installed (i.e. Asterisk is running and the FreePBX GUI is up), you can go about configuring your PBX.
Centos 4.3 Installation Walkthrough
CentOS 4.3 (CentOS) is the distribution used throughout this guide.
We believe that the goals of the distribution are in good alignment
with the mission-critical nature of a corporate telephone system.
CentOS ISOs can be downloaded from a number of mirror sites. Check the
official CentOS website for more information.
Detailing a Linux installation is beyond the scope of this
document. There are numerous articles, HOW-TOs and books available to
the individual that deal with this subject. Therefore, for the purposes
of this document it is assumed that the CentOS installation is that of
a Server system. Furthermore, for the purposes of this
document it is assumed that the partitioning of the hard disk drive was
done automatically by selecting Autopartition when prompted, and that no previous partitions existed on the drive prior to installation.
Important Installation Notice During the installation you will be prompted about Firewalls and Selinux. Both of these MUST BE DISABLED.
The Sections to disable are highlighted in red below. After clicking
next, you will be prompted if you are sure this is correct - Click on Proceed.
Package Group Selection
Whilst It is not recommended to use the X Window System on a
production freePBX server, it is possible. If you're only doing this
for a test, or experementation, feel free to install X and Gnome or
KDE. If you are planning on using this as a production system, please
avoid installing X unless it's absoloutely necessary.
freePBX has several requirements (which we will cover in a later
section) but at this point of the CentOS installation ensure that at
least the following package groups are selected
After you've done this, the machine will install CentOS, install,
and reboot. At this stage, you have a functioning Linux system!
Post-Install Configuration
After your machine reboots, you need to log in as 'root' - You were
prompted for the root password on installation. When you log in
successfully, you will have a prompt li
For performance and security reasons it is important to update the system immediately after install. CentOS uses yum (or up2date but that is not a recommended way of doing updates) for this purpose. In this document we will use yum:
[root@dhcp1 ~]# yum -y update
Setting up Update Process
Setting up repositories
...etc....
...etc...
Update: gnupg.i386 0:1.2.6-3 python.i386 0:2.3.4-14.2 sendmail.i386 0:8.13.1-3.RHEL4.3 tzdata.noarch 0:2006a-2.EL4
Complete!
root[@dhcp1 ~]#
Additional Package Installation to Satisfy freePBX dependencies
You can check if a particular package is installed by doing either:
[root@dhcp1 ~]# yum info [package]
or:
[root@dhcp1 ~]# rpm -qa | grep [package]
If the package is not installed, install it by using yum:
[root@dhcp1 ~]# yum install [package]
Full documentation on 'yum' is available by typing man yum.
The following packages need to be additionally installed with yum:
[root@dhcp1 ~]# yum install gcc
libxml2-devel libtiff-devel mysql-server php-gd php-mysql kernel-devel
kernel-smp-devel bison ncurses-devel audiofile-devel subversion
libogg-devel openssl-devel mysql-devel
lame is not available through a yum repository; but it can be obtained and installed from Dag Wieers' RPM repository:
[root@dhcp1 ~]# rpm -ivh http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/lame-3.96.1-2.2.el4.rf.i386.rpm
Satisfying freePBX's PERL module dependencies
freePBX, from version 2.1 does not have any specific perl
dependancies. There used to be a big list here, but we finally managed
to get rid of all of them!
Get the latest freePBX files
You may wish to check that the link specified here is actually the latest and greatest. Look at the files available on Source Forge and pick the latest one there.
[root@dhcp1 ~]# cd /usr/src
[root@dhcp1 src]# wget http://easynews.dl.sourceforge.net/sourceforge/amportal/freepbx-2.1.1.tar.gz
[root@dhcp1s src]# tar zxf freepbx-2.1.1.tar.gz
A pause while the files are extracted...
[root@dhcp1 src]#
Getting all the required Asterisk and Zaptel files.
[root@dhcp1 ~]# cd /usr/src
[root@dhcp1 src]# svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk
..Lots of files...
[root@dhcp1 src]# svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons
..Lots of files...
[root@dhcp1 src]# svn co http://svn.digium.com/svn/asterisk-sounds/trunk asterisk-sounds
..Lots of files...
[root@dhcp1 src]# svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel
..Lots of files...
[root@dhcp1 src]# svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri
..Lots of files...
Patch and Compile zaptel (and libpri)
If you plan on useing IAX or conferencing and _don't_ have any digium hardware skip this part and read this ztdummy install guide then continue on at "Compile Asterisk"
[root@dhcp1 src]# cd /usr/src/zaptel
[root@dhcp1 zaptel]# cp ztdummy.c ztdummy.c.orig
[root@dhcp1 zaptel]# sed -i "s/if 0/if 1/" ztdummy.c
[root@dhcp1 zaptel]# make
If you get an error that looks like this:
/usr/src/zaptel/zaptel.c:420: error: syntax error before "zone_lock"
/usr/src/zaptel/zaptel.c:420: warning: type defaults to `int' in declaration of `zone_lock'
/usr/src/zaptel/zaptel.c:420: error: incompatible types in initialization
..10 or so more lines..
it means that your CentOS header files have an error in them.
This is a known bug and is easily repaired by
[root@dhcp1 zaptel]# sed -i s/rw_lock/rwlock/ /usr/src/kernels/`uname -r`-`uname -m`/include/linux/spinlock.h
You can now retry the make command. After it's finished, you need to run make install and make config. If you will be using a Digium or Sangoma telephony card that supports T1/E1 signaling do this step as well:
[root@dhcp1 zaptel]# cd /usr/src/libpri
[root@dhcp1 libpri]# make install
Compile Asterisk
Now you get to compile the centre of the package - asterisk! This is relatively paineless:
[root@dhcp1 libpri]# cd /usr/src/asterisk
[root@dhcp1 asterisk]# mkdir /var/run/asterisk
[root@dhcp1 asterisk]# make install
[root@dhcp1 asterisk]# make config
Take a couple of minutes now and configure your zaptel
files, before continuing. If you think you'll want to have Asterisk and
freePBX itself handle faxing (rather than using a dedicated fax
device), you should read the Faxing page.
Create user and set permissions
Unfortunately, issues in Asterisk 1.2 require us
to run the web server process as the same user as asterisk. In this
situation, it's easier for us to run httpd as 'asterisk', rather than
asterisk as 'httpd', as there's far less configuration that needs to be
done.
[root@dhcp1 ~l]# useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
[root@dhcp1 ~]# chown asterisk /var/lib/php/session/
Using nano (or your favourite editor, but nano is fine), you need to change User apache and Group apache to User asterisk and Group asterisk.
[root@dhcp1 ~]# nano +227 /etc/httpd/conf/httpd.conf (Push Control-X to save when you've finished)
You also want to change AllowOverride None to AllowOverride All
[root@dhcp1 ~]# nano +311 /etc/httpd/conf/httpd.conf (Push Control-X to save when you've finished)
Set up MySQL
Before you can do anything to MySQL, you need to make sure it's running:
[root@dhcp1 ~]# /etc/init.d/mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
[root@dhcp1 ~]#
Now, to configure the databases for freePBX:
[root@dhcp1 ~]# cd /usr/src/freepbx-2.1.1
[root@dhcp1 freepbx-2.1.1]# mysqladmin create asterisk
[root@dhcp1 freepbx-2.1.1]# mysqladmin create asteriskcdrdb
[root@dhcp1 freepbx-2.1.1]# mysql asterisk < SQL/newinstall.sql
[root@dhcp1 freepbx-2.1.1]# mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
They also need to be secured, so that not just anyone can access
them. freePBX will prompt you for a database password when you do the
install. You need to pick that now. We'll assume that you've picked
'asteriskuser' and 'amp109' - you probably shouldn't use these, as they
are well known passwords for Asterisk@Home builds. If anyone's trying
to attack your machine, they will try this.
[root@dhcp1 freepbx-2.1.1]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.16
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> \q
Bye
[root@dhcp1 freepbx-2.0.1]
Now, after all of this, you need to pick a root 'mysql' password.
For this, we'll pretend it's 's33kret'. If you need to do anything else
with mysql, you'll need to provide this password.
[root@dhcp1 freepbx-2.1.1]# mysqladmin -u root password 's33kret'
Build the cdr_mysql module for Asterisk (Yep, more compiling!)
[root@dhcp1 freepbx-2.1.1]# cd /usr/src/asterisk-addons
[root@dhcp1 freepbx-2.1.1]# cp Makefile Makefile.orig
[root@dhcp1 freepbx-2.1.1]# sed -i 's/SOURCE/SOURCE -DMYSQL_LOGUNIQUEID/' Makefile
[root@dhcp1 freepbx-2.1.1]# make && make install
Install freePBX at last!
You're there - you've done the hard yards, and finally you can install freePBX!
WARNING! If you have an existing Asterisk installation, the script below will overwrite your Asterisk configuration files. Backup your
/etc/asterisk directory before running.
$cd /usr/src/freepbx-2.1-beta1
$./install_amp
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for libasteriskperl (perl bindings for asterisk)...Checking user..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database: [asteriskuser]
Enter your PASSWORD to connect to the 'asterisk' database: [amp109]
Enter the hostname of the 'asterisk' database: [localhost]
Enter a USERNAME to connect to the Asterisk Manager interface: [admin]
Enter a PASSWORD to connect to the Asterisk Manager interface:[amp111]
Enter the path to use for your AMP web root:[/var/www/html]
Enter the path to use for your FOP web root:[/var/www/html/panel]
Created /var/www/html/panel
Enter the path to your Apache cgi-bin:[/var/www/cgi-bin]
Enter the IP ADDRESS or hostname used to access the AMP web-admin:[xx.xx.xx.xx] The IP Address of your Asterisk Machine
Enter a PASSWORD to perform call transfers with the Flash Operator Panel: [passw0rd]
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]? extensions
Enter directory in which to store AMP executable scripts: [/var/lib/asterisk/bin]
Created /var/lib/asterisk/bin
Enter directory in which to store super-user scripts: [/usr/sbin]
/etc/amportal.conf writtenOK
Reading /etc/amportal.conf..OK
Checking for /etc/asterisk/asterisk.conf../etc/asterisk/asterisk.conf does not exist, copying default
OK
Reading /etc/asterisk/asterisk.conf..OK
Connecting to database..OK
Checking current version of AMP..1.10.010beta1
Installing new AMP files..OK
Configuring install for your environment..OK
Setting permissions on files..OK
Checking for upgrades..5 found
Upgrading to 1.10.010..
Upgrading to 1.10.010..OK
Upgrading to 2.0beta1..
-> Running PHP script /usr/src/freepbx-2.0-beta4/upgrades/2.0beta1/emergencycid.php
-> Running SQL script /usr/src/freepbx-2.0-beta4/upgrades/2.0beta1/tables.sql
PHP Notice: Undefined variable: data in /usr/src/freepbx-2.0-beta4/install_amp on line 305
Upgrading to 2.0beta1..OK
Upgrading to 2.0beta2..
Upgrading to 2.0beta2..OK
Upgrading to 2.0beta3..
-> Running PHP script /usr/src/freepbx-2.0-beta4/upgrades/2.0beta3/fixgotovm.php
Updating existing voicemail destinations..
..OK
Upgrading to 2.0beta3..OK
Upgrading to 2.0beta4..
Upgrading to 2.0beta4..OK
Generating AMP configs..
Generating Configurations.conf..
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..OK
Connecting to database..OK
Please Reload Asterisk by visiting http://XXX.XXX.XXX.XX/admin
Generating AMP configs..OK
Restarting Flash Operator Panel..-bash: /var/www/html/admin/bounce_op.sh: Permission denied
OK
Please Reload Asterisk by visiting http://XXX.XXX.XXX.XX/admin
If you get any warnings or errors in the last part of the output,
they're usually not traumatic, but please use the IRC Support tool to
report a bug to the developers.
amportal control script
Starting with version 1.10.004, freePBX provided a new control
script. The functionality of which is to start, stop or kill services
in the freePBX environment, or to set permissions on directories/files
in the freePBX environment:
$amportal
----------AMP Control Script-----------
Usage: amportal start|stop|kill|chown
start: Starts Asterisk and Flash Operator Panel server
stop: Gracefully stops Asterisk and the FOP server
restart: Stop and Starts
kill: Kills Asterisk and the FOP server
chown: Sets appropriate permissions on files
The amportal script is the recommended way to stop and start asterisk:
$ /usr/sbin/amportal stop
$ /usr/sbin/amportal start
19.Automatic start-up
echo /usr/sbin/amportal start >> /etc/rc.local
Ensure services are starting at boot time and reboot
In order to access and use freePBX we will want both Apache (httpd)
and MySQL (mysqld) to be started at boot. You can check to see if they
are setup to start at boot by using chkconfig:
[root@dhcp1 freepbx-2.1.1]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@dhcp1 freepbx-2.1.1]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Here we see that both httpd and mysqld have off
across the board (runlevels). chkconfig can also be used to turn on a
particular service, which you would want to do in this case.
^[root@dhcp1 freepbx-2.1.1]# chkconfig httpd on
[root@dhcp1 freepbx-2.1.1]# chkconfig mysqld on
You can now access freePBX with your web browser.
The first time you click on the FreePBX Administration link you
will be prompted for a username and password. Use admin and admin.
CREATE A NEW ADMINISTRATIVE USER IMMEDIATELY AFTER LOGIN.
1. Install CentOS, enabling the following packages:
*DNS Server
*Web Server
*Mail Server
*MySQL Database
*Development Tools
yum install nano
reboot
2. Edit Network settings
nano /etc/sysconfig/network
HOSTNAME=internal.hostname.DOMAIN.com (Set your internal hostname name here)
Ctrl-X to save, 'Y' to confirm
nano /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDDR=192.168.1.20
NETMASK=255.255.255.0
NETWORK=192.168.1.0
Ctrl-X to save, 'Y' to confirm
echo "options {" >> /etc/named.conf
echo " directory \"/var/named\";" >> /etc/named.conf
echo " dump-file \"/var/named/data/cache_dump.db\";" >> /etc/named.conf
echo " statistics-file \"/var/named/data/named_stats.txt\";" >> /etc/named.conf
echo "};" >> /etc/named.conf
echo "include \"/etc/rndc.key\";" >> /etc/named.conf
service named start
chkconfig named on
nano /etc/resolv.conf
search internal.DOMAIN.com (Set your internal domain name here)
nameserver 192.168.1.5
nameserver 127.0.0.1
nano /etc/hosts
127.0.0.1 internal.hostname.DOMAIN.com (Set your internal hostname name here)
127.0.0.1 asterisk1.local
127.0.0.1 localhost
Ctrl-X to save, 'Y' to confirm
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
/etc/init.d/iptables save
service network restart
3. Update:
yum -y update
4. Disable Selinux:
echo "selinux=disabled" > /etc/selinux/config
reboot
5. Install dependencies and extra packages:
yum install e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel libtiff-devel gmp php-pear php-pear-DB php-gd php-mysql php-pdo kernel-devel ncurses-devel audiofile-devel libogg-devel openssl-devel mysql-devel zlib-devel perl-DateManip sendmail-cf
cd /usr/src
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
tar zxvf lame-3.97.tar.gz
cd lame-3.97
./configure
make
make install
6. Install Asterisk and FreePBX:
cd /usr/src
wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar...
wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz
wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
wget http://easynews.dl.sourceforge.net/sourceforge/amportal/freepbx-2.3.1.ta...
tar zxvf asterisk-1.4-current.tar.gz
tar zxvf asterisk-addons-1.4-current.tar.gz
tar zxvf zaptel-1.4-current.tar.gz
tar zxvf libpri-1.4-current.tar.gz
tar zxvf freepbx-2.3.1.tar.gz
cd /usr/src/zaptel-1.4-current
./configure
make
make install
make config
/sbin/ztcfg
echo "/sbin/ztcfg" >> /etc/rc.d/rc.local
cd /usr/src/libpri-1.4-current
./configure
make
make install
cd /usr/src/asterisk-1.4-current
useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
mkdir /var/run/asterisk
mkdir /var/log/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chown -R asterisk:asterisk /var/lib/php/session/
nano +231 /etc/httpd/conf/httpd.conf
Change User apache and Group apache to User asterisk and Group asterisk.
Ctrl-X to save, 'Y' to confirm
nano +329 /etc/httpd/conf/httpd.conf
Change AllowOverride None to AllowOverride All
Ctrl-X to save, 'Y' to confirm
./configure
make
make install
/etc/init.d/mysqld start
cd /usr/src/freepbx-2.3.1
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
mysql
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD';
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD';
flush privileges;
\q
mysqladmin -u root password 'SOMEPASSWORD'
cd /usr/src/asterisk-addons
./configure
make
make install
cd /usr/src/freepbx-2.3.1
./start_asterisk start
./install_amp --username=asteriskuser --password=SOMEPASSWORD
echo "/usr/local/sbin/amportal start" >> /etc/rc.local
chkconfig httpd on
chkconfig mysqld on
Open browser to http://ipaddressofpbx/admin
Click red bar in FreePBX
7. Fix ARI password:
nano -w /var/www/html/recordings/includes/main.conf.php
$ari_admin_password = "SOMEPASSWORD";
Ctrl-X to save, 'Y' to confirm
8. Configure Sendmail:
nano /etc/mail/sendmail.mc
define(`SMART_HOST', `relay.DOMAIN.com)dnl
MASQUERADE_AS(`pbx.DOMAIN.com')dnl
FEATURE(`masquerade_envelope')dnl
Ctrl-X to save, 'Y' to confirm
make -C /etc/mail
9. Edit sip_nat.conf for proper NAT:
nano /etc/asterisk/sip_nat.conf
localnet=192.168.1.0/255.255.255.0
externhost=pbx.DOMAIN.com (Set your external hostname name here)
externrefresh=10
fromdomain=DOMAIN.com (Set your external domain name here)
nat=yes
qualify=yes
canreinvite=no
Ctrl-X to save, 'Y' to confirm
10. Add extra codecs to config:
nano /etc/asterisk/sip_custom.conf
allow=gsm
allow=h261
allow=h263
allow=h263p
videosupport=yes
Ctrl-X to save, 'Y' to confirm
nano /etc/asterisk/iax_custom.conf
allow=gsm
allow=h261
allow=h263
allow=h263p
videosupport=yes
Ctrl-X to save, 'Y' to confirm
asterisk -rx reload
11. Edit voicemail config:
nano /etc/amportal.conf
If the web interface on your PBX will be accessible on the internet:
AMPWEBADDRESS=pbx.DOMAIN.com (Set your external hostname name here)
If the web interface on your PBX will be accessible only on your internal network:
AMPWEBADDRESS=internal.hostname.DOMAIN.com (Set your internal hostname name here)
Ctrl-X to save, 'Y' to confirm
or if your users will NOT have access to the web interface:
nano /etc/asterisk/vm_email.inc
remove "Visit http://AMPWEBADDRESS/cgi-bin/vmail.cgi?action=login&mailbox=${VM_MAILBOX} to check your voicemail with a web browser.\n"
Ctrl-X to save, 'Y' to confirm
nano /etc/asterisk/vm_general.inc
serveremail=pbx@DOMAIN.com ; Who the e-mail notification should appear to come from
fromstring=DOMAIN PBX ; Real name of email sender
Ctrl-X to save, 'Y' to confirm
12. Fix MOH directory:
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
asterisk -rx reload
14. Open browser to http://ipaddressofpbx
Done!
Optional Package:
ConfControl is a partial rewrite of Web-MeetMe which includes only the conference control page and not all the scheduling options. It includes a replacement index.html page which adds a link to ConfControl from the FreePBX home page.
cd /var/www/html
wget http://www.2l2o.com/asterisk/ConfControl1.0.tar.gz
tar zxvf ConfControl1.0.tar.gz
rm ConfControl1.0.tar.gz
Detailed guides for installing FreePBX on ClakConnect can be found here:
http://samyantoun.50webs.com/asterisk/freepbx/clarkconnect/
A good guide is http://www.squishychicken.com/index.php?option=com_content&task=view&id=13&Itemid=2. It's for AMP and Asterisk 1.2, but can used to install freePBX instead.
Updated for FreePBX and other software version changes. I also felt it needed to be made more idiot proof for dummies like me who spent many frustrating hours trying to get it to work.
http://powerontech.com/freepbx-on-debian.htm
There is a good Ubuntu guide here that can be of assistance, until somebody writes an updated guide for freePBX 2.3 and Debian Etch.
0.- In the meantime freepbx is not in the oficial freebs ddistribution download the port from here
http://www.freepbx.org/attachment/ticket/761/freepbx-2.1.tar
1.- Choose what apache, mysql and php version you want to use. For example, you could put this in your make.conf:
DEFAULT_PHP_VER=5
DEFAULT_MYSQL_VER=50
APACHE_PORT=www/apache20
2.- cd /usr/ports/misc/freepbx
3.- If you have php previously install make sure you have pear in your php.ini include paths.
3.- make install
4.- drink a coffee
5.- Read the post instalation notes:
1) enable .php files in your apache config
2) adding index.php as default index files
3) add pear and /.../admin to your php.ini includes
4) Make sure asterisk and mysql are running fine
5) Make sure asterisk accepts connections (manager.conf)
7.- Complete this document!
This is a work in progress
Notes
Basic gentoo knowledge is required, if you don't know what a USE flag then this will be hard to follow.
Look the the requirements in the INSTALL file and get your apache/php flags correct and reemerge dev-lang/php if needed.
emerge asterisk >= 1.2 - http://gentoo-portage.com/net-misc/asterisk
and asterisk-addons - http://gentoo-portage.com/net-misc/asterisk-addons
note: as of this writing the correct ebuild is asterisk-1.2.9_p1
Both are masked with ~x86 so (if you're not on x86 modify as needed) umask them with
`echo "net-misc/asterisk ~x86" >> /etc/portage/package.keywords`
and
`echo "net-misc/asterisk-addons ~x86" >> /etc/portage/package.keywords`
To emerge:
`emerge asterisk asterisk-addons`
Note: I have `net-misc/asterisk zaptel speex mysql -vmdbmysql` in
my package.use for asterisk but you may need otherwise, read the use
flags descriptions at gentoo-portage.com
This will get asterisk to be ready to futher configure.
Amportal Issues:
in /usr/sbin/safe_asterisk change
ASTSBINDIR=/sbin to
ASTSBINDIR=/usr/sbin
check in /etc/passwd and make the asterisk user have /bin/bash as the shell if it's not already such.
I also needed asterisk ownership on the htdocs folder above the freepbx files.
"Engineered by Digium in conjunction with rPath, Pound Key includes all
the Linux components necessary to run, debug and build Asterisk, and
only those components. You no longer have to worry about kernel
versions and package dependencies. Unlike other Linux distributions
used to deploy Asterisk, no unnecessary components that might
compromise security or performance are included."
While technically true, PoundKey is missing several components
needed for FreePBX to run. Below are most of the commands neded to
ensure a smooth installation of FreePBX when following the normal
INSTALL document.
Install missing rPath components from the primary distributions:
conary update libxml2 libtiff bison audiofile php-mysql m4
Install lame from the Media Center Linux repository:
conary update lame=steel.rpath.org@rpl:devel
Repair PEAR for proper operation of the install_amp script:
pear install DB
Install perl MIME::Types:
perl -MCPAN -e "install MIME::Types"
Once these steps are complete, the normall INSTALL document can be easily followed.
FreePBX 2 has been tested with SuSe LES 9 and SuSe 10.
In reality seems fairly solid with not a lot of work needing to be
done to run FreePBX. Mainly check that you have DB (installable via
PEAR if required) and PHP4-GETTEXT (available as part of the SUSE
install) installed. If you have any PHP problems check that you have
the line include_path = ".:/usr/share/php" in /etc/php.ini. (The '.:' is the important bit)
To install DB, or if you aren't sure whether you have it installed, you can use pear. pear list will show a list of installed packages. To install DB either run pear install DB
on the command line or visit http://pear.php.net/package/DB and
download the latest stable version, 1.7.6 at present. A pear install
should download it and install it but it will complain about any
dependancies it needs and had a tendancy to fail on my system due for
this exact reason. The best way I found was to download the file onto
my SuSe? system and run pear install -n <location/filename>
manually. This tells pear to ignore any dependancies, as otherwise it
will probably complain about pear itself! Once finished you should have
DB.php and a DB directory in /usr/share/php.
When installing FreePBX remember that the webserver root is
different to the one defaulted to in the install_amp script. Your
webserver root should be /srv/www/htdocs so use that as the root and a
bit of common sense to change the panel and cgi-bin paths.
No other file changes should be required to get FreePBX working.
In this document there are various boxes, with text inside them.
These are examples of what you see on your screen, what you should
type, and/or the expected responses. For example:
rob@rob-laptop:~$ id
uid=1000(rob) gid=1000(rob)
groups=4(adm),20(dialout),24(cdrom),25(floppy),
29(audio),30(dip),44(video),46(plugdev),
106(lpadmin),110(scanner),112(admin),1000(rob)
In that situation, you would type 'id' and the response would be
similar to the response indicated. If you see an error, that probably
means you've typed something incorrectly, but it could also suggest
other problems. Read the error carefully, and if you don't know how to
fix it, feel free to post to the forums or ask on IRC.
Operating System Installation
Installation of Ubuntu is out of the scope of this document.. As a
reference point this document was written with accepting the defaults
for everything suggested in the installer..
Post Installation Configuration
After your machine has rebooted and you've logged in, you need to
switch to the 'root' account. Whilst installing you were prompted for a
password, which is what you must enter when prompted below:
rob@rob-laptop:~$ sudo su -
Password: Enter Password Here
root@rob-laptop:~#
This gives you full control of the system. It's the equivlent of typing 'sudo' before every command.
You now need to ensure that your machine is able to access the
internet, and once that is working you can proceed with the
installation Usually being able to browse the internet with Firefox is
a good indication that you won't be having any problems.
Check for updates and install required packages
Before running apt-get, you must edit the sources.list file so that you can install from the "universe".
nano +17 -w /etc/apt/sources.list
Remove the # signs from this line and add multiverse at the end:
deb http://us.archive.ubuntu.com/ubuntu/ dapper universe multiverse
Multiverse gives you access to a lot more packages then the standard repository does, useful for future reference.
Unless you've added extra repositories, your sources.list should look something like:
deb http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ dapper-security main restricted universe multiverse
In addition to this, you must update apt's package lists"
apt-get update
You need to ensure that your machine is up to date with the current
security packages release by Ubuntu. After doing so, an apt-get of the
modules below will install all the requirements for freePBX
root@rob-laptop:~# apt-get install
php5 php5-cli php5-mysql mysql-server php-pear php-db openssh-server
curl sox apache2 subversion build-essential libncurses5-dev libssl-dev
linux-headers-`uname -r` libmysqlclient15-dev
... Please copy-and-paste that line, rather than trying to type it in.
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
apache-common apache2-common apache2-mpm-prefork apache2-utils
... Several more lines of automatically imported packages ...
mysql-server-5.0 openssh-server php-db php-http php-mail php-net-smtp
php-net-socket php-pear php-xml-parser php4 php4-cli php4-common php4-mysql
php4-pear php5-common sox ssl-cert zlib1g-dev
0 upgraded, 39 newly installed, 0 to remove and 6 not upgraded.
Need to get 40.6MB of archives.
After unpacking 107MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://au.archive.ubuntu.com dapper/main libpcre3 6.4-1.1ubuntu4 [174kB]
Get:2 http://security.ubuntu.com dapper-security/main libapr0 2.0.55-4ubuntu2.1 [132kB]
Get:3 http://au.archive.ubuntu.com dapper/main ssl-cert 1.0.13 [9526B]
Get:4 http://au.archive.ubuntu.com dapper/main curl 7.15.1-1ubuntu2 [168kB]
... The machine now proceeds to download and install packages ...
Setting up sox (12.17.9-1) ...
root@rob-laptop:~#
Downloading and Installing Asterisk
Previous comment:
Options, if you use edgy instead of dapper, you will get the
latest version of asterisk without needing to compile etc etc etc, all
you need to do is: apt-get install asterisk and skip to the section on
MySQL... Dapper also has packaged versions of asterisk and is quite
useable also, and is a lot easier to manage then compiling and
re-compiling to upgrade all the time
Rob's Response:
Well, I tried this, (on 6.06 LTS) and got Asterisk-1.2.7.1, and
Zaptel-1.2.5. Both of these are _woefully_ out of date. Asterisk has 3
Denial-Of-Service bugs and 2 security bugs, and Zaptel doesn't have the
proper echo cancellation enabled in it. Yes. Maybe it might be easier
to type in 'apt-get install asterisk zaptel', but it'll be crap.
Compile from source, it's not that hard. To make it easier, I've put
one box at the bottom of the downloading section that you can
copy-and-paste from to install everything from source.
Downloading
We will be using subversion to download the latest version of the
1.2 branch of Asterisk, Zaptel, LibPRI and Asterisk-Addons.
asterisk-sounds will be the latest version.
root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
... Lots of files are downloaded ...
root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
... Zaptel files download ...
root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2
... LibPRI downloads - Note, this is quite small, only about 15 files. This is normal ...
root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons-1.2
... Asterisk-Addons downloads...
root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/asterisk/trunk/sounds asterisk-sounds
... The default Sounds package downloads now. This can be quite large ...
root@rob-laptop:/usr/src#
Compiling and Installing
You now need to compile and install the latest version of asterisk.
root@rob-laptop:/usr/src# cd libpri-1.2
root@rob-laptop:/usr/src/libpri-1.2# make install
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o copy_string.o copy_string.c
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri.o pri.c
... libpri compiles ...
install -m 644 libpri.a /usr/lib
if test $(id -u) = 0; then /sbin/ldconfig -n /usr/lib; fi
root@rob-laptop:/usr/src/libpri-1.2# cd ../zaptel-1.2
root@rob-laptop:/usr/src/zaptel-1.2# make install config
cc -I. -O4 -g -Wall -DBUILDING_TONEZONE -DSTANDALONE_ZAPATA
-DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -DHOTPLUG_FIRMWARE -c -o
gendigits.o gendigits.c
cc -o gendigits gendigits.o -lm
./gendigits > tones.h
... zaptel compiles - Note that any errors here are usually
because of you not having the correct version of linux-headers'
installed ...
ZAPTELVERSION="SVN-branch-1.2-r1468" build_tools/make_version_h > version.h.tmp
if cmp -s version.h.tmp version.h ; then echo; else \
mv version.h.tmp version.h ; \
fi
... Zaptel compiles ...
root@rob-laptop:/usr/src/zaptel-1.2# cd ../asterisk-1.2
root@rob-laptop:/usr/src/asterisk-1.2# make install
if cmp -s .cleancount .lastclean ; then echo ; else \
make clean; cp -f .cleancount .lastclean;\
fi
make1: Entering directory `/usr/src/asterisk-1.2'
... Asterisk Compiles ...
root@rob-laptop:/usr/src/asterisk-1.2# cd ../asterisk-addons-1.2
root@rob-laptop:/usr/src/asterisk-addons-1.2# make install
./mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c`
make -C format_mp3 all
... Asterisk-Addons now install ...
root@rob-laptop:/usr/src/asterisk-addons-1.2# cd ../asterisk-sounds/
root@rob-laptop:/usr/src/asterisk-sounds# make install
... Lots of additional sound files are installed here ...
root@rob-laptop:/usr/src/asterisk-sounds#
Copy-And-Paste this, for ease of installation:
cd /usr/src
svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2
svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons-1.2
svn co http://svn.digium.com/svn/asterisk/trunk/sounds asterisk-sounds
cd /usr/src/libpri-1.2 && make install
cd /usr/src/zaptel-1.2
sed -i 's!^#define ECHO_CAN_KB1!/* #define ECHO_CAN_KB1 */!' zconfig.h
sed -i 's!/\* #define ECHO_CAN_MG2 \*/!#define ECHO_CAN_MG2!' zconfig.h
make install
cd /usr/src/asterisk-1.2 && make install
cd /usr/src/asterisk-addons-1.2
sed -i 's/_GNU_SOURCE/_GNU_SOURCE -DMYSQL_LOGUNIQUEID/' Makefile
make install
If all you wanted to do was install Asterisk on a Ubuntu machine,
you're done - you now have a fully functional Asterisk box, for you to
play with as you wish. If you want, you can run 'make samples' in the
asterisk-1.2 directory to install some example configuration files for
you to play with. However, since you're reading this on the FreePBX
site, we're now up to isetting the machine up and nstalling FreePBX.
Create user and set permissions
Unfortunately, issues in Asterisk 1.2 require us
to run the web server process as the same user as asterisk. In this
situation, it's easier for us to run httpd as 'asterisk', rather than
asterisk as 'httpd', as there's far less configuration that needs to be
done.
root@rob-laptop:~# addgroup asterisk
Adding group `asterisk' (1001)...
Done.
root@rob-laptop:~# useradd -g asterisk -c "Asterisk PBX" -d /var/lib/asterisk asterisk
root@rob-laptop:~# mkdir /var/run/asterisk
root@rob-laptop:~# chown -R asterisk /var/lib/php5
Using nano (or your favourite editor, but nano is fine), you need to change User apache and Group apache to User asterisk and Group asterisk.
[root@dhcp1 ~]# nano +101 /etc/apache2/apache2.conf (Push Control-X to save when you've finished)
You also want to change AllowOverride None to AllowOverride All
[root@dhcp1 ~]# nano +12 /etc/apache2/sites-enabled/000-default (Push Control-X to save when you've finished)
And then restart asterisk to re-load its configuration.
root@rob-laptop:~# /etc/init.d/apache2 restart
Set up MySQL
Before you can do anything to MySQL, you need to make sure it's running:
root@rob-laptop:~# /etc/init.d/mysql start
Starting MySQL database server: mysqld.
root@rob-laptop:~#
Now, you must cd to the /usr/src directory and get the source to freepbx using svn:
root@rob-laptop:/usr/src/freepbx# cd /usr/src/
root@rob-laptop:/usr/src# svn co https://svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2 freepbx-2.2
A freepbx/amp_conf
A freepbx/amp_conf/astetc
... freePBX now downloads ...
Checked out revision 2574.
root@rob-laptop:/usr/src# cd /usr/src/freepbx-2.2
Now, to configure the databases for freePBX:
root@rob-laptop:/usr/src/freepbx# mysqladmin create asterisk
root@rob-laptop:/usr/src/freepbx# mysqladmin create asteriskcdrdb
root@rob-laptop:/usr/src/freepbx# mysql asterisk < SQL/newinstall.sql
root@rob-laptop:/usr/src/freepbx# mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
They also need to be secured, so that not just anyone can access
them. freePBX will prompt you for a database password when you do the
install. You need to pick that now. We'll assume that you've picked
'asteriskuser' and 'amp109' - you probably shouldn't use these, as they
are well known passwords for Asterisk@Home builds. If anyone's trying
to attack your machine, they will try this.
root@rob-laptop:/usr/src/freepbx# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 5.0.22-Debian_0ubuntu6.06.2-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109'; (This is the first username and password asked for below)
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> \q
Bye
root@rob-laptop:/usr/src/freepbx#
Now, after all of this, you need to pick a root 'mysql' password.
For this, we'll pretend it's 's33kret'. If you need to do anything else
with mysql, you'll need to provide this password.
root@rob-laptop:/usr/src/freepbx# mysqladmin -u root password 's33kret'
Install freePBX at last!
You're there - you've done the hard yards, and finally you can install freePBX!
WARNING! If you have an existing Asterisk
installation, the script below will overwrite your Asterisk
configuration files. Backup your /etc/asterisk directory before
running.
root@rob-laptop:/usr/src/freepbx# ./install_amp
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking user..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database:
[asteriskuser] (Just push enter if you've done the defaults above, or, fill in the details you entered)
Enter your PASSWORD to connect to the 'asterisk' database:
[amp109] (As above, the password you picked in the MYSQL command)
Enter the hostname of the 'asterisk' database:
[localhost] (Just push enter)
Enter a USERNAME to connect to the Asterisk Manager interface:
[admin] (Just push enter)
Enter a PASSWORD to connect to the Asterisk Manager interface:
[amp111] (Just push enter)
Enter the path to use for your AMP web root:
[/var/www/html]
/var/www
Enter the path to use for your FOP web root:
[/var/www/html/panel]
/var/www/panel
Enter the path to your Apache cgi-bin:
[/var/www/cgi-bin] /usr/lib/cgi-bin
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
[xx.xx.xx.xx] Enter the IP Address of your UBUNTU SERVER HERE
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
[passw0rd] (Just push enter)
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
[extensions](Just push enter)
Enter directory in which to store AMP executable scripts:
[/var/lib/asterisk/bin] (Just push enter)
Created /var/lib/asterisk/bin
Enter directory in which to store super-user scripts:
[/usr/sbin] (Just push enter)
/etc/amportal.conf writtenOK
Reading /etc/amportal.conf..OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Checking for Asterisk 1.2..OK
Checking for selinux..OK
At this stage, you're almost done, but there's quite often a
problem when people have made a typo, or forgotten to put a password in
the mysql server. If you see these lines:
Connecting to database..FAILED
Try running ./install_amp --username=user --password=pass (using your own user and pass)
[FATAL] Cannot connect to database
root@rob-laptop:/usr/src/freepbx#
it means that you haven't done the 'GRANT ALL PRIVILEGES ...'
command in MySQL, or, you've put the wrong password in when you were
doing the installation. All is not lost. If you want to re-run the
installation, with it prompting you again, you can simply delete the
/etc/amportal.conf file (rm /etc/amportal.conf) or edit it and put the correct password in. Then re-run ./install_amp and it should proceed along happily.
root@rob-laptop:/usr/src/freepbx# ./install_amp
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking user..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Checking for Asterisk 1.2..OK
Checking for selinux..OK
Connecting to database..OK
Checking current version of AMP..2.1.2
Installing new AMP files..OK
Configuring install for your environment..OK
Setting permissions on files..OK
Checking for upgrades..0 found
Generating AMP configs..
Generating Configurations.conf..
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Connecting to database..OK
Please Reload Asterisk by visiting http://192.168.1.53/admin
Generating AMP configs..OK
Restarting Flash Operator Panel..op_server.pl: no process killed
OK
Please Reload Asterisk by visiting http://192.168.1.53/admin
root@rob-laptop:/usr/src/freepbx# modprobe ztdummy
root@rob-laptop:/usr/src/freepbx# amportal start
Starting FreePBX and Asterisk automatically
If you don't have any zaptel hardware, you can automatically start
ztdummy and asterisk by editing /etc/rc.local, and before the 'exit 0'
line insert these two lines:
modprobe ztdummy
/usr/sbin/amportal start &
That ensures that the timing module (ztdummy) is loaded, and that
asterisk is running on bootup. You can also use the /etc/init.d/zaptel
script to start zaptel, hopefully someone with more ubuntu knowledge
can update this page with how to enable it.
Congratulations!
You're done - you now have a fully functional FreePBX
Installation. The first thing to do is log in (Go to the IP address of
the Ubuntu machine above, and click on 'Setup'). The default username
is 'admin' and the default password is 'admin'. Go to the
'Administrators' tab and change the password straight away. After that,
you can visit the Online Module Repository and see what modules are
available.
Placeholder until more detailed instructions can be written
For now, see UbuntuServer
Upgrading FreePBX
Note: You may need to install subversion for your linux distribution if you have any errors. Do this by typing yum -y install subversion at the root prompt.
Upgrading to the latest Released Version: 2.4.0
You will want to pull the release tarball, and follow the instructions below. Once you have installed it you will want to navigate to Module Admin menu item and update all modules as well as install other available modules not included in the release tarball.
cd /usr/src/ wget http://mirror.freepbx.org/freepbx-2.4.0.tar.gz tar zxvf freepbx-2.4.0.tar.gz cd freepbx-2.4.0 ./start_asterisk start # for upgrades use: ./amportal start ./install_amp
On some rare cases you may experience an issue with the SQL database not being correctly updated. If that appears to be the case, you can safely add the --force-version option. For example, if you were upgrading from version 2.1.3 you might type:
cd /usr/src/freepbx-2.4.0 ./install_amp --force-version=2.1.3
(Replace 2.1.3 with the version you are upgrading from, or an earlier version which is also safe)
Upgrading to the latest stable 2.4 branch from SVN
If you prefer to pull directly from the SVN repository you can follow these instructions below. Once you have installed FreePBX it is important to navigate to Module Admin in FreePBX and upgrade your modules. Installing FreePBX in this way (vs. using the release tarball) is not recommended for initial installs unless you are very familiar with the project. Without loading critical modules like core, framework, voicemail and some others your system will not be able to do anything for you or will function improperly.
cd /usr/src/ svn co http://svn.freepbx.org/freepbx/branches/2.4 freepbx-2.4
Installation instructions are the same as above after exploding the tarball
Upgrading to the trunk branch
The trunk is where active development happens. The project tries hard to keep it relatively stable but it is a dynamic place a times. This differs from release branches where they are limited to the latest bug fixes. You can access the development trunk as described below.
cd /usr/src/ svn co http://svn.freepbx.org/freepbx/trunk freepbx-trunk
Note: this code is under active development, and may be broken at times. However, there's usually new things in SVN that you may want to play with. Also, when you're using SVN, you must specify the last 'released' version you were using. This ensures that the database layout is up to date. You do this with the command:
cd /usr/src/freepbx-trunk ./install_amp --force-version=2.1.3
(Replace 2.1.3 with the version you are upgrading from)
Changing the URL from a previously checked SVN checkout
You may already have already performed an svn co from the repository and when you now try to access the repository (e.g. doing an svn update) it no longer works because the URL has been changed from some of the recent SVN changes. You can simply change the URL to point to the new repository location with the following instructions:
svn switch --relocate https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.3 http://svn.freepbx.org/freepbx/branches/2.3
This is a book-style Wiki (or a Wiki-style book) that will become complete Administrators Guide to FreePBX.
To help, add a child page to this page, writing a section for each of the major items in the rough outline.
Pick whatever you like. If it's not one of the categories below, or belong to them, think carefully if it belongs here at all. It may be more useful someplace else.
Rough outline:
Installation
Administration
A PBX without any extensions isn't very useful, so it's the first thing to do after installing FreePBX. Extensions let you test all kinds of things, so it's the first thing to get right.
Shown at right are a few test extensions on a FreePBX installation on my t42 Ubuntu laptop.
There are several pages of information here. We'll go through each of them.
Display Name: This is the name that is used, at least internally, when placing an outbound call. Most Caller Name services look up the name in a database, so this name setting might do nothing on your outbound VOIP or PRI calls. It will certainly do nothing on outbound POTS calls.
CID Num Alias: The CallerID to show when dialing intracompany. Example Usage: James has a office extension at 201, a softphone at 401, a home office phone at 601, and a FollowMe at 201 that rings them all. 401 and 601 can use a CID Num Alias of 201, so that all internal call recipients see “201”
SIP Alias: Every 'clever' presentation of VOIP has an example of dialing by email address. This is hard to do on most phones, but is nonetheless supported. Put only the name here, not the @ symbol or the fully-qualified-domain name. That's used by the calling application or device to locate your PBX on the internet. To allow any party to call you, you'll need to have firewall rules that allow all SIP calls regardless of IP address. This is only advisable if your Asterisk installation is up-to-date, and has no current SIP security vulnerability.
Direct DID: This is where you enter the Direct Inward Dial (DID) you'd like to reach this extension. If you forget, all calls to that DID will end up at the main IVR. Putting a value here eliminates the need to create an Inbound Route.
DID Alert Info: Used for distinctive ring services
Music on Hold: Set a different Music On Hold (MOH) class for this extension. Great for having different music for different offices or companies that are served by the same PBX.
Outbound CID: Put the CallerID and preferred CallerIDName here for outbound usage.
Ring Time: How long to ring before a server-side transfer to voicemail. You'll usually use the default here, and set a system-wide value in General Settings.
Call Waiting: Set the call waiting value. Also accessible by feature code from an individual extension (by default *70 to activate and *71 to deactivate – see Feature Codes).
Emergency CID: The CallerID to be set when dialing a number labeled as emergency.
Extensions - Device Options
These options are the same as in a vanilla asterisk sip.conf file. In a FreePBX installation, they end up in sip_additional.conf. For more information, check out Asterisk: TFOT.
secret: The SIP password used in the authentication of this device to the server.
dtmfmode: How DTMF is expected by the server. Options are rfc2833, INFO, and in-band. rfc2833 seems the most reliable across many devices. Client devices (e.g. Linksys) often have an Auto setting, which is to be avoided.
canreinvite: Asterisk is a back-to-back useragent. This means that your phone calls it, and it calls your VOIP, PRI or POTs line. All audio (RTP stream) is carried through the Asterisk process during the call. Your VOIP service provider, for example, often will use a SIP REINVITE message to change the RTP destinations after the call is set up. This reduces load on the equipment, as it's only doing call setup and takedown.
Highly desireable if you're supporting remote users making VOIP calls and your VOIP provider supports REINVITE.
However, it's tricky to get any of your FreePBX features to work in this scenario. Play with this, but don't use it on a customer system unless you have tested the features you need.
context: Context is an Asterisk dialplan sphere-of-influence concept used to separate components from each other (multi-tenant, for example, or outward facing customer service from backoffice).
From-internal means you can dial like you're a phone on premesis with access to other extensions and outbound trunks. Other common options are outbound-all-routes (dial out only), from-trunk (extensions only, no outbound dialing)
host: dynamic or a static IP address. dynamic allows any device that can pass the SIP challenge/authentication to register and make/receive calls.
type: friend or peer. Use friend for a phone. Peer is for SIP devices that are capable of carrying calls, like a Trunk.
nat: yes or never. SIP is a nat-unfriendly protocol in that it specifies the return IP address for the call audio stream deep inside a packet. NAT works by rewriting packet source and destination IP addresses, but doesn't understand SIP (unless a good SIP Application Layer Gateway is installed). NAT is therefore problem if both the phone and the server PBX are separated from the public internet by different NATs (e.g. a home router and and corporate one.) In such a situation, audio won't work, but signaling will (phones will ring but no audio). To support remote home users behind conventional NATs, use yes, and either give the server PBX a public IP address or do a 1:1 IP mapping from a public IP to it's internal, then set IP_nat.conf to the public IP address of the system. NAT=yes instructs Asterisk to send audio to the IP it receives it from, regardless of what the SIP SDP says, and lets you have at least one NAT present and still have effective audio. Note that NATs vary widely as to how long they stay 'open'. Best practice when using Non-STUN phones is to have SIP registration expire every 60 seconds – the re-registration (outbound, by the phone) will keep the NAT open to receive calls. NAT=yes doesn't hurt anything when the client device is on the same LAN.
disallow: enter codec overrides here. An extension or group of extensions on a low-bandwidth link might want to disallow the higher-bandwidth codecs out of the general pool.
allow: enter any codc overrides here
dial: SIP/extension is the default.
accountcode: enter an account code for use by a billing module.
mailbox: extension@default is the default.
General commands
!<command>: Executes a given shell command
abort halt: Cancel a running halt
add extension: Add new extension into context
add ignorepat: Add new ignore pattern
add indication: Add the given indication to the country
amportal start: Stop AAH and
amportal stop: Restart AAH.
debug channel: Enable debugging on a channel
dont include: Remove a specified include from context
help: Display help list, or specific help on a command
include context: Include context in other context
load: Load a dynamic module by name
logger reload: Reopen log files. Use after rotating the log files.
no debug channel: Disable debugging on a channel
pri debug span: Enables PRI debugging on a span
pri intense debug span: Enables REALLY INTENSE PRI debugging
pri no debug span: Disables PRI debugging on a span
remove extension: Remove a specified extension
remove ignorepat: Remove ignore pattern from context
remove indication: Remove the given indication from the country
save dialplan: Overwrites your current
extensions.conf file with an exported version based on the current
state of the dialplan. A backup copy of your old extensions.conf is not
saved. The initial values of global variables defined in the [globals]
category retain their previous initial values; the current values of
global variables are not written into the new extensions.conf. Using
"save dialplan" will result in losing any comments in your current
extensions.conf.
set verbose: Set level of verboseness
show agents: Show status of agents
show applications: Shows registered applications
show application: Describe a specific application
show channel: Display information on a specific channel
show channels: Display information on channels
show codecs: Display information on codecs
show conferences: Show status of conferences
show dialplan: Show dialplan
show image formats: Displays image formats
show indications: - Show a list of all country/indications
show locals: Show status of local channels
show manager command: Show manager commands
show manager connect: Show connected manager users
show parkedcalls: Lists parked calls
show queues: Show status of queues
show switches: Show alternative switches
show translation: Display translation matrix
show voicemail users: List defined voicemail boxes
show voicemail zones: List zone message formats
soft hangup: Request a hangup on a given channel
A.2.2 AGI Commands
show agi: Show AGI commands or specific help
dump agihtml: Dumps a list of agi command in html format
A.2.3 Database Handling
database del: Removes database key/value
database deltree: Removes database keytree/values
database get: Gets database value
database put: Adds/updates database value
database show: Shows database contents
A.2.4 IAX Channel Commands
iax2 debug: Enable IAX debugging
iax2 no debug: Disable IAX debugging
iax2 set jitter: Sets IAX jitter buffer
iax2 show cache: Display IAX cached dialplan
iax2 show channels: Show active IAX channels
iax2 show peers: Show defined IAX peers
iax2 show registry: Show IAX registration status
iax2 show stats: Display IAX statistics
iax2 show users: Show defined IAX users
iax2 trunk debug: Request IAX trunk debug
iax debug: Enable IAX debugging
iax no debug: Disable IAX debugging
iax set jitter: Sets IAX jitter buffer
iax show cache: Display IAX cached dialplan
iax show channels: Show active IAX channels
iax show peers: Show defined IAX peers
iax show registry: Show IAX registration status
iax show stats: Display IAX statistics
iax show users: Show defined IAX users
init keys: Initialize RSA key passcodes
show keys: Displays RSA key information
A.2.5 SIP Channel commands
sip debug: Enable SIP debugging
sip no debug: Disable SIP debugging
sip reload: Reload sip.conf (added after 0.7.1 on 2004-01-23)
sip show channels: Show active SIP channels
sip show channel: Show detailed SIP channel info
sip show inuse: List all inuse/limit
sip show peers: Show defined SIP peers (register clients)
sip show registry: Show SIP registration status (when Asterisk registers as a client to a SIP Proxy)
sip show users: Show defined SIP users
A.2.6 Server management
restart gracefully: Restart Asterisk gracefully
restart now: Restart Asterisk immediately
restart when convenient: Restart Asterisk at empty call volume
reload: Reload configuration
stop gracefully: Gracefully shut down Asterisk
stop now: Shut down Asterisk immediately
stop when convenient: Shut down Asterisk at empty call volume
extensions reload?: Reload extensions ONLY
unload: Unload a dynamic module by name
show modules: List modules and info about them
show uptime: Show uptime information
show version: Display Asterisk version info
There may be a time when you want to interconnect 2 Asterisks boxes
(def.com.au and xyz.com.au) together and if you are like me, you will
probably be spending a good part of 3 hours trying to get them to talk
to one another.
I have 2 different locations, the Main Office (def.com.au) with
about 11 extensions and another office in a different location
(xyz.com.au) about 20 km away with 9 extensions. The main office is the
only box that will have accounts with different VSPs and all external
communications are through the main office Asterisk box. I settled for
the simplest solution and after some fiddling around I managed to get
them to work the way I wanted it but not happy with it, I solicited
some advise from a friend (thanks to Mark Brooker) who told me that my
configuration could be made a lot tidier. That I did.
Instead of being verbose in my explanation, I will just create a
few tables outlining what I did. I hope this will help those in the
same position as I am, to set 2 very basic systems together (you can
refer to DUNDi for a more complete solution).
27.1 METHOD 1 - with the peer Asterisk boxes as extensions
For the purpose of registering the peers to each other, I created
1 extension on each box eg: 90000 on System 1 and 91000 on System 2–
using extension numbers that I am not likely to use as local extensions
(while some users have had success using common extension, but I prefer
2 separate extensions as I have them working). For simplicity, I gave a
common password xxxyyy to both boxes. Avoid using extension starting
with 8 as it may clash with conferencing.
System 1
System 2
IAX Trunk
Outgoing Dial Rules:
XX.
XX.
Trunk Name
Parramatta
MainOffice
Peer Details
host=xyz.com.au (or IP)
secret=xxxyyy
type=peer
username=91000
host=def.com.au (or IP)
secret=xxxyyy
type=peer
username=90000
User Context
Leave blank
Leave blank
User Details
Leave blank
Leave blank
Register String
80000:xxxyyy@xyz.com.au
90000:xxxyyy@def.com.au
Note: Registration isn’t really necessary. It will still work without it unless you use Dynamic IP.
System 1
System 2
Extensions
Phone Protocol
IAX
IAX
Extension Number
90000
91000
Extension Password
xxxyyy
xxxyyy
Fullname
Parramatta
Main Office
Voicemail & Directory
Disabled
Disabled
System 1
System 2
Outbound Routing
Route Name
Parramatta
MainOffice
Route Password
Leave Blank
Leave Blank
Dial Patterns
6XXX(6001 to 6009 are Parramatta Office extensions)
XX.(Apart from Local extensions, all others go via City Office)
Trunk Sequence
IAX2/Parramatta
IAX2/MainOffice
The above Outbound Routing rule assumes that you do not wish to use
a dialling prefix. If you want to use a prefix to dial the remote
extensions and to use the remote routing rules, you may place a prefix
e.g. 9|6XXX and 9|XX. for system 1 and system 2 respectively instead of just 6XXX and XX.
The above example assumes that both Asterisk boxes have Public Fix
IP address. If you have Dynamic IP addresses, you will need to register
both the boxes with DynDns to obtain a valid DNS ID. If you are a part
of a Corporate LAN, than you will have no need to worry about DynDns
and what not.
Note: While this method will provide some
rudimentary security (though pretty weak), as it requires an extension
to be created for the peer Asterisk box, it will not pass the calling
party extension number to the remote Asterisk box. Instead, it will
pass the Trunk ID only and all calls will seem to come from the same
trunk and not individual extension – I did say that this is a simple
solution.
27.2 METHOD 2 - In a Peer/User arrangement
Another method that I use is described below. This method treats
both the Asterisk box as internal to each other as peer and user. I am
using IAX2 for this purpose, however I believe, you may be able to do
this with SIP as well if you are trying to connect the older Asterisk
with the newer incarnations (I have not proved it yet). This method
does not require registration either and does not require you to create
extensions for the peers. In many ways, this is simpler to set up.
Unlike the first method, this second method will pass the Caller ID
to the receiving party. The receiving party will actually get the
callers’ extension number/ID instead of the extension number of the
peer Asterisk box.
Note: You must provide for security, as this is pretty wide open.
Like all installation, you must provide for security. As different
installation resorts to different types of security arrangement, I will
leave that to the individual implementer to deal with the security
issues.
(Note: A little tutorial on DUNDi can be found here).
Rather than being verbose, I will illustrate this method using tables as follows;
System 1
System 2
IAX2 Trunk
Outgoing Dial Rules:
6XXX
XX.
Trunk Name
InterOffice
InterOffice
Peer Details
host=xyz.com.au (or IP)
Qualify=yes
type=peer
host=def.com.au (or IP)
Qualify=yes
type=peer
User Context
InterOffice-In
InterOffice-In
User Details
context=from-internal
host=xyz.com.au (or IP)
type=user
context=from-internal
host=def.com.au (or IP)
type=user
System 1
System 2
Outbound Routing
Route Name
InterOffice
InterOffice
Route Password
Leave Blank
Leave Blank
Dial Patterns
6XXX(6001 to 6009 are Parramatta Office extensions)
XX.(Apart from Local extensions, all others go via City Office)
Trunk Sequence
IAX2/InterOffice
IAX2/InterOffice
Thinking of more than 2 boxes?
Just as a matter of interest, you can connect several boxes using
this method. While I have connected 3 boxes successfully,I believe, se
same principle can be applied to more boxes.
In my implementation I have box A, B and C (System 1, 2 and 3). Box
A is the master box. All the other boxes use box A as the main
exchange.
A peers with B and C - B peers with A - And C peers with A.
Except for local traffic, all external and inter-office
(inter-branch) traffic goes via Box A. – with the appropriate dial plan
of course.
Both the above methods, while useable for a basic configuration,
will not provide you with a complete solution. To provide a complete
solution is beyond the scope of this document.
The following link will provide further reference for connecting two Asterisk boxes together http://www.voip-info.org/wiki/view/Asterisk+dual+servers
If you require a complete solution tailored to your exact requirement, my advise to you is to hire a VOIP consultant.
Creating Administrator Roles
For most web applications it is useful to have graduated
permission access, so that users have only access to the functions
they need.
This lets you give office managers, for example, access to the
Extensions directory to change usernames and reset voicemail
passwords as employees come and go, without exposing trunks and other
settings they do not need.
Show below is just such a configuration. In this case, Mie is
allowed to see status, edit extensions (this part is not shown) and
apply changes.
In addition to the webapp username / password settings, both
Apache and iptables can be used to restrict access on a location
basis to the web application.
A good policy is to only allow local (LAN) or tunneled via SSH
access to the web application, though exceptions can be be made for
the Recordings (ARI) interface.
The 'Digital Receptionist' page is the interface used to setup your auto attendant when people call your PBX. Normally heard as "Thanks you for calling MYBUSINESS, for Sales press 1, for Service press 2", etc.
While the urge is strong just to dive in by clicking on IVR, you should resist this impulse.
First, draw out on paper what you intend to to achieve. Run it by the customer (or your officemates). Write out word-for-word what all the recordings are going to be.
The proper flow to build a good IVR is:
Planning
Customer agreement with the plan.
Record the audio prompts using System Recordings and an extension.
Create any destinations that don't currently exist (queues, ring groups, day/night modes or time conditions).
Test all of these. One way to do this is use miscellaneous destinations, assigning a * feature code to whatever thing you want to test.
Then go create your IVR.
Show it to the customer, and then make the inevitable changes.
Now upgrade the voice prompts to a paid voice or designated employee (the office manager or receptionist, etc.)
Bask in glory!
Standard IVR Examples:
Office / Light industrial
Welcome to BUSINESSNAME. Please listen carefully as our options have changed. If you know the extension of the person you are trying to reach, you may dial it at any time. Press 1 for sales, press 2 for customer service, press 3 for administration, press 4 for Press inquiries, press 5 for office directions,press # to access the company directory, or press 0 for the operator.
Hospitality
Welcome to HOTELNAME. Please listen carefully as our options have changed. If you know the room # of the guest you are trying to reach, you may dial it at any time. Press 1 for reservations, press 2 for the front desk, press 3 for event sales, press 4 for hotel administration, press 5 for hotel directions, press # to access the hotel directory, or press 0 for the operator.
Engineering/Product Company with Direct Sales and Support
Welcome to BUSINESSNAME. Please listen carefully as our options have changed. If you know the extension of the person you are trying to reach, you may dial it at any time. Press 1 for sales, press 2 for customer service, press 3 for technical support, press 4 for administration, press 5 for Press inquiries, press 6 for office directions, press # to access the company directory, or press 0 for the operator.
Retail
Welcome to BUSINESSNAME. Please listen carefully as our options have changed. If you know the extension of the person you are trying to reach, you may dial it at any time. Press 1 for sales, press 2 for customer service, press 3 for store hours, locations, and directions, press 4 for administration, press 5 for Press inquiries, press # to access the company directory, or press 0 for the operator.
Fire up the System Recordings module. Shown here is 3.3.5.1.
I strongly suggest you use an extension connected to the PBX to make your recordings. They'll be quick and in the right format and you can worry about getting everything else right. When everything is all finished, you can come back and replace those temporary recordings with paid or improved versions.
To use your extension to make a recording, enter your extension in Step 1 and press Go. Don't skip this and go to Step 2, or you'll get a cryptic error.
Now dial *77 and make your recording after the beep. Dial *99 to listen to it. You don't have to be the person doing this – I often enter a customer's extension and have a customer do this part while I do the GUI work.
If the recording is good enough (and don't obsess here yet), name the recording and press Save.
For lame and silly reasons, spaces are not allowed in the names.
You can listen to your recording and add on other recordings (such as the built-in recordings) by clicking on your recording in the right tool panel.
We're going to start with a simple 1-level IVR , so the single Welcome-to-ACME recording will be enough.
Now that we've created a system recording, we can create our IVR.
When you select IVR, the first page is now a brief set of instructions on how to drive the IVR. You can either edit an IVR, if one is existing, or create a new one by clicking on 'Add IVR'.
Unlike the old Digital Receptionist system, this creates the IVR (and calls it 'Unnamed') as soon as you click 'Add' - You'll see it appear on the right straight away.
These are your options:
Change Name: This is simply the descriptive name that appears on the right, and in the drop-down menu of Destinations
Timeout: This is the amount of time the system waits before sending the call to the 't' destination
Enable Directory: If you switch this on, users will be able to dial the FeatureCodes">feature code for Directory, usually #, from the IVR and access the Directory service.
Directory Context: This is the asterisk context of the directory. Advanced users can then use different IVRs to create a multi-tenant installation.
Enable Direct Dial: If you enable that, users will, in addition to being able to dial the IVR options, be able to directly dial an Extension number.
Announcement: A System Recording that is played to users when they enter the IVR. This can be set to 'nothing'. These announcements are great for “today is July 4th and we're closed for the holiday” and then proceeding on to the regular call flow.
In the box on the left, enter the option for the user. This may be one, or a series of numbers, or, 'i', or 't'. 'i' and 't' have special meanings:
i: This overrides the default invalid choice behavior, which is to play a 'invalid option' message and immediately replay the current menu. E.G. If you only have 1 2 and 3 defined, and caller pushes 4, it will jump to this destination.
t: This overrides the default timeout behavior, which is to play the menu three times and hangup. A standard configuration is to go the operator, to handle customers that don't have DTMF-capable phones.
Options are only displayed if there is at least one entry created.
For example, queues will not appear as a possible IVR destination if
no queues exist.
Use 'Increase Options' or 'Decrease Options'
to alter the number of options available. This won't let you decrease
it to less than the number of options that are currently set.
To
delete an option, simply leave the selection blank.
When
you're finished, click 'Save' and you have your new IVR.
To test it, give it an incoming route or set up a miscellaneous application (* code) to reach it.
Creating and Assigning Extensions
Numbering Schemes
There are several schemes for assigning extensions. Invariably, though, you'll find the following guidlines will help:
Remember, when reserving DIDs, to get the whole block of interest if possible. It's usually low enough cost, and it really hurts to run out.
Add child pages to enter hardware examples here.
Make sure and note what call levels (and conferences, etc.) the system acheives.
For those using the sounds that come with asterisk, you'll know that
volume and timing can be a bit wonky sometimes, and the quality isn't
all that great, due to them only being in GSM format. Kristian
Kielhofner of astLinux has come to the rescue by paying, out of his own pocket, to have all of the asterisk sounds re-recorded, and has released them under the BSD-License for all to use.
Here are the links to the files:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9.1 DIGIUM WILDCARD X100P FXO PCI CARD
This card allows you to connect a POTS (plain Old Telephone
System) line to your Asterisk@Home box (See Notes for Patch
information).
If this card is added after Asterisk has been configured, it may be
necessary to configure it by using the zaptel card auto-config utility
so the correct zaptel driver will be set up. To do that, enter the
following from the command line.
rebuild_zaptel (restart after each command)
genzaptelconf (see notes re command switch)
Next go into the AMP web interface to create a trunk and you will
notice that there is already a trunk called ZAP/g0. You need to edit
this.
Once the card is configured, you must add a route for Incoming Calls or asterisk will not answer this line
Click on Incoming Calls in AMP and set up an incoming route. To
make outbound calls you will need to set an outbound route as well.
If you have this card installed, you will need to edit the
following files; zapata.conf, zaptel.conf and modules.conf for AAH 1.x
or modprobe.conf for AAH 2.x. The last 2 files live in the /etc
directory – use a text editor to edit them.
9.1.1 zapata.conf
Under [channels] edit the following lines:
[channels]
busydetect=yes
busycount=6
For my installation to function correctly, I have also changed the
following setting to obtain a good compromise on volume/echoing:
rxgain=10.0 (you may have to experiment a little with this setting)
txgain=8.0 (you may have to experiment a little with this setting)
Ensure the following exist in zapata.conf. It is located at the end of the file.
;Include AMP Configs
channel => 1
#include zapata_additional.conf
Leave the rest of the file as it is.
9.1.2 zaptel.conf
Change the loadzone and defaultzone to 'au'
# Global data
loadzone = au
defaultzone = au
9.1.3 modules.conf (modprobe.conf for AAH 2.x)
For AAH 1.x, locate the post-install wcfxo entry and edit it to reflect this:
post-install wcfxo /sbin/ztcfg opermode=AUSTRALIA
For AAH 2.x, add the line highlighted in Bold below:
.
alias char-major-196 torisa
options wcfxo opermode=AUSTRALIA ; add this line
install tor2 /sbin/modprobe --ignore-install tor2 && /sbin/ztcfg
.
9.2 DIGIUM TDM400P FXO/FXS CARD
Like the Digium Wildcard X100P, this card allows you to connect a
POTS (plain Old Telephone System) line to your Asterisk@Home box.
Unlike the X100P, this card has 4 module ports that can be loaded with
FXS or FXO modules. Channel 1 is the top RJ-45 on the back of the
TDM400P card.
If this card is installed after Asterisk has been loaded, you will
need to configure it just like the X100P by using the following command
on the command line:
genzaptelconf
9.2.1 zapata-auto.conf
Next, using config edit, look in the zapata-auto.conf file and you
will see a list of all your channels in your TDM400P. Set up the trunks
as trunks and the extensions as extensions in AMP.
When you open the zapata_auto.conf file, it will look something like the illustration below (see the red highlight)
zapata-auto.conf
; Span 1: WCTDM/0 'Wildcard TDM400P REV E/F Board 1'
signaling=fxo_ks
; Note - this is an extension. Create a ZAP extension in AMP for Channel 1
channel => 1 < - -this would have been defined already by the config
signaling=fxs_ks
;Note - this is a trunk. Create a ZAP trunk in AMP for Channel 2
context=from-pstnchannel => 2 < - -this would have been defined already by the config
If in the illustration it shows channel 1 is your Zap extension
then add a zap extension for channel 1 in AMP and if it shows your Zap
trunk is channel 2 you should create a zap trunk for channel 2 in AMP.
Once this is done, reboot your PC and when Asterisk starts, use AMP
to add a route for incoming calls or asterisk will not answer your
trunk. Similarly, to make outbound calls you will need an outbound
route. Set them up as per setting up routes in the earlier chapters of
this document.
If you have this card installed, you will need to edit the
following files; zapata.conf and zaptel.conf as per the X100P card in
the previous section.
9.2.2 modules.conf (modprobe.conf for AAH 2.x)
You will need to edit the modules.conf, or modprobe.conf to add the necessary option for usage in Australia.
The example below is for AAH 1.x. where you need to add the following line;
options wctdm opermode=AUSTRALIA fxshonormode=1 bootstringer=1
Your modules.conf (AAH 1.x) should look like the example below:
alias eth0 e100
alias sound-slot-0 es1370
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :
alias usb-controller usb-uhci
alias char-major-196 torisa
options wctdm opermode=AUSTRALIA fxshonormode=1 boostringer=1
options torisa base=0xd0000
post-install tor2 /sbin/ztcfg
post-install torisa /sbin/ztcfg
post-install wcusb /sbin/ztcfg
post-install wcfxo /sbin/ztcfg
post-install wctdm /sbin/ztcfg
post-install ztdynamic /sbin/ztcfg
You will only need to add the line in red. Do not change anything else.
Or, in AAH Ver.2.1, you may also do the following:
Locate the line 'install wctdm /sbin/ztcfg-- --ignore-install wctdm
&& /sbin/ztcfg' and edit it to reflect the following:
install wctdm opermode=AUSTRALIA fxshonormode=1 boostringer=1 /sbin/ztcfg-- --ignore-install wctdm && /sbin/ztcfg
Note: as of Zaptel
Drivers 1.2.4, by selecting opermode=AUSTRALIA the zaptel drivers
automatically add the 'boostringer=1 , fxshonormode=1'
Also see Appendix E.3 (Users Suggestions)
9.3 REBUILDING ZAPTEL DRIVER
Every time there is a kernel update with yum (which is the case
with Asterisk and CentOS), ZAP device support needs to be rebuilt using
the new kernel. Unfortunately, this will cause a slight problem as
RedHat bug caused the rebuilding process to fail.
The following is the fix - source Nerd Vittles http://nerdvittles.com/index.php?p=123
Log into your new server as root and issue the following commands:
cd /usr/src/kernels/2.6.9-34.EL-i686/ include/linux
mv spinlock.h spinlock.h.old
wget http://nerdvittles.com/aah27/spinlock.h
Once the file has been retrieved, reboot using the following command:
shutdown -r now
When the reboot completes, you can start rebuilding the support for
your ZAP devices or for that matter, ztdummy if you don’t have any ZAP
devices.
Log in as root and type the following command:
rebuild_zaptel
Then reboot your system:
shutdown -r now
Now log in as root again and enter the following command:
amportal stop
genzaptelconf
Reboot once again:
shutdown -r now
..and you're done.
(See also user Users’ Suggestions)
9.4 SIPURA SPA3000 AS A PSTN INTERFACE
To those new to the SPA3000, there is a simplified installation
and configuration instruction by JMG Technology. While it is directed
mainly at standalone ATA users, it gives a good insight of the Sipura
SPA3000’s capabilities.
I have come across a few people in the various forums wanting to
use their Sipura SPA-3000s as FXO front-end to their Asterisk@Home
boxes. To help them in their endeavours, I've put the following
together, as no one single source of information that I've found so far
has a config that would actually work for me.
9.4.1 Log in to SPA3000
Login to your SPA-3000 as admin/advanced.
Before you change anything, I'd suggest taking a snapshot (i.e.
just save the .html page) of your current SPA-3000 configuration, just
in case you ever need to refer back to your own customisations.
If you're not already running the latest SPA-3000 firmware, then
upgrade it to the latest version (at the time of writing, it's 3.1.5a).
Take another snapshot for good measure. Nothing should have changed in
your settings, except that you have a few extra options that you didn't
have before.
Now reset SPA-3000 back to factory defaults, because I'm only going
to list the minimum changes required to keep things simple. Take
another snapshot now too, in case you ever want to know what the
defaults were.
9.4.2 Change the settings
System tab
DHCP: No
Static IP: something on your local subnet e.g.; 192.168.1.200
NetMask: 255.255.255.0
Gateway: your router's IP address e.g.; 192.168.1.254
Primary DNS: your ISP's primary DNS address e.g.; 203.12.160.35
Secondary DNS: your ISP's secondary DNS address e.g.; 203.12.160.36
Regional tab
Dial Tone: 400@-19,425@-19;10(*/0/1+2)
Busy Tone: 425@-10;10(.4/.4/1)
Reorder Tone: 425@-10;10(.2/.2/1)
Ring Back Tone: 400@-19,425@-19,450@-19;*(.4/.2/1+2+3,.4/.2/1+2+3,0/2/0)
Ring 1 Cadence: 60(1.5/3.4)
Ring 3 Cadence:
60(1.5/3.4,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2)
CWT8 Cadence: 30(.2/.2,.2/4.4)
Hook Flash Timer Min: .07
Hook Flash Timer Max: .13
Delete all the Vertical Service Activation Codes.
FXS Port Impedance: 220+820||120nF
Line 1 tab
Proxy: IP address of your Asterisk box e.g.; 192.168.1.234
Register Expires: 60
Display Name: Whatever
User ID: Asterisk extension number e.g.; 200
Password: password for that extension
Silence Threshold: medium
DTMF Tx Method: INFO
Hook Flash Tx Method: INFO
Dial Plan: (*xx|000|0011xxxxxxxxxxx.|0[23478]xxxxxxxx|09xxxxxx|1100
|122[135]|1222xxxxxxx|12510[12]|12554|1[38]00xxxxxx|13[1-9]xxx
|1747xxxxxxx|2xx|393xxxxxx|3xxxx. |[4689]xxxxxxx|7777|899060xxxxx.) for
example
(*xx.|x.) will work, but I like to do a bit of sanity checking, etc.
PSTN Line tab (method 1)
Proxy: IP address of your Asterisk box e.g.; 192.168.1.234
Register: no
Make Call Without Reg: yes
Ans Call Without Reg: yes
Display Name: No name
User ID: PSTN
Password: password
Silence Supp Enable: no
Echo Canc Enable: no
Echo Canc Adapt Enable: no
Echo Supp Enable: no
FAX CED Detect Enable: yes
FAX CNG Detect Enable: yes
FAX Passthru Codec: G711u
FAX Codec Symmetric: no
FAX Passthru Method: None
DTMF Tx Method: INFO
FAX Process NSE: no
Dial Plan 1: (S0<:T0298765432>) for example
VoIP Caller Default DP: none
PSTN Ring Thru Line 1: no
PSTN CID For VoIP CID: yes
PSTN Answer Delay: 2
PSTN Ring Thru Delay: 3
PSTN Ring Timeout: 4
PSTN Hook Flash Len: .1
Disconnect Tone: 425@-30,425@-30;1(.375/.375/1+2)
FXO Port Impedance: 220+820||120nF
On-Hook Speed: 26ms (Australia)
(Source reference: Colin Swan)
Or alternatively you may want to adopt the second method for the PSTN Line Tab, which I am currently using.
PSTN Line tab (method 2)
Proxy: IP address of your Asterisk box e.g.; 192.168.1.234
Register: no
Make Call Without Reg: yes
Ans Call Without Reg: yes
Display Name: No name
User ID: PSTN
Password: password
Silence Supp Enable: no
Echo Canc Enable: no
Echo Canc Adapt Enable: no
Echo Supp Enable: no
FAX CED Detect Enable: yes
FAX CNG Detect Enable: yes
FAX Passthru Codec: G711u
FAX Codec Symmetric: no
FAX Passthru Method: None
DTMF Tx Method: INFO
FAX Process NSE: no
Dial Plan 1: (S0<:s@YourAsteriskIP>) e.g. (S0<:s@192.168.0.101:5060>)or try w/o the port designation
VoIP Caller Default DP: none
PSTN Ring Thru Line 1: no
PSTN CID For VoIP CID: yes
PSTN Answer Delay: 2
PSTN Ring Thru Delay: 3
PSTN Ring Timeout: 4
PSTN Hook Flash Len: .1
Disconnect Tone: 425@-30,425@-30;1(.375/.375/1+2)
FXO Port Impedance: 220+820||120nF
On-Hook Speed: 26ms (Australia)
Using this alternative method, you will not need to create an
Inbound Route for this channel as the call is sent directly to your “s‿
extension as defined in your incoming call setting. You may also get
CLID if your Telco has activated incoming Caller ID on your phone.
User 1 tab
Default Ring: 3
Default CWT: 8
9.4.3 Add SIP Trunk
Then in AMP, add a SIP trunk.
Outbound Caller ID: <0298765432> (for example)
Maximum Channels: 1
Dial Rules: 0+NXXXXXXXX (for example)
0011+ZXXXXXXXXXX.
Trunk Name: telstra (for example)
Peer Details:
canreinvite=no
context=from-pstn
host=the IP address of your SPA-3000 (for example; 192.168.1.200)
insecure=very
nat=no
port=5061 (for example)
qualify=yes
secret=password
type=peer
username=PSTN
User Context: telstra-incoming (for example)
User Details:
canreinvite=no
context=from-pstn
host=the IP address of your SPA-3000 (for example; 192.168.1.200)
insecure=very
nat=no
port=5061 for example
secret=password
type=user
username=PSTN
Leave "Register String" empty
Then add a DID Route of T0298765432 (for example), which goes to your chosen Destination. (Source reference: Colin Swan)
See the alternative configuration that I am currently using for the PSTN Tab in Notes