Documentation

FreePBX documentation

Organization

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

Getting Started

This guide is meant for people brand new to open source IP telephony.

Contents:

  1. Parts of a FreePBX System
  2. Typical setups

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:

  1. Voip-info wiki - Contains a lot of documentation about VoIP in general, as well as many Asterisk-specific things.
  2. Asterisk Primer

Parts of a FreePBX System

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).

  1. IP Phones: IP phones are by far the best way to go when setting up a FreePBX-based system. They typically offer programmable buttons that make using various features easy (compared to dialing star codes, like *57). Most have multiple lines, which allow you to very easily manage more than one call to your extension. There are many manufacturers that make IP phones, and many many models that range in price from $80 up to $500. Within a single deployment, it's good to standardize on one line of products simply for end user ease-of-use, but of course you can mix and match all you like.
  2. Analog Phones: Analog phones are the regular phones that you can plug into your phone line at home and just use. There are many ways to connect these to a FreePBX system. There are several manufacturers (such as Digium, Pika, Rhino, and Sangoma) that make PCI cards that will interface with Asterisk. These provide "fxs ports" which you can plug an analog phone into. Asterisk talks directly to these devices at the hardware level.

    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.

  3. Softphones: This is software that you install on to your PC, that talks SIP or IAX2 back to Asterisk, and appears just like any other IP phone. You need a microphone and speakers of some sort (headset, usb device) to actually use it to place calls. There are many different softphones available for most platforms. They are useful for testing and connectivity while on the road (eg, on a laptop), but most people do not use them as a primary device because you're relying on a PC working, being turned on, user logged in, etc.
  4. Legacy adapters: There are products on the market that allow you to connect existing legacy PBX phones to an Asterisk system, typically using SIP over ethernet.

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:

  1. POTS: Plain old telephone service. This is the type you have at home, it is an analog service and (in North America) is provided to you via an RJ11 jack. This supports one call (one channel) at a time, and is the most basic service. Generally each POTS line gets its own public phone number.
  2. PRI: Primary Rate Interface. This is a digital line that carries 23 64kbps voice (B) channels, and one 64kbps signaling (D) channel used for call setup, caller id, etc. You can have zero up to hundreds of incoming DIDs ("direct inward dial" - an old telephony term that refers to a public phone number) on a PRI. It is the best interface to use when dealing with several lines.
  3. ISDN BRI: Basic Rate Interface. This is a digital line carrying two 64kbps voice (B) channels and one 16kbps signaling (D) channel. It is not widely used with Asterisk systems (mostly due to the high price compared to POTS).
  4. T1: Similar to a PRI line, it has 24 64kbps channels (though sometimes 56kbps), and signaling is done individually on each channel. There are many different configurations for T1s, and generally they are much harder to set up than a PRI.

There are many ways to connect all these interfaces to Asterisk:

  1. PCI cards: There are several manufacturers (such as Digium, Pika, Rhino, and Sangoma) that make PCI cards that will interface with Asterisk. For analog lines, you need cards with fxo ports (note: most cards have the ability to have a mix of fxo and fxs ports). For digital lines, you can get cards with single ports, and cards with 4 ports (supporting a total of 4*23 = 92 channels, with PRI).
  2. IP Gateways: These are similar to the ATA's described above, but have one or more fxo ports. You can also get gateways with digital ports.

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:

  1. Flat-rate account: You pay a flat rate, and get some number of minutes that you are allowed to use. Usually with these accounts you get one DID (phone number) and can use one or two channels (simultaneous calls) at a time. Some of these providers lock you into using their hardware (they provide you a box that you can plug an analog phone into), so beware: you'll need some kind of fxo hardware to interface to this box (plus you lose quality by converting to analog in between, possibly introduce echo, etc). Having Asterisk talk SIP or IAX2 directly to the provider is always preferable.
  2. Per-minute account: This is also sometimes marketed as "wholesale" VoIP. You pay per-minute, for all calls (local and long-distance, incoming and outgoing), usually around $0.01-$0.03/minute, depending on volume. Most providers will give you around four channels, but usually more if you ask (sometimes for a fee). You can get this service for origination (outbound) only, or you can get one or more DIDs for termination (incoming) calls. Typically you pay $3-5/month per DID, and most providers can get DIDs from anywhere in your country (or elsewhere).

Installation

Installing the FreePBX application

FreePBX is an application that 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.

There are some third-party contributed modules that extend FreePBX functionality in specialized ways. To learn whether any of these may be of use to you go to the Contributed Modules Guide.

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.

  1. FreePBX ISO
  2. FreePBX 2.2 Issues
  3. Upgrading from A@H or an older AMP
  4. CentOS 4.3
  5. Using yum on RHEL instructions
  6. CentOS 4.4, Sangoma A200D, 3Ware 8006-2LP SATA RAID
  7. ClarkConnect
  8. Debian Linux
  9. FreeBSD
  10. Gentoo Linux
  11. PoundKey
  12. SuSE Linux
  13. Ubuntu Linux

Once the product is installed (i.e. Asterisk is running and the FreePBX GUI is up), you can go about configuring your PBX.


Asterisk Extra Sounds

If you are using FreePBX in an embedded enviornment, you may be interested in reducing the overall size of the files necessary for FreePBX. FreePBX uses sounds from the asterisk-extra-sounds package (from Digium), but doesn't necessarily need all 34M of the sounds.

As of FreePBX 2.5, you need the following sounds from the asterisk-extra-sounds package to be in /var/lib/asterisk/sounds:

activated
added
all-circuits-busy-now
an-error-has-occured
at-tone-time-exactly
call-forwarding
call-fwd-no-ans
call-fwd-on-busy
call-fwd-unconditional
call-waiting
cancelled
cannot-complete-as-dialed
check-number-dial-again
day
de-activated
disabled
do-not-disturb
enabled
enter-conf-pin-number
enter-num-blacklist
enter-password
ent-target-attendant
extension
feature-not-avail-line
for
from-unknown-caller
goodbye
ha/phone
if-correct-press
im-sorry
info-about-last-call
is-curntly-unavail
is-in-use
is-set-to
is
location
number
num-was-successfully
one-moment-please
please-enter-your
pls-try-call-later
pm-invalid-option
press-0
press-1
press-2
press-3
press-4
press-5
press-6
press-7
press-8
press-9
press-star
privacy-to-blacklist-last-caller
reception
sorry-youre-having-problems
speed-dial-empty
speed-dial
telephone-number
to-call-this-number
to-listen-to-it
with
your


Install Procedure for Centos 4.3

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

  • Web Server
  • Mail Server (Not selected by default)
  • MySQL Database (Not selected by default)
  • Development Tools (Not selected by default)

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.


Install process for CentOS 5.1

Install process for CentOS 5.1

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

 

IPADDR=192.168.1.20

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

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 sox

 

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.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-l...

wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz

wget http://mirror.freepbx.org/freepbx-2.6.0.tar.gz

 

tar zxvf asterisk-1.4-current.tar.gz

tar zxvf asterisk-addons-1.4-current.tar.gz

tar zxvf dahdi-linux-complete-current.tar.gz

tar zxvf libpri-1.4-current.tar.gz

tar zxvf freepbx-2.6.0.tar.gz

 

cd /var/lib/asterisk/sounds

wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-e...

tar zxvf asterisk-extra-sounds-en-gsm-current.tar.gz

 

cd /usr/src/dahdi-linux-complete-CURRENT

 

make

make install

make config

/sbin/ztcfg

 

echo "/sbin/ztcfg" >> /etc/rc.d/rc.local

 

cd /usr/src/libpri-1.4-CURRENT

 

make clean

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.6.0

 

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.6.0

 

./start_asterisk start

 

yum install php-pear-DB

yum install php-mysql

./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

Install Process for ClarkConnect

Detailed guides for installing FreePBX on ClakConnect can be found here:

http://samyantoun.50webs.com/asterisk/freepbx/clarkconnect/


Install Process for Debian

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.


Install Process for freeBSD

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)

6.- http://localhost/FreePBX

7.- Complete this document!


Install Process for Gentoo

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:

  • It appears some gentoo paths are not compatible with amportal:

in /usr/sbin/safe_asterisk change

ASTSBINDIR=/sbin to

ASTSBINDIR=/usr/sbin

  • amportal can't run the safe_opserver because the asterisk user on my machine had /bin/false for it's shell

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.

  • note: this article used to tell you how to implement it
    with lighthttpd but I've cleared out that info as it is more specific
    than it needs to be and novices may make serious mistakes following
    them.

Install Process for Poundkey

"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.


Install Process for SuSE

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.


Install Process for Ubuntu 6.06

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.


Install Process for Ubuntu Server 7.04

Placeholder until more detailed instructions can be written
For now, see UbuntuServer or the Ubuntu 6 Installation Instructions


Upgrading your system

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.7.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.7.0.tar.gz
tar zxvf freepbx-2.7.0.tar.gz
cd freepbx-2.7.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.7.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.7 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.7 freepbx-2.7

Installation instructions are the same as above after exploding the tarball

Note:Need to get the new func_devstate features to take advantage of the optional BLF? You can get a version that works on 1.4 from this website, and then you simply put the file in your apps subdirectory of your asterisk source and re-run make and make install. To use this mode, amportal.conf needs the setting:

USEDEVSTATE=true

Upgrading to the current 2.8 Release Candidate
We just released 2.7 and 2.8 is being defined. It is currently trunk in SVN. We will update this section with more details as we role out the alpha/beta/RC program for 2.8 more formally in the coming weeks.
Upgrading to 2.6 From trixbox
If you are using a version of trixbox that no longer connects to the FreePBX repository and does not provide you with the 2.6 Upgrade Tool, you can upgrade to 2.6 by following these simple instructions. The process will simply install a special version of the Upgrade Tool and then you will upgrade just the same as the normal GUI upgrade process. Although the tool may indicate you are upgrading to a beta or release candidate program, since 2.6 has gone final, you will actually be upgraded to the current 2.6 released version. The steps are simply:

  1. Download the upgrade module to your desktop by pressing this link: Download trixbox Upgrade Tool
  2. Navigate to Module Admin in FreeBPX, click on the Upload module link and then browse to the module you downloaded in step 1, choose it, and then press upload.
  3. Now you simply install the module as if you were downloading it from the Online Repository and then you can follow the instructions provided by the module to upgrade!

The process is almost identical to pulling the module from our repository and once you do this, you will have access to all the great features and many bug fixes no present elsewhere.
Upgrading to the trunk branch
The trunk is where active development happens. The project tries hard to keep it relatively stable and you will find it is fairly safe to run off of this branch most of the time, although it is actively being developed on so glitches can occur. This differs from release branches where they are limited to the latest bug fixes. You can access the development trunk as described below.
To run off of trunk and keep up-to-date with every change even before modules get published, there is a set of tools that will help you build an install environment where you do NOT use Module Admin to keep up-to-date. The instructions are:

cd /usr/src/
svn co http://svn.freepbx.org/freepbx/trunk freepbx-trunk
cd freepbx-trunk
./setup_svn.php

At this point, you will now have a special SVN environment where all the FreePBX modules are pulled into your install directory. You can then do a normal install:

./install_amp --force-version=2.4.1

Note that you will always want to do a force-version in case there are new schema changes introduced since the last time you updated. If you are updating from a release prior to 2.4.1, you should use that release number the first time, but 2.4.1 after that is fine.
Now, instead of using Module admin with this setup, you can simply follow the following procedure to update yourself to the newest updates that may have been committed:

cd /usr/src/freepbx-trunk
svn update
./install_amp --force-version=2.4.1 #(*)

(*) if there were no updates pulled, then there is no need to do an install amp again
The install will take longer because it will be going through the process of reinstalling all modules, but it will do such with all new changes even before they are published to the Online Repository.


Administration Guide

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

  1. Information gathering
  2. Putting the system together
  3. Starting from a blank slate
  4. Creating and assigning extensions.
  5. Setting up voicemail
  6. Creating an IVR.
  7. Creating Queues.
  8. Setting up backup and restore
  9. User control: How to let the user at a little bit...
  10. User Portals and the ARI
  11. Training New Users on how the system is configured
  12. Transitioning to the new system
  13. Running a help desk using voice, tickets, and email
  14. Connecting POTS lines
  15. Connecting PRI trunks
  16. How to connect VOIP trunks
    1. How to test a new IP line for VOIP quality
    2. Two-way trunks
    3. One-way trunks
  17. Outbound routing
  18. Inbound routing

Administration

  1. Moves, adds, changes, and deletes: How to administer extensions with a minimum of pain.
  2. Creating, changing and deleting IVRs.
  3. Creating, changing and deleting Queues.
  4. Backup and restore: From cron to Oh, No!
  5. User control: How to let the user at a little bit...
  6. Training New Users on how the system is configured
  7. New Equipment: How to add with a minimum of disruption
  8. Upgrades: How and when to do it.
  9. Running a help desk using voice, tickets, and email
  10. How to move a PRI
  11. How to move a VOIP trunk.
  12. How to test a new IP line for VOIP quality
  13. How to mix VOIP and data on the same LAN
  14. How to mix VOIP and data on the same backhaul

Adding Extensions

Adding Extensions

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.

Adding Extensions

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.

Device Options

Extensions - Device OptionsExtensions - 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.

callgroup:

pickupgroup:

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.


Asterisk CLI Commands

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


Connecting 2 or more boxes

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

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.


Creating an IVR

Digital Receptionist or IVR

Information

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.

Planning

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:

  1. Planning

  2. Customer agreement with the plan.

  3. Record the audio prompts using System Recordings and an extension.

  4. Create any destinations that don't currently exist (queues, ring groups, day/night modes or time conditions).

  5. Test all of these. One way to do this is use miscellaneous destinations, assigning a * feature code to whatever thing you want to test.

  6. Then go create your IVR.

  7. Show it to the customer, and then make the inevitable changes.

  8. Now upgrade the voice prompts to a paid voice or designated employee (the office manager or receptionist, etc.)

  9. Bask in glory!

Standard IVR Examples:

  1. Office / Light industrial

    1. 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.

  2. Hospitality

    1. 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.

  3. Engineering/Product Company with Direct Sales and Support

    1. 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.

  4. Retail

    1. 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.

Making recordings

Fire up the System Recordings module. Shown here is 3.3.5.1.

 

System Recordings

 


 

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.

Creating the 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'.

Digital Receptionist

 

 

Editing your 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.

 

IVR Editing

 


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.



Configuring your IVR

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.

 

Miscellaneous Applications

 



Creating and Assigning Extensions

Creating and Assigning Extensions

Numbering Schemes

There are several schemes for assigning extensions. Invariably, though, you'll find the following guidlines will help:

  • Use their previous extension numbers
    • Upgrading a system shouldn't require upgrading business cards
  • Use the last 3 or 4 digits of their DIDs
    • Less for people to remember
  • For non-DID systems, choose the last 3 digits of the main number
    • If the main number is 651-3200, then extensions can be 200, 201, 202, etc.
  • Don't collide with system shortcuts, common dialing sequences, or emergency numbers
    • In the US, this rules out extensions in the 100s and 900s, at minimum. 611 and 311 shouldn't be assigned, but the rest of the 600s and 300s can be.
    • For FreePBX, 7777 is commonly 'simulate an incoming call', should be avoided, as should other Miscellaneous Destinations

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.


File ownership and what files you can edit

Who owns what files in /etc/asterisk when FreePBX is installed?
That's what this page is here to answer.
The basic rule is that all files are owned and modified by FreePBX unless they end _custom.conf. There are a few exceptions to this rule but not many.
If the file is owned by FreePBX you should find this statement at the top of the file making it clear that it is owned by FreePBX

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make    ;
; custom modifications, details at: http://freepbx.org/configuration_files       ;
;--------------------------------------------------------------------------------;
;

So here is the list of files as of version 2.4. Those owned by FreePBX will be in bold underline. If they become owned in a later version that version will be stated to the right of the file name.
agents.conf
alarmreceiver.conf
applications.conf
asterisk.conf
backup.conf

  1. This file contains the crontab line(s) that will get executed for backup job scheduling.

cdr_mysql.conf

  1. if you want to use the userfield in the CDR reporting you will need to add this line to the file: userfield=1
    then restart Freepbx by typing amportal restart
    Default file should look like this:

     ;
     ; Note - if the database server is hosted on the same machine as the
     ; asterisk server, you can achieve a local Unix socket connection by
     ; setting hostname=localhost
     ;
     ; port and sock are both optional parameters.  If hostname is specified
     ; and is not "localhost", then cdr_mysql will attempt to connect to the
     ; port specified or use the default port.  If hostname is not specified
     ; or if hostname is "localhost", then cdr_mysql will attempt to connect
     ; to the socket file specified by sock or otherwise use the default socket
     ; file.
     ;
     [global]
     hostname=localhost
     dbname=asteriskcdrdb
     password=amp109
     user=asteriskuser
     ;port=3306
     ;sock=/tmp/mysql.sock
    

codecs.conf
dnsmgr.conf
dundi.conf
enum.conf
extconfig.conf
extensions.conf

  1. if you need to modify existing code code/context in extensions.conf please place your modifications in extensions_override_freepbx.conf as asterisk uses the code for the first context referance and ignores additional occurances.

extensions_additional.conf

  1. DO NOT EDIT THIS FILE, it get's regenerated each and every time you apply changes.
  2. If you need to expand on functionality of a section of code check to see if there is a include context line in the code (will end in _custom.conf) if so create that context in extensions_custom.conf and it will get called.
  3. If you need to replace the functionality in extensions_additional.conf please place it in extensions_override_freepbx.conf but read the notes about this file first.

extensions_custom.conf

  1. this is the file that you place all your custom contexts, and additional code enhancements to the FreePBX dial plan. This file will not be overwritten.

extensions_override_freepbx.conf

  1. If extensions.conf (or extensions_additional.conf) has a context or macro that you NEED to modify, you place that code here as asterisk will only execute the first occurrences of that code and ignores other occurrences. This file will not be overwritten. Be very careful as replacing an existing piece of code this way is the fastest possible way to break your system. If you are doing this you should probably think about filing for a feature request or bug fix to get it addressed properly.

features.conf
features_applicationmap_additional.conf
features_applicationmap_custom.conf
features_featuremap_additional.conf
features_featuremap_custom.conf
features_general_additional.conf
features_general_custom.conf
globals_custom.conf
iax.conf
iax_additional.conf
iax_custom.conf
iax_custom_post.conf
iax_general_additional.conf
iax_general_custom.conf
iaxprov.conf
iax_registrations.conf
iax_registrations_custom.conf
indications.conf
localprefixes.conf
logger.conf
manager_additional.conf
manager.conf
manager_custom.conf
meetme.conf
meetme_additional.conf
mgcp.conf
modem.conf
modules.conf
musiconhold_additional.conf
musiconhold.conf
musiconhold_custom.conf
oss.conf
parking_additional.inc (should no longer be used as parking was moved to features)
phone.conf
phpagi.conf
privacy.conf
queues.conf

  1. Do not edit this file in any way. Anything you can think of putting in this file can be placed into one of the _custom.comf files where it will not get removed or replaced.

queues_additional.conf

  1. Do not edit this file in any way. Anything you can think of putting in this file can be placed into one of the _custom.conf files where it will not get removed or replaced.

queues_custom.conf

  1. This is the proper location for placing any of the context specific options and lines that you might need to add before the processing of the queues_additional.conf file for your queues setup.

queues_custom_general.conf

  1. This is the proper location for placing any of the [general] context option lines that you might need to add to your queues setup.

queues_general_additional.conf

  1. Do not edit this file in any way. Anything you can think of putting in this file can be placed into one of the _custom.comf files where it will not get removed or replaced.

queues_post_custom.conf

  1. This is the proper location for placing any of the context specific options that you might need to add to the end queues setup.
    This is the file that allows you to add or remove values to those entries found in the auto-generated queue_additional.conf file. So for example you have a queue 79 that need a additional parameter added. create a context line: [79](+) then on the next line add the item(s) you need to add. To remove use (-) instead followed by the line(s) you want removed.

res_mysql.conf
rtp.conf
sip.conf

  1. Do not edit this file in any way. Anything you can think of putting in this file can be placed into one of the _custom.comf files where it will not get removed or replaced. If you are looking to do nat'ing, see sip_general_custom.conf or if it is a legacy system sip_nat.conf. If you want to add additional setup parameters for your sip device see sip_custom_post.conf, etc. If you need to adjust sip jitter or something else it will be sip_general_custom.conf (if it is for the general context) or sip_custom.conf. If you do edit this file and place something new in it, it will get overwritten at some point and next time you restart your system you will suddenly wonder why things stopped working.

sip_general_additional.conf

  1. This is where FreePBX places all of it's general context settings. If you need to override one of these or add a new one please do so in sip_general_custom.conf.

sip_general_custom.conf

  1. This is the proper location for placing any of the [general] context option lines that you might need to add to your setup. This is also the place to add those lines needed to enable the nat'ing of SIP when you go through a firewall.

    Some of the required lines for nat'ing are externip=, nat=, localnet= (you can have more then one occurrence of this line), and optionally fromdomain=. The first three are needed to properly setup a box on protected network behind a firewall that is providing nat to a public IP. If you have a legacy system these lines might have been placed in sip_nat.conf in the past, if so that is ok as long as the lines only exist in one file and not both (or a big debugging mess will occur along with hair loss as you pull it out while tracking it all down). See sip_nat.conf for more info.

    configurations with multiple subnets:
    For those setups with internal networks that have multiple subnets you will need to add a localnet= line for each subnet that the phone system should have direct access to. If you don't do this the phone system will assume that phones on those other subnets are external and thus provide the External IP of the box in the SIP headers instead of the internal IP. This then becomes a routing problem for the phone as it should not be attempting to talk external IP of the internal box (most firewalls can not handle the looping back of IP traffic).

    Example:
    Server 192.168.1.2 on a 192.168.1.0/255.255.255.0 network
    Phones inside the office are on the 192.168.2.0/255.255.255.0 subnet

    Requires these two lines in the either sip_general_custom.conf or sip_nat.conf file
    localnet=192.168.1.0/255.255.255.0
    localnet=192.168.2.0/255.255.255.0

sip_nat.conf

  1. This is the old common location for placing the lines needed to enable the nat'ing of SIP. The new preferred location is sip_general_custom.conf. If you move the lines from this file to sip_general_custom.conf please remove them from this file or you'll experience hair loss as you spend time debugging why things don't work as you expect.

sip_registrations.conf

  1. General section registrations that are auto-generated by FreePBX.

sip_registrations_custom.conf

  1. a custom file just in case there is ever a need to override a general registration that was auto-generated by FreePBX.

sip_custom.conf

  • This is the first file that is not under the general context. IT allows you to define contexts that you need before the contexts that are auto-generated by FreePBX in sip_additional.conf.
  • sip_additional.conf

    1. This is where FreePBX puts all sip extensions, sip trunks, etc. If you need to add a additional parameter to a extension, trunk, etc., see sip_custom_post.conf.

    sip_custom_post.conf

    1. This is the file that allows you to add/remove values to those entries found in the auto-generated sip_additional.conf file. So for example you have an extension 1000 that needs an additional parameter added. Create a context line: [1000](+) then on the next line add the item(s) you need to add. To remove use (-) instead followed by the line(s) you want removed.

    sip_notify.conf
    skinny.conf
    voicemail.conf

    1. This file is both editable by you and by FreePBX, so please be careful. The structure of this file is as follows:

      [general]
      #include vm_general.inc
      #include vm_email.inc
      [default]
      

      Once you have configured a system with voicemail there will be values after the context [default]. These lines will be generated by FreePBX every time you add/edit/delete a extension.

      If you are looking to customize the e-mail message that get's send out with a voice mail please edit the vm_email.inc file. If you need to edit the mail sending parameters edit the vm_general.inc file. 99% of the world needs to edit two lines in the vm_general.inc file at the initial build time.

      The most common change to this file is to create a context called [zonemessages]. This context allows you to create timezones so that when you have extensions in multiple time zones they can date time stamp recorded messages properly for any given extension. If you create this context it should be placed after the second #include line and before the [default] line.

      [general]
      #include vm_general.inc
      #include vm_email.inc
      [zonemessages]
      eastern =       America/New_York|'vm-received' q 'digits/at' IMp
      central =       America/Chicago|'vm-received' q 'digits/at' IMp
      mountain =      America/Denver|'vm-received' q 'digits/at' IMp
      pacific =       America/Tijuana|'vm-received' q 'digits/at' IMp
      eastern24 =     America/New_York|'vm-received' q 'digits/at' R
      central24 =     America/Chicago|'vm-received' q 'digits/at' R
      mountain24 =    America/Denver|'vm-received' q 'digits/at' R
      pacific24 =     America/Tijuana|'vm-received' q 'digits/at' R
      deutschland =   Europe/Berlin | 'vm-received' Q 'digits/at' kM
      england =       Europe/London | 'vm-received' Q 'digits/at' R
      germany =       Europe/Berlin | 'vm-received' Q 'digits/at' kM
      alberta =       Canada/Mountain | 'vm-received' Q 'digits/at' HM
      madrid =        Europe/Paris|'vm-received' Q 'digits/at' R
      paris   =       Europe/Paris|'vm-received' Q 'digits/at' R
      sthlm   =       Europe/Stockholm|'vm-recieved' Q 'digits/at' R
      europa  =       Europe/Berlin|'vm-received' Q 'digits/at' kM
      italia  =       Europe/Rome|'vm-received' Q 'digit/at' HMP
      military = Zulu | 'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
      
      [default]
      
      

    vm_email.inc

    1. this file contains the e-mail subject line and message body for any voice mails that are e-mailed.

    vm_general.inc

    1. this file contains the e-mail / voice mail configuration parameters.
    2. The most common change to this file is to edit the servermail= line so that it is from a valid worldly e-mail address or any mail server that has spam and/or spoofing protection will reject the voice mail e-mails.
    3. other common lines to edit are: maxmessage= this is the max message limit, maxmsg= limits the total number of messages allowed in a mailbox, operator= if this is set to yes then when a person is leaving a message they can press 0 for the operator (or dial another extension).

    zapata.conf
    zapata-auto.conf
    zapata_additional.conf
    zapata_custom_chan_default.conf


    Hardware examples

    Add child pages to enter hardware examples here.
    Make sure and note what call levels (and conferences, etc.) the system acheives.


    High Quality Sounds

    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:

    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    • Neither the name of the University of California, Berkeley
      nor the names of its contributors may be used to endorse or promote
      products derived from this software without specific prior written
      permission.

    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.


    Interfacing to a PSTN

    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.

    1. Enter the phone number for you pots line in the Caller ID field
    2. Enter 1 for Maximum channels
    3. Set a dial rule you want for this trunk
    4. Select an outbound dial prefix to select this trunk when dialing
    5. Set the Zap Identifier to 1 (the default is g0)

    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

    Also see Eliminating echo problems in Appendix E.4 in Sipura SPA-3000


    Is Voip for You?

    Is VoIP for You?

    Whether VOIP is for you or not rely on a number of or combination
    of factors. Some economic and quality considerations should be
    examined.

    What is it going to cost?

    Assuming that you already have a broadband service, a router, and a Windows PC to run the softphone, the cost will be minimal.

    If you already have a spare computer to dedicate to this task, then
    the cost is almost nothing unless you need to buy an audio headset
    ($15.00 from Dick Smith - Australia.) for the softphone. If you do not have a spare
    PC with the above specification, then you may be able to buy one from
    your local swap meets for under $200.00, which may include a monitor.
    Ensure that the PC has an Ethernet NIC for connecting to your home
    network.

    Your only other initial cost will be the $20.00 or so activation
    fee to Oztel (or other VSP of your choice), if you want the ability to
    make PSTN calls. If you want to restrict all your calls to VOIP only,
    it may not cost you anything at all.

    Some VSPs like Pennytel, Astratel, Spantalk etc will register you
    for SIP communication for free provided that you do not need to make
    PSTN calls.

    All these “Major Expenses" will be recovered when you receive your monthly Telstra or Optus phone bills.

    What will the Quality of the phone calls be?

    If you are expecting the quality to be as good as your existing
    PSTN calls, you will be somewhat disappointed, but if you will be happy
    with a quality that is not quite but close to your existing PSTN calls,
    you might be in luck.

    VOIP via the Public Internet is very much dependant on a number of
    factors – available bandwidth not withstanding, your usage habit of the
    internet and LAN traffic and equipment quality, amongst others, also
    play very important roles.


    Linux CLI Commands

    Entering the Asterisk Console
    asterisk -r

    Checking Current System Load
    top

    Interrupt Information
    cat /proc/interrupts

    RAID Array Information
    cat /proc/mdstat

    Checking the Routing table
    netstat -rn OR route

    Checking CPU Information
    cat /proc/interrupts

    Checking Memory Information
    cat /proc/meminfo

    Running tcpdump
    tcpdump -A -s 10000 port <port> and host <host>

    Running PING tests
    ping -i 0.02 -c 500 -s 270 <host>

    Intensive Performance Information
    vmstat 1

    Current Wanpipe Version
    wanrouter version

    Current system processes
    ps aux

    Current Networking Information
    ifconfig -a

    Duplexing Diagnostics
    mii-tool

    Rsync Usage
    rsync -av -essh /path/to/file <remote_site>:/path/to/file

    SCP Usage
    scp /path/to/file <remote_host>:/path/to/file

    Checking Disk Space
    df -h


    Setting up Phones

    Some docs on how to setup up hard and soft phones with freepbx


    Setting Up Voicemail

    Setting up Voicemail

    Voicemailboxes are typically created when used for the first time.

    Assigning Voicemail PasswordsYou must enter a voicemail password when creating an extension enabled with voicemail. Choose a password that is at least 4 digits. Resist the impulse to standardize the default. Most people won't change it, and the system will be insecure.
    Instructing New Users

    New users should, as matter of policy, be sent an email with both general instructions, their voicemail initial password, and directions to change it.

    Voicemail in email feature

    In order for these emails to pass through spam filters, the following are recommended:

    1. Set your hostname to be a fully-qualified domain name. Use dyndns.org if you don't want to pay for a real one.
    2. Don't send from dynamic IP addresses.

    Voicemail pager feature

    This gives a short description of the message envelope, suitable for emailing to a wireless carrier's email gateway.

    Voicemail Locator (VMX) Feature

    This optional feature lets users set up a short menu before voicemail takes the actual message. Common options are 'press 1 for my cell, 2 for my assistant or just leave a message after the tone.' 

    Resetting

    It's commonplace to have to reset the passwords as people leave the company.

     


    System Tools

    Area for additional system tools for Asterisk and FreePBX


    Putty

    PuTTY
    PuTTY is a free implementation of Telnet and SSH for Win32 and
    Unix platforms, along with an xterm terminal emulator. It is written
    and maintained primarily by Simon Tatham and can be downloaded from the
    following link.

    http://www.putty.nl/download.html


    WEBMIN

    WEBMIN

    Webmin in an invaluable web based gui for managing a Linux box.
    Webmin make it easy to configure application like SMTP mail, editing
    files, system settings, etc.

    Those who want to use Web Admin to maintain the Asterisk System may download Webmin from here or from CLI, do the following:

    wget http://superb-east.dl.sourceforge.net/sourceforge/webadmin/webmin-1.260-1.noarch.rpm

    Install it with the following command through CLI:

    rpm -Uvh webmin-1.260-1.noarch.rpm

    Or be totally lazy like me and do the whole lot in a one liner;

    rpm –Uvh http://superb-east.dl.sourceforge.net/sourceforge/webadmin/webmin-1.260-1.noarch.rpm

    I have found the above method is straightforward and simple.
    However there are some users who found that following an alternative
    method is simpler. If that is the case, the alternative installation
    method can be found here:

    http://www.terrasoftsolutions.com/support/solutions/ydl_general/webmin.shtml

    You may connect to Webmin remotely through your browser using the
    following address http://<YourAsterisk_IPAddress>:10000. E.g.

    192.168.0.101:10000

    To update WebMin

    Anytime you want to update Webmin, simply do the following.

    Log on to your Asterisk box (SSH or at the console).

    At the command prompt, issue the following command:

    yum –y install webmin


    WINSCP

    WINSCP
    WinSCP is an open source freeware SFTP client for Windows using
    SSH. Legacy SCP protocol is also supported. Its main function is safe
    copying of files between a local and a remote computer. It can be
    downloaded from the following link.

    http://winscp.net/eng/index.php


    Module Documentation

    Module Documentation

    Documentation for individual modules should be attached to this page as child pages.

    These have been moved over more or less verbatim from AussieVOIP.

    Creation credits and time of creation has been lost. Most comments have been removed.

    Should you have a comment, add a Comments child page to the individual module page.

    Ground rules - no advertising, no links to pages with advertising, and no bug reports.

    Pointing out (and fixing!) errors in documentation is greatly appreciated by everyone and will earn you karma points (real afterlife karma, not some silly website thing.)

     


    Module Admin - Read This First!

    Overview
    Everything in FreePBX is a module, so you need to enable all the modules you want to use. If you do enable something you don't use, it won't matter - it'll just make clicking the red 'Reload Bar' take a little longer, as it goes through and asks every modules 'What would you like done?. If you're using a lower powered system (Say, a Piii 500 or slower) you might want to be a bit selective with the modules you use, but it will _only_ affect the speed of FreePBX, not the speed of Asterisk itself.

    Modules and their descriptions

    1. Core: This coveres your basic 'Extensions' and 'Trunks' etc. You pretty much always want to have this enabled
    2. Feature Code Admin: For configuration of 'call features', such as DND and Call Forwarding.
    3. Follow Me: Provides a 'Follow Me' service
    4. Misc Destinations: Allows you to use any number you can dial as a destination
    5. PHP Info: A sample module
    6. Ring Groups: Lets you define a group of extensions (or external devices) to be called when a certain extension is rung.
    7. Time Conditions: Lets you define a particular time period and alternative destinations based on whether you are current in the time period specified. You then use the Time Condition itself as a destination in other locations.
    8. Call Forward: A call feature code.
    9. Call Waiting: A call feature code.
    10. Do-Not-Disturb: A call feature code.
    11. Online Support: Enables you to contact developers and other online, immediately.
    12. nfo Services: A call feature code.
    13. Voicemail: A call feature code
    14. IVR: Lets you create IVR (i.e. Digital Receptionist) menus
    15. On Hold Music: Lets you define Music On Hold categories and upload MP3s to use for each category.
    16. PIN Sets: Lets you check a range of PIN's. Currently only used for Trunks.
    17. Paging and Intercom: Lets you define paging groups (intercom not currently supported) to automatically page a group of extensions.
    18. Queues: Lets you create call queues
    19. Recordings: Lets you create Recordings that can be used in various places (like Digital Receptionists or Queues)
    20. DISA: Lets you create DISA (Direct Inward System Access) destinations (only available in the SVN trunk version)
    21. Asterisk CLI: Adds a tool that allows you to issue commands to the Asterisk CLI interface
    22. Conferences: Lets you create MeetMe conferences.
    23. Backup & Restore: Adds a tool that allows you to backup or restore your freePBX configuration



    Additional FreePBX modules
    You will find some additional modules that have been contributed to the FreePBX community here:
    http://mirror.freepbx.org/modules/release/contributed_modules/



    Administrators

    This module lets you limit the sections of freePBX to certain users.

    Configuration

    This module may not be active by default, and will say 'NOTE -
    AUTHTYPE is not set to 'database' in /etc/amportal.conf - Module
    crippled'. To enable it, you need to change AUTHTYPE in
    /etc/amportal.conf to 'database'. If you have already tried to add
    users before changing AUTHTYPE to 'database', delete them now and read
    the "important warning" below.

    Trixbox or Asterisk@Home users have some extra work due to the
    Apache level authentication with the "maint" user. You will have to
    comment out or delete the following lines in
    /etc/trixbox/httpdconf/trixbox.conf for Trixbox or
    /etc/httpd/conf/httpd.conf for A@H for this to work:

    Password protect /var/www/html/admin

    <Directory /var/www/html/admin>

    AuthType Basic

    AuthName "Restricted Area"

    AuthUserFile /usr/local/apache/passwd/wwwpasswd

    Require user wwwadmin maint

    </Directory>

    Then you have to restart httpd (/etc/init.d/httpd restart) and
    possibly amportal (amportal restart) too. You should now be able to
    login with admin/admin and create/change users in the Administrators
    module. Be sure to change the admin password straight away!

    Important Warning! Read before using this module

    It is quite easy to lock yourself out of freePBX if you enable
    AUTHTYPE after you have added users. Don't do it. If you want to use
    this, then you must have NO USERS CREATED before you turn it on. If you
    don't heed this advice, and turn it on with an existing user there,
    then nothing you type in will let you access freePBX. You'll have to
    turn it back off, and then delete any existing users.

    Adding a User

    Enter a username and password in the General section. If this is
    the first user, make sure that you select 'ALL SECTIONS' in the 'Admin
    Access' list so you can get back in there. As soon as you add the first
    user, you will then be prompted for a username and password. Log in as
    the user you've just created.

    Limiting User Access

    • Department Name
      • Have been unable to find any documentation on this . Help?
    • Extension Range
      • When this user is logged in, they will only see the range
        specified here. This is useful if you're setting up multiple tenants on
        the one system.
    • Admin Access
      • This is a multiple-selection box. You can select a range of
        areas they're allowed to access by either holding down Control (or
        'apple' on Mac's) and selecting individual ones, or dragging the mouse
        over the list of ones you want to give them access to.

    Announcements

    The Announcement module alows you to play an announcement to a caller. You can then send the caller to another destination or back to the IVR that sent him to the announcement.

    For example:

    1. IVR: "Hello, thank you for calling the North Carolina School district. To hear the latest updates about changes to thew school schedule due to the current weather conditions, press 1." After pressing 1, the caller will then hear the announcement regarding todays schedule. Then the caller will be returned to the IVR where they can press another option (2 for the school administration, etc.)
    2. You can play a message to the caller after the select an IVR destination - but befor the call is transfer. I.e. if the caller pressed 1 for sales, you could play "transfering to the sales team" - and then send the caller to the sales queue.

    Configuration

    • Description: This is the name of the announcement.
    • Recording: This is the file to be played. You can add more recording using the System Recordings module.
    • Repeat: This option sets a repeat key.If the caller presses this key the announcement will be replayed.
    • Allow Skip: Alows the caller to press any key, to skip the announcement.
    • Return to IVR: Returns the caller to the IVR after they have heard the announcement
    • Don't Answer Channel: Check this to keep the channel from explicitly being answered. When checked, the message will be played and if the channel is not already answered it will be delivered as early media if the channel supports that. When not checked, the channel is answered followed by a 1 second delay. When using an annoucement from an IVR or other sources that have already answered the channel, that 1 second delay may not be desired.


    Asterisk CLI

    Asterisk CLI command


    This allows you to run a command as if it was typed into the asterisk CLI.

    Examples

    * sip show peers

    o This displays all the known SIP devices, and their state, according to Asterisk

    * show channels

    o Show any channels that are in use at the moment

    * soft hangup Zap/1

    o Hangs up the Zap/1 channel


    Asterisk Info Module

    Asterisk Information Module - Gives the use a snapshot of the system state such as SIP channels (calls in progress) SIP peers (SIP phones, VoIP trunck) etc...

    This module will give you a summary of the following.

    Summary: Summary of your system state.
    -system uptime
    -active SIP channels
    -active IAX2 channels
    -SIP registration
    -IAX2 registration
    -SIP Peers
    -IAX2 peers

    Channels: Summary of the systems channel information:
    -Active Channels
    -SIP channels
    -IAX2 channels

    Peers: Summary of the systems Peers:
    -SIP peers
    -IAX2 peers

    SIP info - summary of the systems sip information:
    -SIP registry
    -SIP peers

    IAX2 info - summary of the systems IAX2 information
    -IAX2 registry
    -IAX2 peers

    Conferences - summary of the active conferences / MeetMe.

    Subscriptions / Notify - registered Asterisk dial plan Hints.

    Voicemail Users - A list of the extensions that have VM enabled and the number of new Voicemails.

    Full Report: Gives you a full report of all the above information in one report.

    Refresh - hitting this button will refresh the snapshot of the Asterisk Information.


    Asterisk Logs

    No documentation availabe. You can help by contributing to this book pate.


    Asterisk Manager API Settings

    No documentation availabe. You can help by contributing to this book pate.


    Backup and Restore

    Overview

    You can configure a regular backup schedule to ensure that you
    have a copy of your Asterisk and freePBX configuration, voicemail and
    CDR records. You can also restore a previous backup, in case of data
    loss or a major configuration fault. Backups are stored on the file
    system at /var/lib/asterisk/backups. You should make a point of making
    an offline copy of important backups.

    Add Backup Schedule

    • Schedule Name: Give this backup a friendly name (e.g.
      "Daily" or "Voicemail") to accurately identify what you're backing up.
      This will make future restores easier.
    • Voicemail: Enable this if you want to include voicemail
      messages in this backup. This could seriously increase the size of your
      backups because you are backing up potentially large audio files.
    • System Recordings: Enable this if you want to backup custom
      System Recordings you may have created for a Digital Receptionist or
      Queue. Again, this could increate the size of your backups because of
      the size of some audio files.
    • System Configuration: Enable this option to backup your
      Asterisk and freePBX configuration data, including the MySQL and
      Asterisk databases. We recommend this be enabled for all backups.
    • CDR: Enable this option to backup your Call Detail Records.
    • Operator Panel: Enable this option to backup the Flash Operator Panel configuration.

    Run Schedule

    You can chose a pre-configured schedule from the drop-down, or
    configure your own schedule using the Minutes, Hours, Days, Months and
    Weekdays select boxes. The pre-configured options are: Daily (at
    Midnight), Weekly (on Sunday at Midnight), Monthly (on the 1st at
    Midnight) or Yearly (on the 1st January at Midnight).

    Restore from Backup

    This will list all the backups that are currently on your system
    (located at /var/lib/asterisk/backups). Click on the backup you wish to
    restore.

    Upgrading from A@H:

    Upgrading from an older version of A@H to freePBX causes restores to STOP WORKING. You need to totally clean out your /var/www/html/admin directory first, then re-run install_amp.

    cd /usr/src/freepbx

    rm -rf /var/www/html/admin

    ./install_amp

    After you've restored, check to confirm you haven't lost anything.
    *** NOTE ***
    This module is NOT backwards/forwards compatible at this time. ONLY restore backup sets to the same revision. Meaning, don't install a fresh 2.3.0 system and try to restore a 2.2.1 backup set as you will have issues.

    *** NOTE ***
    I have tested a revision of this. Restoring an old version of FreePBX (2.2.X)to the newest version of FreePBX 2.4.X.

    1. install your new system with FreePBX 2.4.0
    2. install the Backup / Restore module
    3. restore your old backup (I always restored everything for testing)
    4. SSH into /usr/src/tbm-pbxconfig-5.0.0
    5. run ./install_amp *this will fix all the web interface problems and the modules that were hosed.
    5. Do not hit the orange bar yet.
    6. Update all the modules, check your extensions then hit the orange bar and reload.

    the system should be close to perfect.

    This has only been tested. Long term testing has not been done.


    Blacklist

    This module allows you to manage the blacklist in astDB thru the FreePBX web interface.

    Add or replace entry:

    Number: Enter the number you want to block.

    Adding a number to the blacklist will not allow the number into your system. The blacklisted caller will hear "The number you have reached is not is service."

    Hit *32 to blacklist the last number called into your system.

    On some phones you can setup a speeddial to blacklist callers.
    speeddial *32.


    Callback


    The Callback module allows you to setup a destination that calls a user back and provides them access to an application. An example of this would be a caller that dials your system, disconnects, and is called back and then provided a DISA
    dial-tone to make a phone call.

    Add Callback

    • Callback Description: This is the name/description of the callback
    • Callback Number: This is the number to be called
    • Delay Before Callback: Optionally, you can enter an amount of time that the system should wait before placing the call

    Known Issues

    Some issues have been encountered with this plugin:

    1. Callbacks frequently fail, as it appears Asterisk disconnects
      before the associated callback PHP script (located in
      /var/lib/asterisk/bin) may complete the callback transaction.
    2. If one uses the 'CLI' callback capability, then you may
      encounter issues with being able to actually dial people back. The
      reason for this is that the telco only provides a 10-digit CLI, and if
      your provider requires you to add a '1' there is no way to do this
      without hacking the plug-in. Further, if your own dialplan requires an
      access code like '9' you also encounter this problem.
    3. There is no way to provide a number of retries, retry time or
      wait times for an answer. This app will try once, and if it fails, will
      not try again.

    Alternative Solution

    A replacement script, written in Ruby, has been created to replace
    the /var/lib/asterisk/bin/callback PHP script provided with the
    callback plugin. The Ruby script takes a different approach to
    providing the callback capability, while still supported the HTML form
    provided with the plug-in with FreePBX. The enhancements are:

    - Provides the ability to set the access code to prepend to the recognized CLI number for a callback

    - Uses call files instead of the Manager API

    - Allows one to set the number of retries, the retry wait time and the wait time for a caller to pickup an attempt

    To use the script below do the following:

    (Note: This script requires that Ruby 1.8.x be installed on your Asterisk/FreePBX system)

    1. Move /var/lib/asterisk/bin/callback to /var/lib/asterisk/bin/callback.original (to back it up)

    2. Download the attached script and copy to
    /var/lib/asterisk/bin/callback and then do a

    chmod +x
    /var/lib/asterisk/bin/callback

    3. Add these options to the end of your configuration file at /etc/amportal.conf:

    CALLBACK_PREFIX=91
    CALLBACK_CLI=Callback
    CALLBACK_RETRY=1
    CALLBACK_INTERVAL=10
    CALLBACK_WAIT=30
    


    Caller ID Lookup Sources

    This module provides the ability to specify Sources where inbound calls can have their Caller ID looked up so Caller ID Names can be used or changed.

    The Caller ID Lookup Sources module enables your FreePBX system to lookup Caller Names that are related to your number whether they be in your phonebook, in a database, or via an HTTP lookup. The module can also be used with scripts in the agi-bin directory of your asterisk configuration.

    ------------------------------------------------------------------
    Add Source

    A Lookup Source let you specify a source for resolving numeric caller IDs of incoming calls, you can then link an Inbound route to a specific CID source. This way you will have more detailed CDR reports with information’s taken directly from your CRM. You can also install the phonebook module to have a small number <-> name association. Pay attention, name lookup may slow down your PBX.

    Source Description: A description for this source.

    Source Type: Choose the source type.
    Internal: uses astDB as a lookup source. Use the phonebook module to populate it.

    ENUM: Uses DNS to look up the callers Name; it uses ENUM lookup zones as configured in enum.conf

    HTTP: This executes an HTTP GET passing the caller number as an argument to retrieve the correct name.

    MySQL: the queries a MySQL database to retrieve the caller name.

    Cache results - Decide whether or not to cache the results to a astDB; it will overwrite present values. It does not affect internal source behavior.

    ----------------------------------------------------

    HTTP Lookup Configuration:

    Configuring the module to lookup a Caller Name (cn) via http lookup is simple. Most http lookup providers will provide you with a string you'll need to query with (query string). We'll need to break up the string into it's various components to populate the CID Lookup Source Fields.

    For the purposes of this tutorial, i'm going to use configuring metrostat as an http provider. They expect queries in the form: http://cnam1.edicentral.net/getcnam?q=C&f=S&dn=[NUMBER] where [NUMBER] is a 10 digit telephone number.

    Source Description: Metrostat
    Source Type: HTTP
    Cache Results: (leave this unchecked)

    Host: cnam1.edicentral.net
    Port: (leave blank)
    Username: (leave blank)
    Password: (leave blank)
    Path: /getcnam
    Query: ?q=C&f=S&dn=[NUMBER]

    ok.. so let's break this up so that we can see what we did. Source Description is nothing more than a name you want to call the lookup source. Since it's metrostat, we're just going to call it metrostat.

    Source Type: Here, we can specify whatever the lookup source type that is supported for the query. In this particular case, it's an http lookup so we're going to specify http.

    Cache Results: You can check this and the system will keep successful lookups for future use, thus eliminating excessive remote lookups for numbers that have already called you in the past.

    Host: This is the hostname or IP address of the host you'll be querying. In our example, it's cnam1.edicentral.net.

    Port: You can pass your query to any port that is running httpd. This is usually left blank if it's on the standard port (80). In our example, we're leaving it blank, because it's on the standard http port.

    Username and Password fields: The username you're issued by the provider if it's needed, otherwise, it's blank. In this case, it's blank. This goes for the password as well.

    Path: This is the first thing after the hostname (including the slash. Up to, but NOT including the '?' symbol. That's reserved for the query line otherwise it just won't work.

    Query: This is everything after the Path entry. In our example, we had '/getcnam' so we'd be putting the following in here. '?q=C&f=S&dn=[NUMBER]'. The [NUMBER] variable will automatically be filled in with the incoming caller number.

    After you've filled out and submitted your changes (remember to hit apply changes), go to the incoming route and select the appropriate caller id lookup source, submit the changes, and apply and you're good to go! enjoy!


    Conferences (MeetMe)

    Information

    Conferences is a standard multi-party conferencing facility that is available as a destination.

    Conference Details

    • Conference Number
      • This is a number that local users can dial to join the conference
    • Conference Name
      • This is used as an Identifier, along with the number, when picking a conference as a destination
    • User PIN and Admin PIN
      • If either of these options are set, anyone calling into the
        conference will be prompted for a PIN. If 'user' is left blank, they
        can just push '#' to enter. The only use of 'Admin' is to not actually
        open the conference until the admin user has arrived. If 'Music On
        Hold' is enabled, users will be placed on hold with the 'default' Music
        On Hold class.

    Conference Options

    • Join Message
      • This is a sound that is played to all users upon entering.
    • Leader Wait
      • When there is an Admin PIN set, the conference won't start until the 'Admin' user joins. See above.
    • Quiet Mode
      • Usually a 'bing' noise is played when a user enter or leaves
        the conference, alerting other members to the fact that someone has
        joined or left. You can disable that by selecting 'Yes' here.
    • User Count
      • When someone joins, the conference will say 'There are (number) people in this conference"
    • User Join/Leave
      • When someone connects to the conference, it will ask them to
        record their name. The conference will then announce when they join and
        leave, by name.
    • Music On Hold
      • Totally enables or disables Music on Hold in this conference.
    • Allow Menu
      • Enables the user or admin to enter an the management mode by pushing '*'. The commands whilst in management mode are:
        • 1: Mute yourself
        • 4 or 6: Decrease or Increase the Conference Volume (eg, the sound you hear)
        • 7 or 9: Decrease or Increase your Volume (eg, the sound other people hear)
      • Additionally, Admin users have the added features of:
        • 2: Lock or Unlock the conference
        • 3: Eject the last person that called
    • Record Conference:
        Toggle this to yes if you would like to record the conference.

    Core Module

    Description

    The Core Module is a collection of the fundamental modules that make up FreepPBX. It includes:

    Extensions

    Used to create User Extensions

    FreePBX User

    Used to create a FreePBX User (when operating in Devices and Users Mode) *This module is not present in the latest version of FreePBX 2.4.x

    Devices

    Used to create a FreePBX Device (when operating in Devices and Users Mode) *This module is not present in the latest version of FreePBX 2.4.x

    Inbound Routes

    Used to route incoming numbers, DIDs, to various destinations

    Outbound Routes

    Used to route outbound dial patterns to various Trunks

    Trunks

    Used to configure Zap, SIP, IAX and other types of Trunks to the PSTN or to interconnect with other PBXs

    Administrators

    Used to create FreePBX Administrators and provide access to limitted modules or extnension ranges *note this module will not work and the new users will not be able to log into the system unless AUTHTYPE is set to 'database' in /etc/amportal.conf

    General Settings

    A collection of system wide and defaut settings used by different systems within the PBX.


    Custom Extension and Destinations

    Custom Extension and Destinations
    This documentation needs writing, for adding custom extensions and destinations to the registries. Contact us if you would like to write this page.

    As a place holder until someone wants to update this page, here is a good writeup on using destination:

    http://ronaldgibson.googlepages.com/unknowndestinationfreepbxv2.4.0beta


    Customer Database Module

    No documentation availabe. You can help by contributing to this book page.


    Day / Night Mode Control

    This module alows for the inbound routing changes to be placed via a phone call - without requiring access to the web configuration page. The module is useful for any situation where inbound routing needs to be changed by end users on-the-fly. An example of this would be a situation where an office would close early because of bad weather. In this case, just dial the appropriate feature code, and voila! all inbound calls go straight to the "night" IVR (or voice mail, or calls get forwarded to an answering service, etc.)

    Configuration

    • Day/Night Feature Code Index: This is just a descriptive number to help identify which this particular feature code
    • Description: A descriptive name for this feature code
    • Current Mode: The mode that the feature code is currently set to (is now "day" or "night"?)
    • Optional Password: A password that protects the current state (dayor night) from being toggled by unauthorized personnel.

    For an in depth tutorial, click here.


    Destinations

    Destinations are provided by various modules. If you don't have
    these modules installed, you will not see these destinations. Current
    modules are:

    Core

    Provides the ability to send a call to an Extension, or an extensions Voice Mail box directly.

    Queues

    Lets you send a call into a Queue, which is an intelligent Ring Group.

    IVR

    This lets you jump to a specific Digital Receptionist IVR.

    Time Conditions

    This lets you do the equivalent of an 'IF', and you can pick two
    different destinations depending on the time of the call. See Time
    Conditions for more information.

    Ring Groups

    A Ring Group is a group of phones that ring simultaneously or sequentially. A dumber version of Queues

    Conferences

    Lets you use a standard tele-conferencing application. Please read Conferences before using

    Misc Destinations

    This lets you enter a number, just as if you dialed it on one of
    your phones. Useful for making an "outside" number (such as a mobile
    phone) a destination.

    Custom App

    You can create your own application using the standard Asterisk
    Dialplan language in the file /etc/asterisk/extensions_custom.conf, and
    reference it with this. An example would be:

    custom-count2four

    exten => s,1,SayDigits(1234)

    exten => s,2,Hangup

    After placing this in /etc/asterisk/extensions_custom.conf, you can send callers to this by using 'custom-count2four,s,1'


    Dictate Module

    The Dictate Module will not be found in the list of modules. When loaded it adds a dictation area to the Extension
    Module. Load the module then look in an extension for 'Dictation Services'

    Dictation Services

    • Dictation Service:
      Enable or Disable with this drop down menu.
    • Dictation Format:
      This is the sound format that your dictation is saved in. Choose from: Ogg Verbis, GSM, or WAV.
    • Email Address:
      This is the email address that the completed dictations are sent to.



    To dictate enter *34 on the phone. Enter a file name with numbers followed by the pound key, for example 1234#.
    To start dictate dial 1 to switch to record mode then dial * to start recording. If you want to start over, dial 8.
    Toggle between pause and recording by dial *.
    When you are done with the recording, dial 1 to go to playback mode then dial * to start to listen to your dictation, press * to toggle pause.
    Dial 2 to toggle fast playback. Dial 7 or 8 to seek forward and reverse.

    To mail the dictation, dial *35 then enter your file name used previously.


    DISA

    Overview

    DISA (which stands for Direct Inward System Access) allows you to
    provide an internal dialtone to external callers. When you configure a
    DISA destination, you can use it as a menu destination within a Digital
    Receptionist, so that you can get an internal Asterisk dialtone. This
    means you could call into your Asterisk system and dial out as if you
    were using an extension connected to the Asterisk box itself.

    The security implications of DISA are obviuous! Make sure you have a proper authentication scheme in place so that unautherized callers cannot abuse your system!

    Changelog

    V2.0 - Added Response Timeout, Digit Timeout and Reuqire Confirmation

    Configuration

    • DISA Name: A friendly name to help you identify the DISA destination.
    • PIN: A code required to be input by the
      remote user to access the dialtone. You should always require a PIN for
      security purposes! You can, if you must, leave it blank. The voice
      prompt will still say 'Enter Password', but you won't need to. This is
      on the list of minor annoyances that need to be fixed.
    • Caller ID: You can change the outgoing caller ID for this DISA by setting an override value.
    • Response Timeout: The maxium amount of time it will wait before hanging up if the user has dialed an incomplete or invalid extension
    • Digit Timeout: The maximum time delay between digits
    • Require Confirmation: Before prompting for
      password, it will say 'Press 1' every 3 seconds until a digit
      (anything, it doesn't have to be '1') is pressed. It will then continue
      on and ask for a password. This is mainly useful if dialling out
      through a device (eg, X100P, TDM400, or a poorly configured VSP) that
      doesn't tell you when the call is actually answered.
    • Context: By default, internal context
      (from-internal) is used. You could provide a custom context to limit
      the access for this DISA. (Only for the experienced)
    • Allow Hangup:When checked allows the current call to be ended and return the
      caller to the dial tone by pressing the Hangup feature code. (**)


    DUNDi Lookup and Extension Registry Proxy

    DUNDi Lookup and Extension Registry Proxy
    This module provides a proxy for the extension registry feature in FreePBX. If you have a DUNDi trunk configured in FreePBX to other branch offices, and a route defined to access it, then this module will proxy and check for extension number duplication in other branch offices when creating new extensions, ringgroups or any other extension that can be dialed.
    The module does not consider the outbound dialing rules. It simply checks the DUNDi cloud down all configured DUNDi routes, and if another system indicates they have that extension, then it will consider this a conflict and report it back as such since a change in routing rules would easily expose this conflict.
    As a secondary function, the module allows you to easily check for numbers present within the configured DUNDi routes in a simple GUI page.


    Extensions

    Information

    This area is for handsets, softphones, paging systems, or anything
    else that could be considered an 'extension' in the classical PBX
    context.

    Overview

    Defining and editing extensions is probably the most common task
    performed by a PBX administrator, and as such, you'll find you'll
    become very familiar with this page. There are presently four types of
    devices supported - SIP, IAX2, ZAP and 'Custom'. This page also
    configures how voicemail is handled on a per-extension basis.

    Adding a new extension

    Phone Protocol

    Pick one of SIP, IAX, ZAP or Custom

    • SIP is the Standard protocol for VoIP handsets and ATA's. The Session Initiation Protocol (SIP) is a signalling protocol, widely used for setting up and tearing down multimedia communication sessions such as voice and video calls over the Internet.
    • IAX is 'Inter Asterisk Protocol', a newer protocol supported by only a few devices (eg, PA1688 based phones, and the IAXy ATA)
    • ZAP is a hardware device connected to your Asterisk machine - Eg, a TDM400, TE110P.
    • Custom is a 'catch all', for any non standard device, eg
      H323. It can also be used for "mapping" an extension to an "outside"
      number. For example, to route extension 211 to 1-800-555-1212, you
      could create a custom extension 211 and in the "dial" text box you
      could enter: Local/18005551212@outbound-allroutes

    Extension Number

    This must be unique. This is the number that can be dialled from any other extension, or directly from the Digital Receptionist if enabled. This

    may be any length, but conventionally a three or four digit extension is used.

    CID Num Alias

    The CID Number to use for internal calls, if different from
    the extension number. This is used to masquerade as a different user. A
    common example is a team of support people who would like their internal
    callerid to display the general support number (a ringgroup or queue).
    There will be no effect on external calls.

    SIP Alias

    If you want to support direct sip dialing of users internally
    or through anonymous sip calls, you can supply a friendly name that can
    be used in addition to the users extension to call them.

    Secret, aka 'Extension Password'

    This is the password used by the telephony device to authenticate
    to the Asterisk server. This is usually configured by the administrator
    before giving the phone to the user, and is usually not required to be
    known by the user. If the user is using a soft-phone, then they'll need
    to know this password to configure their software.

    NAT

    very important to set this to 'yes' if you want to be able to use
    your phone behind a nat firewall seperate from the lan that your
    asterisk box is on.

    Disallow

    disallow any codec you do not want to use. common setting for this
    if you want to make sure a device only uses the codec set in the allow
    section is "all" (without the quotes).

    Allow

    allow a codec of your choice. primarily as an example i would use
    "g729" or "GSM" (without the quotes), only one codec can be set here.
    This is usefull if used with the disallow option set to "all" and you
    set the definitive codec you want to use on allow, garunteing that you
    will use that codec.

    Mailbox

    This option allows you to set what mailbox you would like to use.
    Normally you would use 'your extension'@device . but if you want to say
    have an extension's phone's light or dial tone indicate when a
    different box has voicemail you can set it to 'extension vm'@device. so
    say extension 1002 wants to know when 1001 has vm, then set this to
    1001@device on 1002's mailbox setting.

    Record Incoming

    Option to record the calls received on this extension. There are three options:

    • Always
    • Never
    • On-Demand (User can dial '*1' to enable whilst in a call)

    Record Outgoing

    Same as above but for outgoing calls

    Voicemail and Directory

    Selecting 'Disabled' turns off voicemail for this extension totally, and these further options are hidden.

    Voicemail Password

    This is the password used to access the voicemail system (*98). It
    can be changed by the user when they log into their voicemail (after
    logging in, they dial 0 then 5).

    Email Address

    The address that voicemails notifications will be sent to

    Pager email address

    This email address will be sent a small message notifying of voicemail messages, suitable for an email-to-pager service.

    Play CID

    Read back caller's telephone number prior to playing the incoming
    message, and just after announcing the date and time the message was
    left.

    Play Envelope

    Envelope controls whether or not the voicemail system will play
    the message envelope (date/time) before playing the voicemail message.
    This settng does not affect the operation of the envelope option in the
    advanced voicemail menu.

    Delete Vmail

    If set to "yes" the message will be deleted from the voicemailbox
    (after having been emailed). Provides functionality that allows a user
    to receive their voicemail via email alone, rather than having the
    voicemail able to be retrieved from the Webinterface or the Extension
    handset.

    CAUTION: You must have email attachment set to yes if you
    don't want your voicemail system to email you a notification saying
    'You have a voicemail' and then immediately delete the voicemail.
    Make sure you've fully tested voicemail-to-email before you turn this on. See Email Problems for hints.


    Feature Codes

    Note: The following are from Asterisk@Home 2.7

    extensions.conf

    *411 — Directory

    *78 — Do Not Disturb activate

    *79 — Do Not Disturb deactivate

    *98 — Check voicemail (enter extension)

    *98nnn — Check voicemail (extension nnn)

    *97 — Check voicemail (for calling extension)

    *70 — Call Waiting activate

    *71 — Call Waiting deactivate

    *72 — Call Forward activate

    *73 — Call Forward deactivate

    *90 — Call Forward on Busy activate

    *91 — Call Forward on Busy deactivate

    *69 — Call trace

    *11 — Log in (not used for fixed devices)

    *12 — Log out (not used for fixed devices)

    888 — Barge-In (unconfirmed, please update wiki)

    8nnn — Meet-Me conferencing (nnn = 1 to 4-digit extension number)

    *77 — Record announcement

    *99 — Playback announcement

    7777 — Simulate incoming voice call

    666 — Simulate incoming fax call (unconfirmed, please update wiki)

    *43 — Echo test

    extensions_custom.conf

    *60 — Time

    *61 — Weather

    *62 — Wakeup call

    *65 — Playback extension

    300 3nn 91npanxxxxxx — Set speed dial nn to 9-1-NPA-NXX-XXXX

    3nn — Dial speed dial entry nn

    *3nn — Listen to / dial speed dial entry nn

    features.conf

     

    #70 — Call Parking (Will park call on ext#71-79 and announce)

     


    Follow Me

    Follow-Me settings are just like a mini Ring Group, but it's tied directly to your extension. It's configured exactly the same way as a ring group, including the ability to use an announcement to alert people that they're being transferred elsewhere.

    The dialplan has been structured such that any place where one might dial to ring an extension, the Follow-Me ringgroup will be engaged if it is defined. This means that from an IVR calling from outside and internally when dialing an extension you will reach the ring group in place of the extension. This behavior is enabled by simpling including the ext-findmefollow context ahead of the ext-local context any place that extensions are dialed.

    There are other 'creative' uses of the Follow-Me function. At the simplest, you can simply put in the extension of the Follow Me number with a choice to go to its voicemail if not answered and you will be accomplishing exactly the same thing as if the extension was being dialed. However, you can now diverge with such simple things as changing your ring time to override the default, adding an announcement, going to an alternative voicemail or other destination if not reached, and of course adding multiple numbers and ring strategies when someone tries to call that number.


    FreePBX 2.3 Screen Shots

    This page contains Screen Shots from many common FreePBX Version 2.3 Module Screens


    Adding Extensions

    Adding Extensions

    Digital Receptionist

    Digital Receptionist

    Edit Administrator

    Edit Administrator

    Edit Recording

    Edit Recording

    FreePBX System Status Dashboard

    FreePBX System Status Dashboard

    IVR Editing

    IVR Editing

    Miscellaneous Applications

    Miscellaneous Applications

    System Recordings

    System Recordings

    FreePBX Framework Module

    The FreePBX Framework module is not like other modules on the system. Its purpose is to provide a mechanism to upgrade the overall Framework of FreePBX as described below.

    Simple FreePBX Architecture Description

    FreePBX is a modular architecture that can easily be extended with new modules to add functionality to the main system or extend existing functionality. In the absence of any module being loaded, there is still a foundation of code that is required to enable the system. This code base is referred to as the FreePBX Framework. Once the Framework is loaded, the system requires a minimal set of modules to provide any useful functionality. These include Core as well as a handful of other Key modules without which the system will not properly function. When FreePBX is initially installed, these modules are all installed at that time.

    Module Administration in Framework

    Part of the Framework code is the Module Administration Page. Once you have a Framework loaded, Adding modules is fairly straight forward. Under the covers, FreePBX simply explodes a module's tarball into the modules directory and then executes any included install scripts that the module requires.

    Framework as a Module

    In order to provide a mechanism that upgrades the Framework code, it was previously necessary to manually download a new version's tarball and then run install_amp which would upgrade you to that new version. Running install_amp is effectively takes files form the tarball and copies them onto the framework code in a similar manner to installing a module. (It does a bit more, but that is out of the scope of this description). The Framework module does effectively the same thing as install_amp. After being loaded by Module Admin it has a directory structure that is very similar to what you would see when untarring a FreePBX tarball. The Module Administration code then executes Framework's install script as if it were just another module. (As far as it know, it is just another Module). The install code proceeds to do almost the same thing that install_amp does resulting in all the Framework files being updated, and any incremental upgrade scripts being run. (It shares the same libraries as install_amp so it is basically the same code running.

     


    FreePBX System Status

    No documentation availabe. You can help by contributing to this book pate.


    FreePBX Users & Devices

    Description
    FreePBX phone extensions are actually made up of two components which are not visible when you are running in the FreePBX default Extensions mode. However, each extension is made up of one FreePBX User and then zero or more devices. The number that you dial the user at is always the same and will typically be referred to as their extension number. That extension number can then be permanently associated with a fixed device in addition to being able to login to an adhoc device. Once logged into a device, it becomes that user's extension until logged off. It will use their CID and Outbound CID, DID's associated with that user will be routed to that device (and any others they are associated with), Voicemail MWI will display on that device, etc.
    Details
    THIS PAGE NEEDS TO BE WRITTEN, IT SHOULD COVER BOTH USERS AND DEVICES MENU ITEMS


    Gabcast

    No documentation availabe. You can help by contributing to this book pate.


    General Settings

    Dialling Options

    Aterisk Dial Command Options: See below.
    Asterisk Outbound Dial Command Options: See below.

    Dial command options

    The most common options are 'tr', which means 'The person
    receiving the call can transfer a call using #' and 'Generate ringtones
    when an extension is ringing'. Other useful options are (Note, this
    list is very incomplete. The complete list of options is huge and can
    be seen by typing 'show application Dial' in the asterisk console):

    • A(x) -Play an announcement to the called party, using 'x' as the file.
    • D([called][:calling]) - Send the specified DTMF strings
      *after* the called party has answered, but before the call gets
      bridged. The 'called' DTMF string is sent to the called party, and the
      'calling' DTMF string is sent to the calling party. Both parameters can
      be used alone.
    • h - Allow the called party to hang up by sending the '*' DTMF digit.
    • H -Allow the calling party to hang up by hitting the '*' DTMF digit.
    • r - Indicate ringing to the calling party. Pass no audio to the calling party until the called channel has answered.
    • t - Allow the called party to transfer the calling party by sending the DTMF sequence defined in features.conf.
    • T - Allow the calling party to transfer the called party by sending the DTMF sequence defined in features.conf.
    • w - Allow the called party to enable recording of the call by
      sending the DTMF sequence defined for one-touch recording in
      features.conf.
    • W - Allow the calling party to enable recording of the call
      by sending the DTMF sequence defined for one-touch recording in
      features.conf.


    Voicemail

      Number of seconds to ring phone before sending callers to voicemail

      This is reasonably self explanitory, except this number is also
      used in Ring Groups to determine the amount of time each phone will
      ring in a 'hunt' or 'memoryhunt' ring group. Setting 'Ring Time' in the
      Extensions Module will have precedence over this setting. Generally there are
      5 seconds per ring, so 20 seconds would be 4 rings.

      Extension prefix for dialing direct to voicemail

      Dialing this before an extension will not ring the extension, but send you directly to this person's voicemail box.

    Company Directory

    The company directory is reached by dialling '*411', or a user pushing '#' (if enabled) whilst in an IVR.

      Find users in the Company Directory

      When searching the Directory, this lets you chose wether it's searched by First name or Last name.

      Play extension number

      Plays a message "Please hold while I transfer you to extension
      xxx" that lets the caller know what extension to use in the future. to
      caller before transferring call. Useful if you have an indial range, or
      wish to let users know which extension they can dial directory from the
      IVR.

      Operator Extension:

      This is the number the callers (both internal users and callers calling in from the outside) will dial to get to the operator.

     


    Inbound Routes

    Information

    The 'Inbound Routes' page lets you configure which destination
    FreePBX uses for calls coming from Trunks. When a call is recieved by
    Asterisk from a trunk, the DID and/or Caller ID is matched and the call
    is dispached as per your settings.

    DID Number

    For a SIP or IAX peer, this is usually your Account Number. If you
    have an account of '888123123', putting that in here will match calls
    coming from that provider. Leaving this blank will match 'any'.

    CID Number

    The Caller ID number sent to your machine. This is not something
    you should trust, as it is easily spoofable (both with Voice over IP
    and normal telephone lines). Leaving it blank will, again, match any.

    You can leave both of these blank to match any call, from any caller.

    Fax Handling

    With these two options, you can manage the way faxes are received
    over this trunk. Note that VoIP and Faxing does not work well together,
    and you most probably will have problems.

    Privacy Manager

    Turn this on to ask for the callers Caller ID if not provided.
    This is useful for telemarketers, as they are loathe to divulge this
    information and will usually hang up.

    Options

    Immediate Answer

    This picks up the phone as soon as it rings (With Zaptel lines,
    this happes after the Caller-ID is received, which may be up to three
    rings). It then generates any further 'ring' tones, if required, down
    the audio channel. Note that if you're using G729 or GSM, the rings
    will sound funny to the caller.

    Pause After Answer

    The number of seconds we should wait after performing an Immediate
    Answer. The primary purpose of this is to pause and listen for a fax
    tone before allowing the call to proceed.:

    Alert Info

    ALERT_INFO can be used for distinctive ring with certain SIP
    devices. The standard names are 'Bellcore-dr1' to 'Bellcore-dr7', Snom
    phones can additionaly use a http:// url of a WAV or MP3 file.

    Set Destination

    This is a standard destination option group.


    Inventory Database

    No documentation availabe. You can help by contributing to this book pate.


    IVR (Digital Receptionist)

    Information

    The 'Digital Receptionist' page is the interface used to setup
    your auto attendant when people call your business or home. Normally
    heard as "Thanks you for calling MYBUSINESS, for Sales press 1, for
    Service press 2", etc.

    Getting Started

    • For Pre-freePBX 2.1 IVR's, see (history)

    When you select Digital Receptionst, 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'.

    Naming your 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.

    Your options are reasonable self-explanitary:

    • 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" title="Multiple pages with this name">feature code for Directory from IVR and access the Directory service.
    • 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'

    Configuring your IVR

    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 is the destination used when a
      caller enters an invalid option - if you only have 1 2 and 3 defined,
      and they push 4, it will jump to this destination. The default option
      for this, ff you don't supply an 'i' destination, its to replay the
      current menu. If they hit 'i' more than three times, the call is hung
      up.
    • t: This is the destination used when
      nothing happens. You might wish to have this one go directly to an
      operator, in case the caller doesn't have a DTMF phone. As with 'i',
      the default is to replay, and if it's been replayed three times, hang
      up.

    Note that with freePBX 2.1, Destinations are only displayed if there is at least one entry in there. So if, for example, you have the DISA module enabled, but no DISA entries, it will not appear in the list.

    The rest of the page should be self explanitory. 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.


    Java SSH Terminal

    No documentation availabe. You can help by contributing to this book pate.


    Miscellaneous Destinations

    Overview

    Misc Destinations allow you to use anything you could dial from a standard extension as a destination.

    Example

    You might want to have an IVR option that is 'If you want to speak
    to rob, you can connect to his mobile by pushing 2', and having a Misc
    Destination of

    • Rob's Mobile
    • 00402077155 (Note the leading 0, as that's what I use for an 'external' call)

    Then in the IVR menu, you simply select 'Rob's Mobile' as a destination, and it will connect the caller through.


    Music On Hold

    Information

    Here you can configure the Music On Hold files that will be
    played. You can configure various 'Classes' of Music on Hold, which are
    used in Queues. The idea behind that is your 'default' MOH is standard
    music, and your various queues can have different 'hold' music while
    they're waiting.

    Uploading a file

    Simply select 'browse' and pick a MP3 file on your system. Then click 'Upload'. It will appear in the list of MOH files below.


    Add Streaming Catagory

    With the release of FreePBX 2.5, Music On Hold comes with the new feature "Add Streaming Catagory." This addition to the Music On Hold module allows the Integrator to offer MOH streamed from the Internet or via the Line IN port on a sound card as a catagory.

    In this example a Police Scanner is connected to a Line In port on a FreePBX 2.5.0 / Asterisk 1.4.21.2 system.  The directions used to get Audio in and available are located here - http://www.sthomas.net/go/blog/view/38 NOTE: Skip editing musiconhold_X.conf. Use the GUI.

    Music On Hold Module

    This example uses a scirpt created in /usr/sbin/ called "ast-playlinein" and it is used to control the parameters of "arecord" which is the program doing the heavy lifting here. Pointing at the script was all that was needed.

    Streaming Catagory

    Streaming from the Internet is not that different. A good link to get started is http://www.voip-info.org/wiki-Asterisk+config+musiconhold.conf

     


    Online Support


    Online support offers you two links, one to this Wiki, the other to a built-in IRC client

    IRC Online Support


    Clicking on this loads a Java IRC client, which connects to the
    FreeNode? IRC network, and joins the '#freepbx' channel, where most of
    the developers are.


    NOTE

    When you join the IRC channel, the FreePBX version you're using,
    and the kernel version of your machine will be sent to everyone in the
    channel automatically. This is to assist developers with diagnosing any
    problems you have, but also may cause you to have privacy concerns. If
    you do not wish this information to become public, DO NOT USE THIS
    CLIENT.


    Outbound Routes

    Information

    Outgoing calls are sent over trunks as determined by the
    configuration of the Outbound Routing page. This is designed to be as
    flexible as possible, and allows for fall-through and multiple paths -
    eg, Least Cost Routing!

    Adding a Route

    Route Name

    This is simply a descriptive name for the trunk, which will be shown on the right hand side of the screen.

    Route Password

    If this route is hit by a caller, and this is not empty, they will
    be prompted for a password. If they get the password incorrect, the
    call will be dropped, and will not try for a match on any further
    trunks.

    Emergency Dialling

    Settnig this means that this route is used for 'Emergency' calls.
    If you wish to have a different caller ID send for this call (eg, when
    you're dialling 000/911/999), turn this on. Any calls matching this
    dial pattern will use the Caller ID specified in Emergency CID rather
    than the usual Outbound CID in Extensions.

    Dial Patterns

    A Dial Pattern is a unique set of digits that will select this trunk. Enter one dial pattern per line.

    Rules:

    • X - matches any digit from 0-9
    • Z - matches any digit form 1-9
    • N -matches any digit from 2-9
    • [1237-9] - matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
    • . - wildcard, matches one or more characters
    • | - seperates a dialing prefix from the number (for example,
      9|NXXXXXX would match when some dialed "95551234" but would only pass
      "5551234" to the trunks)

    Examples

    • 000
      • Only use this route if the user has dialled '000' exactly.
    • 9|911
      • Only use this route if the user has dialled '9911', but take off the 9 before sending it to the trunk
    • 0|.
      • Any number that starts with 0, use this route

    Trunk Sequence

    When this route is matched by the Dial pattern above, trunks are
    tried in the order listed here. Note that if you have a password
    protected trunk, and the caller gets the password wrong, it does not
    proceed to the next trunk. Make sure you click 'Add' after adding the
    trunk, and before you click 'Submit'.


    Paging and Intercom

    Information

    Paging lets you, with phones that support it, do a 'Page' - you
    dial a number, and all the phones in the group pick up automatically,
    go into hands free, and play through their speaker what the caller is
    saying. This is very useful in a small office environment ("Pizza is at
    reception!"). To add a paging group, simply put in the Paging group
    number - this is the number that people will dial to page the group,
    and the list of devices, one per line, that are to be paged.

    Note that Intercom is not currently supported

    Supported Phones

    Snom Phones

    To enable paging, under 'Advanced', select 'Enable Intercom', and 'Dialog-Info Call Pickup'

    GXP-2000 Phones

    Select the line you use to register to the FreePBX machine, and
    enable 'Allow Auto Answer by Call-Info' and 'Turn off speaker on remote
    disconnect' (otherwise it will beep with a busy tone eternally when the
    page is finished)

    Aastra 480i

    Appears to support it out of the box.

    Aastra 9133i

    Appears to support it out of the box. Tested with FreePBX v2.1.1 and Aastra firmware v1.4

    Polycom 301, 501?, 601

    You MUST provision the phone from a FTP server to
    load the Polycom config files, then edit sip.cfg, search for
    "alertInfo" and set "voIpProt.SIP.alertInfo.1.value" to equal "Ring
    Answer". Now reboot your phone to load the new config option.

    for example:

    <alertInfo voIpProt.SIP.alertInfo.1.value="Ring Answer" voIpProt.SIP.alertInfo.1.class="4"/>

    Uniden UIP200

    Does NOT support auto answer as of firmware 4.77

    Swichvoice IP10S

    Appears to support it out of the box, I updated the firmware before testing this feature. ( IP10 SP v1.0.1 (Build 3)

    Asterisk Console

    To use the asterisk console as a paging extension (for example, if
    you have overhead speakers plugged into your sound card), add a new
    custom extension with "console/dsp" as the dialstring. You'll have to
    assign this an extension number, but then you can use it in the paging
    module. Note that as of FreePBX 2.2 (currently in svn) there is special
    handling for this extension type, and a beep will be played when it
    first answers.

    Other phones

    Please fill in information for any other phone you have working.


    Comments




    Paging to Grandstream no longer works properly

    by versodom, Monday 28 of August, 2006 [07:03:09]

    Somone modified the page function, and the GXP-2000 Phones do not work
    properly anymore while paging. I have provided a temp fix untill this
    is sorted out.

    If you add the following in extensions_custom.conf, then when you
    dial 7243 or "PAGE" on your phone you will get a 2 way page on the SIP
    extensions as entered below.

    (You will need to change the SIP extensions entered below, to the ones you want to use for paging. )

    If you want one way paging to many phones dial 7241 or "PAG1".

    For simplicity, I assigned one of the programable buttons on all of my Grandstream GXP-2000's to dial 7243.

    from-internal-custom

    exten => 7243,1,SIPAddHeader(Call-Info: answer-after=0)

    exten => 7243,2,Page(SIP/6331&SIP/5481&SIP/3361&SIP/6271&SIP/2741&SIP/7461&SIP/8431|d)

    exten => 7243,3, Hangup

    exten => 7241,1,SIPAddHeader(Call-Info: answer-after=0)

    exten => 7241,2,Page(SIP/6331&SIP/5481&SIP/3361&SIP/6271&SIP/2741&SIP/7461&SIP/8431|)

    exten => 7241,3, Hangup


    Parking Lot

    This module allows you to configure all the normal features.conf settings for the parking lot functionality of Asterisk.

    These include:

    • Enable/Disable the feature (while retaining settings)
    • Parking Lot Extension
    • Number of Parking Lot slots
    • Parking Timeout before the call is returned to the orignal parker if not picked up
    • Parking Lot Context (for advanced use)

    The more useful part of this module is to specify a destination for
    parked calls that get orphaned. This can occur if the call is not
    picked up and for some reason the original parker can not be reached.
    (e.g. the original parker is on the phone and does not have call
    waiting or ignores it). In this case, call is diverted to the chosen
    destination which is any of the standard destinations provided in all
    modules that include such an option. Prior to sending the call to that
    destination, you can configure the following options to further
    identify the orphaned all:

    • Parking Alert-Info (to provide a unique ring for the returned call)
    • CallerID Prepend (to identify the call with additional CID information)
    • Announcement (to be played to the orphaned caller to reassure them that you are trying to get them back to someone)

    Parked Calls with BLF indicator light. -teknoprep- (you know you love me)

    i have got this to work on my GXP-2000 phones using trixbox 1.1.1
    on vmware with 1.2.12.1 compiled asterisk. so if you follow these
    instructions you should be good to go. This tid bit of bash commands
    was taken from X-Rob's lesson on
    http://www.freepbx.org/2006/09/28/un-trixbox-your-trixbox/ .

    • important.. IF YOU RUN VMWARE... do not do the first 2
      lines... NEVER run yum on your vmware box for updates if you run a
      trixbox vmware image. CentOS 4.4 does not cooperate well with vmware.



    yum -y install kernel-smp-devel

    yum -y update

    sed -i s/enabled=1/enabled=0/ /etc/yum.repos.d/trixbox.repo

    rm -rf /usr/sbin/safe_asterisk /usr/lib/asterisk/modules/app_trunkisavail.so

    cd /usr/src

    wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.12.1.tar.gz

    wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.9.1.tar.gz

    wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.3.tar.gz

    wget http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.2.4.tar.gz

    tar zxvf asterisk-addons-1.2.4.tar.gz

    tar zxvf libpri-1.2.3.tar.gz

    tar zxvf zaptel-1.2.9.1.tar.gz

    tar zxvf asterisk-1.2.12.1.tar.gz

    cd libpri-1.2.3 && make install

    cd ../zaptel-1.2.9.1 && make install

    cd ../asterisk-1.2.12.1 && make install

    cd ../asterisk-addons-1.2.4 && make install

    asterisk -rx "stop now"

    /etc/init.d/zaptel restart

    amportal start



    Don't forget to hit enter at the last line.

    Now, lets get BLF working for Parked Calls.

    cd /usr/src

    wget http://aussievoip.com/storage/users/315/315/images/179/metermaid-1.2.7.1...

    cd asterisk-1.2.12.1

    patch -p0 < /usr/src/metermaid-1.2.7.1.txt

    make

    make install

    asterisk -rx "stop now"

    /etc/init.d/zaptel restart

    amportal start

    Now lets edit some files

    nano /etc/asterisk/extension_custom.conf

    add this to the file

    exten => _*3, 1, ParkAndAnnounce(pbx-transfer:PARKED|120|SIP/${DIALEDPEERNUMBER}|sip_incoming,${DIALEDPEERNUMBER},1)

    ;the line above this, NEEDS TO BE ON ONE LINE... not on 2

    exten => 701,1,ParkedCall(701)

    exten => 701,hint,Local/701@parkedcalls

    exten => 702,1,ParkedCall(702)

    exten => 702,hint,Local/702@parkedcalls

    exten => 703,1,ParkedCall(703)

    exten => 703,hint,Local/703@parkedcalls

    exten => 704,1,ParkedCall(704)

    exten => 704,hint,Local/704@parkedcalls

    Save the file and now lets edit another file

    nano /etc/asterisk/features.conf

    now it should look something like this when you are done in the General context

    parkext => 700 ; What ext. to dial to park

    parkpos => 701-704 ; What extensions to park calls on

    context => parkedcalls ; Which context parked calls are in

    parkingtime => 5000 ; Number of seconds a call can be parked for (default is 45 seconds)

    • the important part is for the parkext to = 700 and the
      parkpos to be 701 and up.. usually i would only need 4 parking lots for
      now since most phones just don't have enough buttons to support more...
      but hey you can do whatever you need.

    now lets use it

    when a call comes in you press Transfer - *3... this will park the
    call... the asterisk box will call you back and tell you where its
    parked... First call parked always goes to 701.

    now on your phone setup one of your button light indicators for

    Asterisk BLF 701

    Asterisk BLF 702

    Asterisk BLF 703

    Asterisk BLF 704

    (this is how i did it on my gxp-2000)

    now when a call gets parked anyone with this setup will see the
    light indicator light up for any of the 4 parking lots... this will
    give you the ability to have the call picked up from anywhere on the
    system that has this setup... just press the button.

    • Problems - when i first boot up my GXP-2000 the lights for
      the BLF of Parked Calls will light up even tho no calls are parked...
      this will change once a parked call is picked up on that lot. (2) If
      you restart asterisk in any way... it seems that parked BLF stops
      working... ANYONE have a fix for that?

    Phone Book and Phone Book Directory

    No documentation available. You can help by contributing to this book pate.


    PHP AGI Library Configuration

    No documentation available. You can help by contributing to this book pate.


    PHP Configuration Information

    No documentation available. You can help by contributing to this book page.


    PIN Sets


    PIN Sets are a module that allow you to use a range of PIN's, rather than just one. This is currently only used by Trunks, but it potentially could be used in DISA or anything else that uses PIN's for authentication.

     


    Print Extensions

    This module will print a list of users and extensions. Handy for creating a company directory listing quickly.



    Queue Priorities

    Queue Priorities
    This page needs writing, please contact us if you would like to write this page.


    Queues

    Information

    Queues allow you to manage a large number of incoming calls, as
    you would expect to have in a Call Center. This is very intelligent
    application, and as such, it has a lot of configuration options.

    Queue Setup

    Queue Number

    This is the number that can be dialled from any extension to be
    put into the queue. This is also the same number you use when selecting
    a destination. Agents (eg, the people receiving the call) log in and
    out of the queue by dialling the number then a single asterisk to log
    in, or two asterisks to log out (eg, 700* to log in, 700** to log out)

    Queue Name

    A short name for the queue. This is only used in the web interface for ease of identification.

    Queue Password

    If you are concerned about security, you can put a password on the
    queue to stop just anyone from logging into it. After the Agent tries
    to log in, he or she will be prompted for the password here.

    CID Name Prefix

    As an agent may be logged into more than one queue, it can be
    useful to have a prefix on the Caller ID seen on the agent's phone, so
    he or she knows which queue the call is coming from - eg, 'Sales:' or
    'Tech:.

    Static Agents

    These are devices that are always logged into the queue. This is
    useful if you have an agent that is not directly connected to the
    FreePBX PBX, but is telecommuting. You can put their number in as it
    would be dialled from an internal extension. (Note that his has changed from AMP
    — You used to need to prefix the number with a #. This is no longer
    needed). The number will be routed as if it was dialled from a normal
    extension, so dial rules in Outbound Routing and trunks are matched as
    per normal.

    Queue Options

    Agent Announcement

    This is an announcement that is played to the Agent prior to
    connecting in the caller. An example could be: "the Following call is
    from the Sales Queue" or "This call is from the Technical Support
    Queue". This is useful when agents don't have Caller-ID on their phone,
    or don't look at it for the CID Name Prefix. These recordings are
    managed by System Recordings.

    Hold Music Category

    This is the category of Music (or Commercial) played to the caller
    while they wait in line for an available agent. Categories are set up
    in On Hold Music

    Max Wait Time

    The maximum number of seconds a caller can wait in a queue before
    being pulled out and set to the destination beow. Set to 0 for
    unlimited, but that's not recommended.

    Max Callers

    The maximum number of people permitted to wait in the queue. If
    this number is reached, any further people will be sent straight to the
    destination below.

    Join Empty

    If you wish to allow callers to join queues that currently have no agents, set this to yes. This is not recommended.

    Leave When Empty

    If you wish to remove callers from the queue if there are no
    agents present, set this to yes. If you have agents logging in and out
    all the time, you may wish to set this to 'no', otherwise a good idea
    is to set this to yes - everyone's gone home, and didn't get around to
    answering the customer.

    Ring Strategy

    There are 6 ring patterns to chose from:

    • ringall: ring all available agents until one answers (default)
    • roundrobin: take turns ringing each available agent
    • leastrecent: ring agent which was least recently called by this queue
    • fewestcalls: ring the agent with fewest completed calls from this queue
    • random: ring random agent
    • rrmemory: round robin with memory, remember where we left off last ring pass

    Agent Timeout

    The number of seconds an agents phone can ring before we consider it a timeout.

    Retry

    The number of seconds we wait before trying all the phones again

    Wrap-up-time

    After a successful call, how many seconds to wait before sending a
    potentially free agent another call. The default is 0, or no delay.
    You'll probably have grumpy agents with that. Try setting it to 30
    seconds.

    Call Recording

    Incoming calls to agents are recorded. They are saved to /var/spool/asterisk/monitor.

    Caller Announcements

    Frequency

    How often to announce queue position, estimated holdtime, and/or
    voice menu to the caller. Set to 0 to Disable Announcements totally.

    Announce Position

    Set to 'Yes' to announce position of caller in the queue.

    Announce Hold Time

    Should we include estimated hold time in position announcements?
    Either yes, no, or only once; hold time will not be announced if it's
    estimated to be less than 1 minute.

    Voice Menu

    After announcing Position and/or Hold Time, you can optionally
    present an existing Digital Receptionist Voice Menu - eg If you'd like
    to leave your name and number for a call back, please push * now. This
    will not effect your position in the queue. This voicemenu must only
    contain single-digit 'dialed options'.

    Join Announcement

    The announcement played to callers once prior to joining the queue. These recordings are managed by System Recordings.

    Fail Over Destination

    This is a standard destination that is used in an overflow/timeout condition, which is configured above.


    Ring Groups

    Information

    This defines a 'virtual' extension that rings a group of phones
    simultaneously, stopping when any one of them is picked up. This is
    basically just a dumber version of Queues for those that don't need the
    extra functionality of it.

    Add Ring Group

    Group Number

    This is the number that is dialled from any extension that will make all of the phones in the group ring.

    Ring Strategy

    • ringall: ring all available channels until one answers (this is the default)
    • hunt: take turns ringing each available extension
    • memoryhunt: ring first extension in the
      list, then ring the 1st and 2nd extension, then ring 1st 2nd and 3rd
      extension in the list.... etc.

    Extension List

    List extensions to ring, one per line. You can include an
    extension on a remote system, or an external number by suffixing a
    number with a hash (#). ex: 2448089# would dial 2448089 on the
    appropriate trunk (see Outbound Routes)

    CID Name prefix

    You can optionally prefix the Caller ID name when ringing
    extensions in this group. ie: If you prefix with "Sales:", a call from
    John Doe would display as "Sales:John Doe" on the extensions that ring.
    (Note, you can't use a space here.)

    Ring Time

    How long (in seconds) the group of phones will ring before
    'failing' and doing the options specified below. This is not related to
    the 'hunt' ring strategy above, but is the total length of time a call
    will stay in the group before using the 'Destination if no answer'
    selection.

    Destination if no answer

    This gives you a selection of things to do when the call exceeds
    the 'Ring Time' specified above. Options may be added and removed from
    this list depending on the modules that are installed. See Destinations for more information.


    System Recordings


    System Recordings are used in Ring Groups and Conferences for various announcements.


    Uploading a file


    If you're uploading a .wav file directly, it needs to be saved as a 'PCM Uncompressed' 8000hz 16bit mono file.


    Time Conditions

    Information

    Time Conditions are a module that appears as a destination when
    installed. It allows you to do an 'if' based on the current Time,
    Weekday, Day of the Month, or Month. At the moment it's reasonably
    basic with no support for 'AND' or 'OR', but you can chain together
    time conditions to do the same thing.

    Time Condition Name

    A short name which is used to identify the Time Condition in a destination.

    Time Condition

    Select from the pull down menus the time range that you want to use. Note that '-' means 'Any'.

    Destinations

    You have a choice of two destinations,
    depending on wether the time is matched or not. You can chain together
    time conditions to get an 'OR' or 'AND' effect. Unfortunately, there's
    no easy way to do that... at the moment!

    Example of OR

    Lets say you want Monday to Friday, 9am to 5pm or Saturday 9am to 12pm to go to IVR1, whilst all the rest of the time, it goes to IVR2.

    • Timecond1 Match Mon-Fri, 9am-5pm
      • True: Goto IVR1
      • False: Goto Timecond2
    • Timecond2: Match Sat, 9am-12pm
      • True: Goto IVR1
      • False: Goto IVR2

    Example of AND

    On Between 9am and 5pm on Monday and Wednesday, go to IVR2. Otherwise go to IVR1.

    • Timecond1: Match 9am-5pm
      • True: Goto Timecond2
      • False: Goto IVR1
    • Timecond2: Match Monday
      • True: Goto IVR2
      • False: Goto Timecond3
    • Timecond3: Match Wednesday
      • True: Goto IVR2
      • False: Goto IVR1

    Time Groups

    Time Groups
    Needs Content, please contact us if you would like to help write this page.


    Trunks

    What are trunks?

    You use a trunk to carry a call (or any number of calls) to a VSP
    or a device that cares about what number you send to it (eg, another
    Asterisk/FreePBX Machine). There are 5 types of trunks supported:

    • Zap Trunk
    • Define-IAX2 Trunk
    • SIP Trunk
    • Define-ENUM Trunk
    • Custom Trunk

    All the trunks are configured mainly in the same way:

    General Settings

    Outbound Caller ID

    Setting this option will override all clients' caller IDs for calls placed out this trunk. The format is

    "caller name" <#######>

    Leave this field blank to simply pass client caller IDs. Quotes are optional around the caller name, but highly recommended.

    Never Override CallerID

    Some VoIP providers will drop the call if you try to send an invalid CallerID (one you don't 'own.') Use this to never send a CallerID that you haven't explicitly specified in this trunks Outbound Caller ID field or the Outbound CID of an extension/user. You might notice this problem if you discover that follow-me or RingGroups with external numbers don't work properly. Checking this box has the effect of disabling 'foreign' caller IDs from going out this trunk. You must define an Outbound Caller ID on the this trunk when checking this.

    Maximum channels

    This limits the maximum number of channels (simultaneous calls)
    that can be used on this trunk, including both incoming and outgoing
    calls. Leave blank to specify no maximum.

    Dial Rules

    Dial rules are very powerful, but quite simple to learn.They tell
    the server how calls will be dialed on this trunk. It can be used to
    add or remove prefixes. Numbers that don't match any patterns defined
    here will be dialed as-is. Note that a pattern without a + or | (to add
    or remove a prefix) is useless.

    Rules:

    • X - matches any digit from 0-9
    • Z - matches any digit from 1-9
    • N - matches any digit from 2-9
    • [1237-9] -matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
    • . - wildcard, matches one or more characters (not allowed before a | or +)
    • | - removes a dialing prefix from the number (for example,
      613|NXXXXXX would match when some dialed "6135551234" but would only
      pass "5551234" to the trunk)
    • + - adds a dialing prefix from the number (for example,
      1613+NXXXXXX would match when some dialed "5551234" and would pass
      "16135551234" to the trunk)

    Examples:

    You're in Melbourne, Australia. You normally dial 8888-1234, but
    your VSP requires you to have an area code on all calls. This means
    that a user dialing an 8 digit number wants to have the Melbourne area
    code put on the front (03)

    • 03+NXXXXXXX

    You're in England, but your VSP is in the US. You want to be
    able to dial UK Numbers without having to dial the whole 01144 string

    • 01144+NXXXXX.

    ENUM Trunks

    There's not all that much configuration to be done, as enum
    lookups are done automatically on the e164.org domain. e164.org allows
    you to register your normal, home, telephone line as a VoIP line
    without needing government or offical supervision. e164.org is run by
    volunteers and is donation supported.

    Some example Dial Rules for an E164 trunk would be:

    • Australia (07 Area Code)
      • 617+NXXXXXX
      • 61+0|NXXXXXXXX
      • 0011|.
    • North America (613 area code)
      • 1613+NXXXXXX
      • 1+NXXNXXXXXX
      • 011|.

    IAX2 and SIP Trunks

    The configuration is as per above, but with the additional
    requirement of Incoming and Outgoing settings. These are available from
    your VSP, or, from the VSP Hints page.

    ZAP Trunks

    Zap trunks consist of physical hardware in your machine that uses
    the Zapata interface. This is configured in /etc/zaptel.conf and
    /etc/asterisk/zapata.conf. Documentation on these files is available on
    the voip-info wiki.

    Custom Trunks

    If you're using H323, Chan_capi, or any other non-standard trunk,
    you can explicitly configure the Dial string to usew with this trunk
    type, replacing the number to be dialed with $OUTNUM$. Eg:

    • CAPI/XXXXXXXX/$OUTNUM$/b
      • You can use either gX or ContrX to identify CAPI groups or individual controllers
    • H323/$OUTNUM$@XX.XX.XX.XX
    • OH323/$OUTNUM$@XX.XX.XX.XX:XXXX
    • vpb/1-1/$OUTNUM$:



    Comments

    Changing enum servers

    by benmack, Monday 18 of September, 2006 [07:47:33]

    Under freepbx version 2.1.1, it seems enum.conf is ignored

    I found that changing line 326 in extensions.conf does the trick

    exten => s,n,Set(E164NETWORKS=e164.arpa-e164.info-e164.org) ; enum networks to check

    HTH


    Upgrade Module

    Upgrade Module Overview

    The Upgrade Module is a module that is used to allow FreePBX to be upgraded from one major version number to a higher version. For example, to upgrade from version 2.3.X to 2.4.0. The way that FreePBX manages the Online repository is by providing an XML file associated with each X.X version of the product. FreePBX uses this XML file to detemine what the latest available modules are for your current version and where to find them. It then compares this against what you have installed to allow you to upgrade.

    In order to upgrade from a version such as from 2.3.X to 2.4.X you need to have Module Admin download modules-2.4.xml instead of modules 2.3.xml. Since FreePBX uses its internal version number to detemine which one to pull, the upgrade process simply bumps the current FreePBX version to the lowest possible version so that it will download the proper XML file. The lowest version, in the case of 2.4, would be 2.4.0alpha0 which in fact never existed since we always start with version 1 for alpha, beta and RC releases.

    Once you have bumped the version number, you need to go through the process of downloading modules. The Framework module is a special module that often has libraries and functions required by many other modules. So this module usually needs to be downloaded first, followed by all the other modules. Also - it is important during the upgrade process that you don't press the Apply Configuration bar. The Upgrade module has a mechanism that should keep the Apply Configuration bar from coming up until you have finished the upgrade process. This is to make sure you keep from running the configuration generation part of FreePBX (retrieve_conf) which may have other requirements not yet upgraded until all modules are brought up to date.

    Upgrade Process

    During each step of the upgrade process the top display of the Upgrade module will show the current version for FreePBX Base, FreePBX Framework and FreePBX Core since these are typcially the core critical modules that need to get fully upgraded before the module is satisified and removes itself. You should still be certain to upgrade ALL other modules that have upgrades available or you will have potential for errors.

    The step that are involved in the upgrade process are:

    1. One might acquire the 2.4 Upgrade Tool through many methods but most will simply get it through the familiar Module Admin by clicking on the “Check for updates online” link/button.
    2. Install the module called "2.4 Upgrade Tool," by clicking on the module and selecting Install. Then click the process button at the bottom of this screen.
    3. Now we will see a typical module install screen requesting that we confirm the “2.4 Upgrade Tool 2.3.0 will be installed and enabled.” Click the “Confirm” button now to proceed.
    4. Once this tool is installed a new option will show up on the left navigation bar under the Admin Section titled “2.4 Upgrade Tool.” Think of this temporary tool as your guide through a healthy install process. Only once the upgrade process is complete and no longer necessary will this tool handily remove itself from the navigation bar.
      2.4 Upgrade Bar Left Navigation Bar

    5. We will return to this button several times as it will guide us through the complete multistep process dynamically providing status updates and instructions as we proceed. Go ahead and click the “2.4 Upgrade Tool” button now.
    6. Please take the time to read through the provided instructions.
      2.4 Upgrade Version Progress
    7. Please note, as tempting as it may be, the repeated instructions of IMPORTANT: Do NOT Apply Configuration Changes (reload bar) until you have gone through all the steps!
    8. Click on the Upgrade Now button and confirm the first part of the upgrade process at this time.
    9. Read the instructions (RTMF) as they have dynamically updated. Notice that the line FreePBX Base Version: now has a new value of “2.4.0alpha0.” Each of these three components, Base, Framework, and Core will display their currently respective versions on the local system and be updated as we progress.
      2.4 Upgrade Version Progress
    10. The instructions now say to go back to Module Admin and choose to ONLY upgrade “FreePBX Framework.” Do so now following the usual upgrade confirmation and return prompts.

      Framework Upgrade
    11. Now we may upgrade Core and everything else in this step. Once again do so now.
    12. As previously stated we have repeated been told to NOT press the reload bar until you have completed the previous step. We may do so now.
    13. Upgrade Complete.
    14. Notice that the “2.4 Upgrade Tool” has removed itself from the navigation bar as it has completed its task of guiding us through the easiest FreePBX upgrade to date.

    Once you have completed these step you will be upgraded to the new version. Under normal circumstance, the module should delete itself. If it is still there, try clicking on it and see if that removes it. If not, read the status information to see if you have really finished the upgrade. If you have it should go away.


    VoiceMail Blasting (VMB)

    VoiceMail Blasting VMB

    In Progress


    Voicemail Module

    The Voicemail Module is a required for the system to work properly. For
    that reason, once installed it can not be un-installed. This module
    provides the functionality to the Extensions or Users Page to configure
    Voicemail. It also provides the Feature Codes used to dial into a users
    Voicemail box.


    ZAP Channel DIDs

    ZAP Channel DIDs

    In Progress


    ZOIP

    ZoIP - The Great Asterisk Underground Empire

    Originally from http://uc.org/read/ZoIP

    Zoip is a new way of playing Zork - It uses Text-to-Speech and
    Speech Recognition to play the classic infocom game, Zork. It appears
    as a destination. If you wish to play this without needing to go through an IVR,
    the easy way is to create a Ring Group with an invalid extension in it, and a destination of Zoip.

    Also, if your FreePBX machine is on a slow connection, BE WARNED. This is a 7 Megabyte
    download. That's a lot through a slow connection. You don't need to use
    the 'online modules' link to donwload this, you can download it
    manually - see the bottom of this page, with the title of 'Downloading
    it Manually'. I can't download it through a 1.5mbit connection in under
    the default 30 second max execution time. If you don't want to download
    it manually, and the screen just goes white and stops after 30 seconds,
    this is because your 'max_execution_time' in /etc/php.ini is too short.
    Set it to 600 (10 minutes), restart apache (/etc/init.d/httpd restart as root) and it should work fine.

    As it does some new, non-standard things, there are some packages
    that need to be installed. Without these, the module will not work
    properly.

    CenOS/RHEL/FC3/4/5 Instructions

    From the shell:

    [root@asterisk1 ~] rpm -i http://mirror.freepbx.org/sphinx2-0.6-0.i386.rpm

    (This could take a couple of minutes to finish downloading, as it's a big file)

    [root@asterisk1 ~]# wget http://mirror.freepbx.org/Speech-Recognizer-SPX-0.0801.tar.gz

    --09:08:27-- http://mirror.freepbx.org/Speech-Recognizer-SPX-0.0801.tar.gz

    => `Speech-Recognizer-SPX-0.0801.tar.gz'

    ... A few lines of text ...

    09:08:30 (117.55 KB/s) - `Speech-Recognizer-SPX-0.0801.tar.gz' saved [91123/91123]

    [root@asterisk1 ~]# tar -xzf Speech-Recognizer-SPX-0.0801.tar.gz

    ... A lot of text scrolls past ...

    [root@asterisk1 ~]# cd Speech-Recognizer-SPX-0.0801

    [root@asterisk1 Speech-Recognizer-SPX-0.0801]# perl Makefile.PL --sphinx-prefix=/usr

    Found Sphinx-II in /usr and /usr/share/sphinx2

    Checking if your kit is complete...

    Looks good

    Writing Makefile for Audio::MFCC

    Writing Makefile for Audio::SPX

    Writing Makefile for Speech::Recognizer::SPX

    [root@asterisk1 Speech-Recognizer-SPX-0.0801]# make install

    cp SPX.pm blib/lib/Speech/Recognizer/SPX.pm

    cp SPX/Config.pm blib/lib/Speech/Recognizer/SPX/Config.pm

    ... about 20 lines ...

    Installing /usr/share/man/man3/Speech::Recognizer::SPX.3pm

    Writing /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Speech/Recognizer/SPX/.packlist

    Appending installation info to /usr/lib/perl5/5.8.5/i386-linux-thread-multi/perllocal.pod

    [root@asterisk1 Speech-Recognizer-SPX-0.0801]# cd ..

    [root@asterisk1 ~]# wget http://mirror.freepbx.org/Proc-Daemon-0.03.tar.gz

    ... file downloads ...

    [root@asterisk1 ~]# tar zxvf Proc-Daemon-0.03.tar.gz

    ... 9 files ...

    [root@asterisk1 ~]# cd Proc-Daemon-0.03

    [root@asterisk1 Proc-Daemon-0.03]# perl Makefile.PL

    Checking if your kit is complete...

    Looks good

    Writing Makefile for Proc::Daemon

    [root@asterisk1 Proc-Daemon-0.03]# make install

    ... 6 lines of installation ...

    [root@asterisk1 Proc-Daemon-0.03]# cd ..

    [root@asterisk1 ~]# wget http://mirror.freepbx.org/Config-Tiny-2.08.tar.gz

    ... file downloads ...

    [root@asterisk1 ~]# tar zxvf Config-Tiny-2.08.tar.gz

    ... 26 files ...

    [root@asterisk1 ~]# cd Config-Tiny-2.08

    [root@asterisk1 Config-Tiny-2.08]# perl Makefile.PL

    Checking if your kit is complete...

    Looks good

    Writing Makefile for Config::Tiny

    [root@asterisk1 Config-Tiny-2.08]# make install

    ... a few lines...

    [root@asterisk1 Config-Tiny-2.08]# cd ..

    [root@asterisk1 ~]# yum install festival

    Setting up Install Process

    Setting up repositories

    ... etc ...

    [root@asterisk1 ~]#

    That's it - you can now download the module and it'll work happily!

    Debian, Ubuntu, apt-style distros

    This is taken from the Zoip installer, and may not be accurate. I don't have a Debian machine here, so I can't test this.

    • Install Sphinx2, and Festival
      • Install the Sphinx2 binaries and developer kit
    apt-get install sphinx2-bin libsphinx2-dev

      • Install the Sphinx2 Perl bindings
    wget http://mirror.freepbx.org/Speech-Recognizer-SPX-0.0801.tar.gz

    tar -xzf Speech-Recognizer-SPX-0.0801.tar.gz

    cd Speech-Recognizer-SPX-0.0801

    perl Makefile.PL --sphinx-prefix=/usr

    make install

      • Install Festival, and the 'kallpc8k' voice, sitable for telephone quality
    apt-get install festival festvox-kallpc8k

    • Add some additional perl modules used by ZoIP from the apt repository
    apt-get install libproc-daemon-perl liblog-log4perl-perl libconfig-tiny-perl

    Installing ZoIP Manually

    Beacuse this is abig file, it may be neccesary to download the module manually. This is simply done by:

    [root@asterisk1 ~]# cd /var/www/html/admin/modules

    [root@asterisk1 ~]# wget http://mirror.freepbx.org/modules/release/2.2/zoip-0.2.0.tgz

    ... file is downloaded ...

    [root@asterisk1 ~]# tar zxvf zoip-0.2.0.tgz

    ... files are extracted ...

    From here, you can go back to your Module Administration page, and
    the Zoip module will appear as a 'Disabled Module' ready to be
    installed, without requiring going to the online module repository.


    Third-Party Unsupported Modules

    Contributed Modules

    These modules are unsupported — they have been known to cause happiness and glee, or dizziness, confusion, and frustration.

    The modules can be obtained from:
    http://mirror.freepbx.org/modules/release/contributed_modules/

    Instructions for installing third-party modules that are not yet included in the Third-Party module repository (e.g. recently contributed modules) can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/modules/README.t...

    Please understand that these modules were written by other users of FreePBX and not the FreePBX development team. Issues such as what version or versions they will work with, problems with installation, etc. need to be directed to the authors of these modules and not the FreePBX development team.

    If you have installed any of these modules and are about to upgrade your system from one version to a newer version it is possible that right after the upgrade your system might not work properly. If that is the case please first disable these third party modules to verify that they are not causing the issue. Some authors don't upgrade versions as quickly as others do and might not know there is a problem.

    It is also possible that when you upgrade that suddenly you might not have a working GUI to disable a module. If that becomes the case, you can do the following at a Linux prompt (assuming standard install defaults):

    /var/www/html/admin/modules/framework/bin/module_admin disable {module name}
    

    If you are an author of any module(s) here we request that you please keep it updated, and in your description include what version(s) it has been designed and tested on, so that in the future people will know how current the posted module is when they look at it.


    Agent Administration

    Agent Administration

    This module allows for adding and modifying new agents to the freePBX system. This would include the agent ID, full name and password. This rewrites the agents.conf file.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Boss-Secretary

    Boss-Secretary

    The boss-secretary module creates a special ring group which includes one or more "bosses" and one or more "secretaries". When someone calls the boss' extension, the secretary (or secretaries) extension will ring too, allowing the secretary to answer his or her boss' call.

    Additionally one may define one or more chiefs, who may call the boss directly, without ringing the secretary's extension.

    The module includes codes for activating, deactivating and toggling the groups' state. For example, when a secretary ends her working day, she may turn off the boss-secretary group dialing *255<ext number>, so her boss will receive calls directly.

    The module generates the appropriate hints to have ip phones show the groups state by subscribing to the *255<ext number> extension.

    Note: this module send an alert info of type alert-group to ip phones, so we recommend to set up the boss' phone so its ring tone is silent or very quiet when receiving an alert info of type alert-group; this way, the boss won't be distracted by phone calls which are being processed by his or her secretary. Calls from the secretary to the boss will ring normally.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/modules


    Bulk DIDs

    Bulk DIDs

    Manage DIDs in bulk using CSV files.

    Start by downloading the Template CSV file or clicking the Export DIDs button.

    Modify the CSV file to add, edit, or delete DIDs as desired. Then load the CSV file. After the CSV file is processed, the action taken for each row will be displayed.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Bulk Extensions

    Bulk Extensions

    Use CSV files to add, edit, or delete one or more extensions. Export extensions feature now available. Improved interface and documentation.

    This module is a replacement and upgrade for the importextensions module. After installation there will be a Bulk Extensions entry under Third Party Addon on the Tools tab on the left side menu. The Bulk Extensions page allows you to download a template CSV file. It also allows you to upload a CSV file for processing. Almost all the options shown on the FreePBX 2.4 Extensions interface can be specified in the CSV file. The template CSV file has examples of adding a new extension, editing an existing extension, and deleting an existing extension.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release
    Note that versions starting with 0. can be used with FreePBX 2.4 (and possibly earlier), while versions starting with 2.5. may only be used with FreePBX 2.5.


    Caller ID Popup (post answer for use with Ring Group)

    CID Popup

    Caller ID Popup (post answer for use with Ring Group)

    This specialized module allows you to specify a destination IP Address of FQDN to be associated with various AGI Scripts that can be launched as part of a post answer action in a ringgroup. The scripts are specialized to deal with various destination CRM systems such as SugarCRM and other future system to provide push based CID PoPup and other CRM data to the agent who answers the call. Once you make an entry including the relevant information, these instances will be available within ringgroups to optionally associated a ringgroup with one of the configured servers so that such CRM data can be displayed to its agents.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Caller ID Superfecta

    Caller ID Superfecta

    Purpose:

    This module installs the Caller ID Superfecta (a utility program which adds incoming CallerID name lookups to your Asterisk system using several different sources: AsteriDex, the Google Phonebook, AnyWho, and WhitePages, to name only a few) as a FreePBX Module. As a Module, the Configuration items can be changed from the Web UI.

    Notes on version 2.2.2:

    Caller ID Superfecta is an easy to install module designed for use with almost any Asterisk/FreePBX/MySQL PBX distribution. It is user interface driven, and requires no special technical capabilities to install and configure.

    Version 2.2.2 of the caller ID Superfecta provides worldwide caller ID lookup from multiple sources, and provides support for international caller ID formats of all varieties.

    This most recent release of the Caller ID Superfecta includes 27 different data sources, and supports multiple caller ID schemes, that allow the PBX administrator unparalleled flexibility in configuration of inbound caller ID functions. More data sources are added frequently. And just the make sure your Superfecta keeps working at its peak, all data sources can be updated and new sources added online with the click of a mouse using Caller ID Superfecta live data source update – and its all built right into the module.

    Conditions/Prerequisites:

    This module depends up the Asterisk DB AMP user ID and password being set at their default values. The module script may be edited to reflect your actual id and passwords if you have changed them.

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBX In A Flash
    Elastix *See Special Installation Steps

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_Caller_ID_S...

    The principal community discussion thread for the module is located here.

    http://pbxinaflash.com/forum/showthread.php?t=4387

    Release Announcement:

    http://www.freepbx.org/forum/freepbx/users/caller-id-superfecta-module-f...

    Theory of Operation v 2.0.0:

    http://projects.colsolgrp.net/documents/show/2


    Capture Groups

    Capture Groups

    This module allow the administrator to quickly create and administrate capture groups. It will configure every extension's capturegroup and pickupgroup automatically.

    Additionally it will generate a virtual extension number which, which notifies users (phones) of calls in the capture group.

    Using the following asterisk 1.4.x patch (File asterisk-1.4-pickupbycallid.patch)

    one can subscribe phones to the virtual extension generated by this module and receive notifications of all calls received by the groups' members, and may pickup the incoming call by pressing the subscribed button (tested with snom phones and firmware >= 7.1.35).

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/modules
    Also see Ticket #3910


    CDRCost (a.k.a. Call Cost)

    CDRCost (a.k.a Call Cost)

    This downloadable FreePBX plug-in allows you to setup the Call Cost parameters, categorizing each call and assessing a cost for each. From this data you can generate call costs by create a new table called cdrcost in the asteriskcdrdb (which contains the cost and the used rate of each calls which is not 0). Afterwards you can generate many kinds of statistics from this (to see which extension, group etc. called which direction, and how much the cost was for you).

    You can define the following parameters:

    Zone Group

    These are a collection of zones which are only used for grouping of Zones (for the UI). You can put each Zone into one Zone Group.
    Parameters:

    • You can give a name for each Zone Groups.

    Example of Zone Groups:

    • Local
    • Long Distance
    • Mobile
    • International, etc.

    Zone

    These are the definition of the Zones.
    Parameters:

    • You can give a name for each Zone,
    • Assign it to the Zone Group to which it belongs (choose from the list),
    • Define which pattern is used for this Zone. This pattern is a regular expression which will be fitted on the destination number (i.e. Do not use the Asterisk style patterns NXZ!!!). Example:
      ^1888[0-9]{7}$

    Schedule

    A Schedule is a collection of Schedule Parts.
    Parameters:

    • You can give a name for each Schedule.

    A Schedule Part define an interval(s).
    Parameters:

    • You can give a name for each Schedule Part.
    • Assign it to the Schedule which it belongs to,
    • Weekday of this Part 0-7 (both 0 and 7 means Sunday) or -1 in case it's applied for all days,
    • From which time valid (format is: 'hh:mm:ss'),
    • Until which time valid (format is: 'hh:mm:ss').

    Rate

    This defines the cost parameters from which the cost can be calculated.
    Parameters:

    • You can give a name for each Rate.
    • The accountcode of the call when this rate can be applied,
    • From when this rate is valid (format is: 'yyyy-mm-dd hh:mm:ss'),
    • Until when this rate can be used (format is: 'yyyy-mm-dd hh:mm:ss'),
    • The outbound Trunk prefix of the call (eg. Zap),
    • Zone for this rate is valid,
    • Rate is the call cost per minutes,
    • Minimum duration which will be charged in seconds,
    • Block size of the call duration (step size) in seconds,
    • Cost of the established connection, connection fee,
    • Disconnection cost,
    • The schedule in which rate is valid.

    Maintenance

    In this tab you can run a few maintenance operations on the cdrcost table.

    The latest release can be found at:

    http://www.freepbx.org/trac/browser/contributed_modules/release


    Config Editor

    Config Editor

    Purpose:

    This module installs a "protected" version of the Config Edit Program. The "protected" version obfuscates several configuration files, specifically, those that should never be edited by hand.

    Conditions/Prerequisites:

    This module will co-reside with the Advanced "un-protected" (non obfuscating) Config Editor module.

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBXIAF

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_Config_Edit...


    Config Editor (Advanced)

    Config Editor (Advanced)

    Purpose:

    This module installs an "unprotected" version of the Config Edit Program. The "unprotected" version does not obfuscate any of the configuration files, including those that should never be edited by hand.

    Notice: Anything which is put in the xxx_additional.conf files will be overwritten by FreePBX.

    Don't use this tool unless you are intimate with the workings of FreePBX.

    Conditions/Prerequisites:

    This module will co-reside with the standard "protected" (obfuscating) Config Edit module.

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBXIAF

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_Config_Editor_(Advanced)


    CustomContexts

    Currently this is an unofficial module that must be manually installed. It can be downloaded from:

    http://mirror.freepbx.org/modules/release/contributed_modules

    choosing the latest version of the customcontext module. The easiest way to install it is to dowload it to your desktop and then choose "Upload Modules" in FreePBX Module Admin and install the module.

    Then in FreePBX, click on the Tools tab, Module Admin, and Custom Contexts, select Install, click on Process, and then the red bar to complete installation.

    Possible Uses

    • Restrict access to certain outbound routes or feature codes by a particular extension or group of extensions.
    • Give particular extension(s) priority access to certain outbound routes, such as a particular emergency route associated with their geographic location.
    • Give certain outbound routes top priority for use during "free" or low cost calling periods, while making those same routes lower priority (or disallowing access entirely) during higher cost time periods.
    • Disallow access to outbound routes (with possible exception of Emergency access) to certain (or all) extensions during particular time periods (don't let night cleaning crew make long distance calls, or disallow outgoing night calls from telephones in children's rooms, while still allowing emergency number calls).
    • Allow two or more families/companies/organizations to use the same FreePBX box, while still allowing each to have access only to "their" outgoing routes and trunks.
    • If you have a SIP provider that does not send DID (normally a pain to handle because you can't create a normal Inbound Route), set up a new custom context (call it idiot-provider), give them no access to anything (deny all), and then specify where you want their calls to go in the Failover Destination. Then put context=idiot-provider in that provider's trunk user details.

    What This Module Is NOT Intended For

    • This module is not intended to provide an alternative way to access code that is found in, or might normally be placed in extensions_custom.conf. You probably want the DialplanInjection module if that is what you are trying to achieve.
    • It's also not intended to give you simplified access to existing features, applications, or destinations (e.g. from an IVR) - you probably want to use Misc. Applications and/or Misc. Destinations (or possibly a Custom Extension) for that.

    Known Incompatibility

    Please be aware that if you you have installed both this module and HUDlite on the same system, HUDlite will allow users to bypass any restrictions placed upon them by this module. Therefore, restricted users should not be given access to HUDlite. Also, a savy user can bypass the system. As soon as they transfer a call, the current dialplan puts them in a new context which is effectively from-internal taking away any restrictions.

    Description

    One feature which was a bit lacking in Asterisk/FreePBX was the ability to easily create multiple tenants.

    This module creates custom contexts which can be used to allow limited access to dialplan applications.

    Now allows for time restrictions on any dialplan access!

    This can be very useful for multi-tenant systems.

    Inbound routing can be done using DID or zap channel routing, this module allows for selective outbound routing.

    House/public phones can be placed in a restricted context allowing them only internal calls.

    Custom contexts can now be used as destinations. An IVR menu, Time Condition, etc. can now send a caller into a custom context. This feature requires FreePBX 2.2.0rc2 (or the latest SVN version if prior to the release of rc2)

    (The following are the module author's comments, "I" refers to the module author, not the original creator of this wiki page).

    A number of improvements have been made to freePbx to handle multiple tenants.

    1) inbound routing based on zap channel - i used to have to hack it by putting each zap channel in its own context.

    2) authtype = database allows for dividing extension ranges

    the main problem for me was outbound routing...

    I wanted some extensions to dial out one route, and others out another route.

    I had to create a custom context for each, then place each in their own custom context, then include all of the contexts which they should have access to. This became a nuisance as each module added its own context to from-internal-additional which could not be included as it also contains outbound-allroutes.

    The purpose of this module is to dynamically list all contexts included in any contexts you choose, and allow you to create custom contexts which can include any of these all without config editing.

    As an added bonus, I added a select list to the devices/extensions page to allow you to easily select any of your custom contexts to place the device in.

    Version 0.1.1 - Now has optional Time Groups which allows you to name a set of times to enable the user to not only deny or allow access to certain dialplan contexts, but to control access to each context by time, date or day also.

    Version 0.1.2 - Changes
    Bugfixes- deleted routes, etc. now are removed.
    Context tests for spaces and illegal chars.
    Moved admin to tools to reduce confusion.
    Added option to allow entire internal dialplan. (Useful for time limit on everything)
    Made description for outbound-allroutes clearer that allowing overrides to allow all routes.

    Version 0.1.3 - Made it obvious when allowing one include may allow another entire context.

    Version 0.2.0 - Added priority feature to allow the user to control in what order the allowed contexts are included.

    Version 0.2.1 - Added Duplicate Context option to easily copy an entire set of rules.

    Version 0.2.2 - bugfix

    Version 0.3.0 - New Features:
    Allow or Deny based on pattern matching.
    Failover Destination (one for regular extension, one for failed feature codes)

    Bugfixes:
    Adjusted Gui, Duplicate context, now duplicates the description too.

    Version 0.3.1 - New Features:
    Now prompts on delete. After duplicate you are editing new context.
    It is now possible to rename contexts.

    Version 0.3.2 - New Features:
    Optional PIN to protect failover destination.
    Contexts can now be used as destinations. An IVR menu, Time Condition, etc. can now send a caller into a custom context.

    Version 0.3.3 -
    New Feature: Added Set All option to quickly allow/deny all.
    Fixed bug which caused routes to be denied after rename/sort/or delete other route.

    Version 0.3.4 -
    Fix for compatibility issues with FreePBX version 2.3.1.3.

    Installation of Beta version

    Download the latest Beta version using the instructions in the first paragraph.

    If you did not use the instructions for getting and installing the module using wget, then expand the .tgz file into the /var/www/html/admin/modules directory - it will create a new directory called customcontexts. Make sure the group and owner of that directory are asterisk and that the permissions match that of the other module subdirectories.

    Browse to FreePBX, Tools | Module Administration. You should see an entry for Custom Contexts. Click on it, click install, then click process and the red bar as usual.

    Usage Instructions

    Most users will not need to do anything in the Custom Contexts Admin section (now found under the Tools tab) - that is for advanced users. When you "add" or "remove" contexts from the Admin, you are not really adding or removing anything, you are just telling the module where to find all of the includes to list. By default there are three includes which should be sufficient for most users: from-internal, from-internal-additional, and outbound-allroutes. So, skip the Custom Contexts Admin section until you feel comfortable making changes there.

    The first thing that you will want to create is time groups, if you plan to use those. The reason for doing this first is so that they will become available in the drop down selections when you create your custom contexts. For each group you create, you can decide which times it should be available. You can define multiple times within one named group, and then each named group then becomes available along with allow/deny for each choice under a custom context (this will become clearer further down), so you can allow, deny, or choose your time group to allow only at specific times/dates/days.

    One thing to bear in mind when creating time groups is that this module will not forcibly end calls in progress. So if, for example, you have "free" calling on a particular route from 9:00 PM to 7:00 AM, you probably don't want to set the end time right at 7:00 AM, because then someone could make a call at 6:59 and talk for several minutes into the non-free period.

    Now, to actually create a Custom Context, you go to the Custom Contexts page, and add a context - note that the context name may NOT contain spaces. Then add a description (spaces are okay here) and submit.

    We'll talk about Dial Rules later - in many cases you will want to leave the Dial Rules blank.

    Once the context is created, you can edit it to allow or disallow the features and routes you want a particular extension (or group of extensions) to have access to. There is a "Set All" option to set all the features and routes to Allow or Deny - this is useful when you want to start out with all of the dropdowns in one state, so that you only need to change the exceptions. Then choose "Allow" or "Deny" for each application or route - for example, you may wish to allow all, except for the items you specifically wish to restrict (for example, you probably want to restrict ChanSpy and ZapBarge!). If you have created any time conditions, it will also be possible to select those, to allow a feature or route to be accessed only during certain times. If you have any Dial Rules, you can choose to "Allow Rules" (allow the feature or route only if a Dial Rules pattern is matched) or "Deny Rules" (deny the feature or route only if a Dial Rules pattern is matched).

    Certain items are in bold red letters, such as "ENTIRE Basic Internal Dialplan" and "ALL OUTBOUND ROUTES." If you allow ALL OUTBOUND ROUTES, it will override the individual route selections in the following section. So if you want users of this context to have access to all outbound routes, you can just allow outbound-allroutes and ignore the individual route sections (leave them all set to "deny"). But if you want to select routes individually, then make sure that outbound-allroutes is set to "Deny". Of course, you could also use non-overlapping time conditions for outbound-allroutes and individual routes.

    If you allow "ENTIRE Basic Internal Dialplan", then it overrides every other selection on the page. You would normally only use this with a time rule, to allow your unaltered dialplan to be used for a portion of the day. Allowing the "ENTIRE Basic Internal Dialplan" without using a time rule is usually pointless. If you want control over individual items, deny "ENTIRE Basic Internal Dialplan", and allow only what you want.

    Associated with each item a "Priority" dropdown. All priorities are set to 50 by default (so you can easily make any item higher or lower in priority). The best use of these is in the Outbound Routes section - you WILL want to make sure that any Outbound Routes that you allow are ordered by priority, otherwise your outbound calls may not be routed as you expect. Normally you will want to mirror the priority of the existing routes - the easiest way to do that is add 50 to the number at the start of the route, so for example if you have a route called "outrt-001-Emergency" you could add 50 to the "001" and use 51 as the priority. But note that you do not have to mirror the default priority of routes, which could become useful in certain situations.

    For example, let's suppose you have an emergency route that goes to a an emergency answering point in your local area, but you also have another emergency route that goes to an emergency answering point in a community where you have a remote office. You could create two emergency routes going to the two different answering points and let the one going to the local point be higher in priority normally, but create a custom context for your remote extensions and in that custom context, make their community's emergency answering point higher in priority.

    One more note about priorities - you can hide the display of the priority dropdowns by clicking on "Hide Sort Option" at the top of any custom context page. BUT - if you click on the "Submit" button while you have the priorities hidden, all the priorities on that page will be reset to the default (50)! So use this option with care!!

    Note: This option is no longer available as its purpose was to clean up the page when priorities were listed below each context. Now that the display was fixed, the "hide priorities" option was removed.

    At the bottom of the page, you can select a Failover Destination and a Feature Code Failover Destination. The Failover Destination is used when the called number does not start with a * and does not match on any route, while the Feature Code Failover Destination is used when the called number begins with a * and does not match any feature code. Be careful here, because it's possible to send a caller to a destination that gives them access to destinations that you don't intend for them to be able to access. Either or both of the Failover Destinations can be PIN protected, that is, you can enter a numeric PIN to require authentication before continuing to the destination.

    Regarding Dial Rules, these can be used when you want to further allow or restrict access based on the number dialed. For example, you could give an internal caller access to a particular route only if 911 was called, or if a local number was called, while restricting their ability to place other calls on the same route. It's also possible to use the | character to strip off initial digits. For example, if you had a dial plan that included something like 90210|1NXXNXXXXXX you could set an outbound route to "Allow Rules" and it would generally restrict access to that route, except for those callers that know that they must dial 90210 prior to the 1+area code+number.

    Sometimes you will want to create a new custom context that is very similar to an existing custom context you have already created - perhaps you only want to modify one or two items in the new context. The easiest way to do that is to go into the existing context, then click on "Duplicate Context ..." at the top of the page. This will create a duplicate of the existing context that you can edit as you
    wish.

    Finally, you need to go to your Extensions page and select each extension for which you wish to use a custom context. On each individual extension page, you should now see a dropdown to allow you to select a custom context. This drop-down is simply a convenient way to fill in the correct context in the "context" textbox. When you click on a custom context, it replaces whatever is currently in the "context" textbox with your new selection - if you choose "Default", it resets the extension back to the default "from-internal" context. Don't forget to click "Submit", and then click the red bar when you are all finished making changes.

    NOTE that if you disable or uninstall the Custom Contexts module, you MUST reset all the extensions back to the default "from-internal" context. If you delete a time group, anyone who had that time limitation becomes "Allow" with no time restrictions. If you add a new outbound route, by default that route is set as "Deny" in the Custom Contexts, so you should go into each context and set it to "Allow" (or use a time condition) where appropriate.

    One more caveat. After you add an outbound route, it is not available until you reload.


    Customer Database

    Customer Database

    Maintains a customer database.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Dialplan Injection

    Currently this is an unofficial module that must be manually installed. It can be downloaded from this unofficial repository. See this FreePBX module tutorial if you need help understanding how to install it.    

    Alternately, here is how to get and install this file (version 0.1.1) using wget:
     

    cd /var/www/html/admin/modules
    wget http://www.zelie.com/~n3glv/asterisk/dialplaninjection-0.1.1.tgz
    tar -xzvf dialplaninjection-0.1.1.tgz
    rm -f dialplaninjection-0.1.1.tgz
     
     

    Description

    This unofficial FreePBX module allows you to create short custom dial plan fragments. While such fragments can also be added to extensions-custom.conf, the advantage of creating them in this module is that the resulting dial plan fragment can be directly selected as a destination in modules that use destinations. Optionally, the dial plan fragment can also be accessed directly by calling an extension number. Just about anything that could be put into extensions_custom.conf can be placed in a Dialplan Injection.
     
     
    Version history

    Version 0.0.1: Initial version

    Version 0.0.2:

    • Fixed extension bug
    • Allowed patterns in extension (allows a Dialplan Injection to be accessed by a group of extensions defined by a pattern)
    • Commands are one big text area now

    Version 0.0.3:
    • Added ability to add line labels. Labels also become available as destinations for other modules.
    • Each direct dial injection is now in its own context to allow individual inclusion in other contexts.
    • Version now display correctly on screen.

    Version 0.1.0:
    • Removed unique constraint on direct dial extension.
    • Added templates for most dialplan apps.

    Version 0.1.1: Fixed a few templates and version display bug.
     
     
    Installation of Beta version

    Download the latest Beta version using the instructions in the first paragraph.

    If you did not use the instructions for getting and installing the module using wget, then expand the .tgz file into the /var/www/html/admin/modules directory - it will create a new directory called dialplaninjection. Make sure the group and owner of that directory are asterisk and that the permissions match that of the other module subdirectories.

    Browse to FreePBX, Tools | Module Administration. You should see an entry for Dialplan Injection. Click on it, click install, then click process and the red bar as usual.
     
     
    Usage Instructions

    To create a Dialplan Injection, click on Dialplan Injection and then on "Add Injection" (if you are not already on that page).

    Enter a short description for your Injection - this should contain letters and numbers only.

    Optionally, you may enter an extension number for direct access, which will allow dialing this injection directly. You may leave the extension field blank if you only plan to access the injection indirectly (such as from an IVR menu choice) OR if you plan to use Misc. Applications to create one or more extensions (or feature codes) for entry point(s). The extension may be a pattern (such as would be allowed in a route dial plan) to match (for example) a range of extensions. Also, you may use a pipe | to strip the preceding digits, as would be allowed in a route dial plan pattern.

    Under Destination, choose a destination for use when all the lines in your Dialplan Injection have executed. For example, you could select Core: Hangup if you simply plan to play a message to the caller and disconnect. Or, you could send a caller to an IVR to make another selection.

    Click on "Submit" to create the Dialplan Injection. Do not click the Red Bar yet.

    Now select the Injection you just created from the list of Injections at the right. When you bring it up, you should see a text box where you can enter the actual lines of your injection. Remember, at this point you are playing the role of computer programmer and if you write bad code, your Injection wont work as you intend. Garbage in, garbage out. So check what you write very carefully.

    As with code you might write in an actual context, you can use line labels to allow for conditional or unconditional jumps, or to permit multiple entry points to your code (for example, you might write a routine that returns certain information about an extension - if entered at one point, it might give the information about the extension the user is calling from, whereas if entered at a different point, it might prompt the caller to enter an extension and then give the report about that extension). To use a label, simply enclose it in parenthesis and put a comma between it and the statement, like this:

    (label1),NoOp(This is a line with a label)

    .....

    GotoIf(somecondition?label1)

    Each label you use can be selected as an entry point from other applications (for example, in Misc. Applications you will see a radio button and dropdown for Dialplan Injections, and in that dropdown you'll be able to select any labeled statement as an entry point, in addition to the normal entry at the top of the code). For example, if your Dialplan Injection was named My Injection and contained the above code fragment, you'd be able to use "My Injection" as a destination, and also "My Injection-label1".

    There's also a "New Command" box that contains some commonly used commands, in order to help you recall the syntax of these commands. You don't have to select anything here but if you do, whatever you select will be pasted into your code.

    Remember to put Ringing on a line by itself (usually as the first line of the code) if you want your caller to hear a Ringing signal until the call is answered. Also, you need to use Answer on a line by itself before playing any significant information to the caller (any message not having to do with call progress) in order to comply with legal requirements and to make sure that billing commences at the proper point. Obviously this does not apply for injections that can only be reached by internal callers, or can only be reached after the call has already been answered (by an IVR, for example).

    When you are finished writing your code, click on "Submit", and only now should you click the Red Bar to enable use of your Dialplan Injection.

    There is one other point that needs to be mentioned: If you have also installed the Custom Contexts module, you can individually allow or deny each Dialplan Injection. Here is how to do that (please note that nothing in the next three paragraphs will make sense to you if you have never used the Custom Contexts module):

    Click on the Tools tab, Custom Contexts Admin, and Add context. Put ext-injections in the Context field (this must be entered exactly as shown), and give it a description (e.g. "Dialplan Injections"). Submit the page and click on the Red Bar.

    (Optional but recommended): Go back to Tools, Custom Contexts Admin, and click on the description you just created (e.g. "Dialplan Injections"). When the page comes up, give each of the injections a meaningful name, rather than the default ext-injection-number. Note that the numbers at the end of each default injection name match the numbers in angle brackets following each injection name on the Dialplan Injections page. At present the Custom Contexts Admin tool doesn't seem to pick up the "friendly" name of the Dialplan Injections automatically.

    After doing the above, you can go to the Setup tab, Custom Contexts, and edit your contexts (this assumes you've already created some custom contexts) as follows: Deny ext-injections, which should now be in red text, unless you want the context to allow ALL Dialplan Injections. Then, allow only those injections you wish to allow in each custom context.
     
     
    Examples

    Here are some actual Dialplan Injections to give you an idea of how simple a Dialplan Injection can be:
     
     
    Play Music On Hold from the default context to the caller for up to 9999 seconds:

    SetMusicOnHold(default)
    WaitMusicOnHold(9999)

     
     
    Inform a caller that no 911 service is available on the line by playing an appropriate recording three times, separated by one second of silence (note this should never actually be used as a substitute for 911 service, it's just an example):

    Playback(no-911-2&amp;silence/1&amp;no-911-2&amp;silence/1&amp;no-911-2,noanswer)

    The ,noanswer means that if the call has not already been answered it will not be, since this is considered a call progress message (Playback, unlike some other methods of playing audio, defaults to answering the line and requires the ,noanswer appendage if you don't want the call answered).

    In both of the above examples, you would probably use Core: Hangup as the Final Destination.
     
     
    Before ringing a particular line, play a recording to the caller containing some sort of notice. Here we'll play one second of silence (optional, but useful if some of your callers are calling from a phone with a dial in the handset - it gives them time to get the phone to their ear), then the system recording that says "This call may be monitored or recorded":

    Playback(silence/1&amp;this-call-may-be-monitored-or-recorded)
    Ringing

    Then use Core: and the desired extension (or, if you prefer, a ring group) as the final destination. You can then use this Injection as a selection from your main IVR menu, so that callers that select this extension or department hear the recording first.

    In a way this is a trivial example, because when creating a Ring Group you can specify an announcement to be played before ringing commences, and System Recordings lets you concatenate multiple recordings into one (so you don't really need to use a Dialplan Injection if that is all you want to do). BUT, suppose you want to play some audio that is dynamically generated by an AGI script, rather than system recordings? For example, you could call an AGI script that plays some information about current conditions (e.g. system status, the weather, or whatever you might be monitoring), then returns to an IVR as a final destination.
     
     
    Inform caller that parking lot slot is empty (example pattern usage) - Let's say you have a parking lot for parked calls with eight slots, which can be numbered 901-908. If a caller tries to pick up a parked call and it's no longer there, you want to inform them of that fact. So, you would create a Dialplan Injection and use a pattern for the extension:

    _90[1-8]

    (Note: the underscore as the first character of a pattern is not required, as the module will insert it in the dialplan if it detects a pattern).

    Then for the actual injection, simply play one second of silence, followed by an appropriate system recording:

    Playback(silence/1&pbx-invalidpark,noanswer)

    If there is a parked call, it takes precedence when someone dials the appropriate parking lot extension, otherwise the Dialplan Injection kicks in and plays the message to the caller.
     
     
    Modified Speaking Clock routine with labels and multiple entry points - Finally, here's a more complex example - a modified Speaking Clock routine, that can give the time in either of two time zones (in this example, U.S. Eastern and U.S. Central time, but you can change these to any standard Unix time zones). This example uses labels, AND has two entry points (you can add more). We'll show the complete instructions to implement this:

    1) Go to Dialplan Injections, Add Injection. Give it a description (e.g. "Speaking Clock") but do NOT give it an extension (with the code as shown you actually could add the extension for the Eastern Time Zone entry point, but for demonstration purposes we won't give it an extension here). Make the Destination Core: Hangup. Click Submit.

    2) Re-Enter your new Injection, and paste the following code into the "Command" textbox:

    (est),NoOp(Speaking Clock for Eastern Time Zone)
    Set(TimeZn=EST5EDT)
    goto(scstart)
    (cst),NoOp(Speaking Clock for Central Time Zone)
    Set(TimeZn=CST6CDT)
    (scstart),Ringing
    Set(FutureTime=$[${EPOCH} + 8])
    Set(FutureTimeMod=$[${FutureTime} % 10])
    Set(FutureTime=$[${FutureTime} - ${FutureTimeMod}])
    Set(MaxConnectTime=$[${FutureTime} + 180])
    (scringsomemore),Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
    GotoIf($["${FutureTimeMod}" < "0"]?scanswer:scwaitasec)
    (scwaitasec),wait(1)
    goto(scringsomemore)
    (scanswer),Answer
    (scplayagain),Set(FutureTime=$[${FutureTime} + 10])
    Set(FutureTimeMod=$[${FutureTime} % 60])
    wait(1)
    playback(at-tone-time-exactly)
    SayUnixTime(${FutureTime},${TimeZn},IM)
    GotoIf($["${FutureTimeMod}" = "0"]?scexactmin:scsaysecs)
    (scexactmin),SayUnixTime(${FutureTime},${TimeZn},p)
    goto(scwaittobeep)
    (scsaysecs),playback(and)
    SayUnixTime(${FutureTime},${TimeZn},S)
    playback(seconds)
    (scwaittobeep),Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
    GotoIf($["${FutureTimeMod}" < "1"]?scplaybeep:scwaitsectobeep)
    (scwaitsectobeep),wait(1)
    goto(scwaittobeep)
    (scplaybeep),playback(beep)
    Set(FutureTimeMod=$[${MaxConnectTime} - ${EPOCH}])
    GotoIf($["${FutureTimeMod}" < "1"]?scthatsall:scplayagain)
    (scthatsall),GotoIf($["x${IVR_CONTEXT}" = "x"]?app-blackhole,hangup,1:${IVR_CONTEXT},return,1)
    

    3) Click Submit after entering the above.

    4) Now, because we want multiple entry points, go to Misc. Applications, Add Misc. Application. Give it a description (such as "Speaking Clock-Eastern") and a feature code number (an unused one, or you can use *60 if you have disabled FreePBX's default speaking clock under Feature Codes). For the Destination, select Dialplan Injection and in the dropdown select "Speaking Clock-est". Submit.

    5) Repeat step 4, except make the description different (e.g. "Speaking Clock-Central" and assign a different feature code. In the dropdown, select "Speaking Clock-cst". Submit.

    6) Click the red bar. Now you can use one extension or feature code to get the time in one time zone, and the other extension or feature code to get the time in the other.

    Alternately, if you have also installed the Custom Contexts module, you could use the same feature code number in steps 4 and 5, but then set up custom contexts in such a way that any particular extension only gets access to one time zone or the other.
     
     
    Module Author: naftali5

    ENUMPlus

    ENUMPlus

    ENUMPlus is a community effort whose goal is to simplify the use of ENUM. Major features include :

    • Immediate Phone Verification
    • SIP URI Testing
    • Instantaneous record lookup.
    • Open Source (GPL v.3)
    • Nameserver redundancy
    • Additional ENUM Lookup Sources

    ENUMPlus project page: http://enumplus.org/

    Blog post introducing the module with additional details: http://geekhut.org/enumplus/

    Related thread in PBX in a Flash forum: http://pbxinaflash.com/forum/showthread.php?t=4375


    Extended Routing

    Currently this is an unofficial module that must be manually installed. It can be downloaded from this unofficial repository. See this FreePBX module tutorial if you need help understanding how to install it.

    Alternately, here is how to get and install this file (version 0.0.1) using wget:
     

    cd /var/www/html/admin/modules
    wget http://www.zelie.com/~n3glv/asterisk/extendedrouting-0.0.1.tgz
    tar -xzvf extendedrouting-0.0.1.tgz
    rm -f extendedrouting-0.0.1.tgz
     
     

    Description

    This unofficial FreePBX module adds Extended Routing capabilities to FreePBX. It adds a failover destination to outbound routes, and also allows you to choose an outbound route as a destination from other parts of the dialplan.

    Some possible uses for this module (just as examples, there are many others):

    Use #1 - controlling costs.

    Suppose that on a particular route, you have some free or low-cost trunks, and one trunk that costs (more) money to use, and you want to fall through to it only as a last resort, and you want to know when you are using that expensive trunk. You don't want to have a different route with a different dial pattern, since that would be a nuisance (i.e. dial... oops "all circuits are busy"... hang up and dial the expen$ive route). So you set the costly trunk as the last trunk in your standard route, but the problem is that up to now, you have had no way of knowing when you are talking on that trunk, other than by watching the CLI.

    Enter extended routing.

    You set up two routes, with the same dial patterns. The second is your high-cost route that includes the expen$ive trunk, and because of its priority it will normally never get hit (unless someone is in a custom context that only has access to the more expensive route). Add a failover destination on the first route that goes on to the second, and put a pin on the second. You now have a very simple method of trying multiple routes with the SAME dial pattern, and by requiring a pin the caller must affirmatively choose to use that route.

    Alternatively you can fail the first route to a custom sound, and then continue to the second route without a pin. In this case it will simply warn you that you're on a more costly call, but are not required to input a pin. But, note that in version 0.0.1, you cannot use a dialplan injection as the sound source (see "Limitations" section below).

    Use #2 - routes as a destination.

    You have a few people in a restrictive custom context. But, you have another Asterisk box on which you don't mind them having unlimited access. You have an IAX2 trunk set up between the two. You can't set up an outbound route that allows "everything" (a dot as the pattern), or else all of your calls may start going out via that trunk. So instead, set up the route and give NO ONE access to it. Then you can fail over any custom context to that route, and anything they don't have permission for will try that route (this one can also be accomplished using priorities in a custom context, but this is probably safer.)

    Use #3 - failover for routes.

    You have DISA set up, and you don't want Allison to tell you that all circuits are busy and then hang up. You would rather have your outbound routes fail to the "all circuits busy" message, but then go to your IVR so you can reenter the DISA (thereby avoiding the need for you to hang up and call back).

    Limitations in version 0.0.1: Dialplan Injections currently mess up the dialed number, and therefore should not send to an outbound route as a destination. For example, they cannot be used as a "middleman" to generate the sound mentioned in "Use #1" because they will lose the dialed number. This will be fixed soon. Also, when using outbound routing as a destination, it has the same rules as when using a custom context as a destination. You do NOT have the chance to dial another number (it is not DISA), it simply takes the dialed number and tries it out that route.
     
     

    Installation of Beta version

    Download the latest Beta version using the instructions in the first paragraph.

    If you did not use the instructions for getting and installing the module using wget, then expand the .tgz file into the /var/www/html/admin/modules directory - it will create a new directory called extendedrouting. Make sure the group and owner of that directory are asterisk and that the permissions match that of the other module subdirectories.

    Browse to FreePBX, Tools | Module Administration. You should see an entry for Extended Routing. Click on it, click install, then click process and the red bar as usual.
     
     

    Module Author: naftali5

    Extension Settings

    Extension Settings

    Allows the easy viewing and changing of the following settings for each extension:

    DND (Do Not Disturb)
    Call Waiting
    Call Forward All
    Call Forward Busy
    Call Forward No Answer

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release
    (Filename begins with extcfg)


    External Audio (Paging Interface)

    The "External Audio" Module for FreePBX

    This module provides a public address interface for paging

    Operation

    This module provides a destination that can be selected from another module such as the miscellaneous application module. This destination connects to the audio line interfaces on the PBX hardware so allowing paging over a PA system.

    The extaudio module also controls the audio mixer to set volume levels for interfacing to a public address system.

    Normally an external audio input (such as from a radio) is passed through to the external audio output (the PA system). If there is a call to the extaudio destination then the audio input is muted and instead the caller's voice is output to the PA system. At the end of the call the normal audio (such as from a radio) is resumed.

    Preconditions

    This module expects the alsa mixer to exist on the local system with "Line", "PCM" and "Capture" audio interfaces. (The alsa mixer is available in the alsa-utils package.)

    This module requires one of the asterisk console modules to be loaded - either chan_oss.so or preferably chan_alsa.so . (Remove corresponding noload command from /etc/asterisk/modules.conf)

    Open Issues

    This module is not compatible with some implementations of live/streaming music on hold (i.e. those implementations that cannot coexist with chan_oss.so/chan_alsa.so)

    Author

    nick.lewis[-at-]atltelecom.com

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Feature Panel

    Currently this is an unofficial module that must be manually installed. It can be downloaded from this unofficial repository. See this FreePBX module tutorial if you need help understanding how to install it.

    Alternately, here is how to get and install this file (version 0.0.2) using wget:

    cd /var/www/html/admin/modules
    wget http://www.zelie.com/~n3glv/asterisk/featurepanel-0.0.2.tgz
    tar -xzvf featurepanel-0.0.2.tgz
    rm -f featurepanel-0.0.2.tgz
     
     

    Description

    This unofficial FreePBX module allows you to see the status of certain features on extensions that are normally activated/deactivated using *xx feature codes. The status of those features can be modified from within this module's web page.

    Features that can be checked or modified currently include:

    • Call Forward All
    • Call Forward Busy
    • Call Forward No Answer/Unavailable
    • Call Waiting
    • DND (Do Not Disturb)
    • User Intercom

    Note: This module can only be used to view or change settings that are set within FreePBX/Asterisk. Some features may be activated at the device level (IP phone or VoIP adapter) and this module cannot interact with those settings. If you want to be able to control these settings from this module, you should turn off these features in the device configuration settings of phones and VoIP adapters, so that they will be controlled by Asterisk and FreePBX only.

     
     

    Version history

    Version 0.0.1: Initial version

    Version 0.0.2: Allows selecting external or non-standard extensions for feature settings
     
     

    Installation of Beta version

    Download the latest Beta version using the instructions in the first paragraph.

    If you did not use the instructions for getting and installing the module using wget, then expand the .tgz file into the /var/www/html/admin/modules directory - it will create a new directory called featurepanel. Make sure the group and owner of that directory are asterisk and that the permissions match that of the other module subdirectories.

    Browse to FreePBX, Tools | Module Administration. You should see an entry for Feature Panel. Click on it, click install, then click process and the red bar as usual.

    Module Author: naftali5

    Gabcast

    Gabcast

    Gabcast is a social broadcasting platform that offers virtual communities, individuals, and organizations an easy way to create and distribute audio content.

    Visit www.gabcast.com for more info.

    This module allows you to:

    • Link extensions to Gabcast channels. It creates a feature code, which defaults to *422 'gab' (you can change this in Feature Code Admin) which allows you to log directly into your Gabcast account. This is ideal for personal podcasting!

    • Define a Gabcast channel as a Destination for other modules. For example, you can direct a DID or IVR menu option directly to Gabcast. This is ideal for group and public podcasting!

    You must have a Gabcast account & channel to use this feature. Visit www.gabcast.com to sign up. It's a free service!

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Hotel Style WakeUp Calls

    Hotel Style WakeUp Calls

    Purpose:

    This module installs the Hotel Style Wake Up Calls software as a FreePBX Module.

    As a Module, the Feature Code may be managed by FreePBX Feature Code page.

    Conditions/Prerequisites:

    This Module requires php v 5.x on the platform, due to the use of db classes introduced in that version.

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBX In A Flash

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php?title=FreePBX_Module:_Hotel...

    Additional/alternate instructions and download link (may have older version of the software):
    http://nerdvittles.com/?p=589


    Import Extensions

    Import Extensions

    This module provides a downloadable CSV which when filled out and uploaded via the form will create extensions according to the data provided. This allows for very fast batch extension creation.

    Author: Paul paulc@mail4u.com.au

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Inventory Database

    Inventory Database

    Maintains an equipment inventory database.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    iSymphony

    iSymphony

    This module is only useful if you are using the i9technologies iSymphony software.

    "The iSymphony module for FreePBX will replicate the configuration data for extensions, queues and conference rooms. It's simple, download the module from the downloads section. Then browse to the FreePBX module admin section and upload the iSymphony module package. Once installed and activated simply click on the iSymphony module on the left menu and follow the remaining setup instructions. Finally, ease your mind knowing you no longer have to manually update iSymphony to match the information within FreePBX."

    The latest release can be found at the i9technologies site in the download section or at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Keylock

    Keylock

    This module allows the user to lock or unlock his or her extension by dialing the appropriate code and a pin. When the extension is locked, only calls destined to numbers specified in the module's configuration can be made.

    The module generates the appropriate hints to have ip phones show the keylock state by subscribing to the <toggle code><ext number> extension.

    The first time the user tries to lock his or her extension the module will ask for a new password, which will be used thereafter to lock or unlock the extension.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/modules


    LDAP Caller ID Lookup

    LDAP Caller ID Lookup

    Allows Caller ID Lookup of incoming calls against different sources (MySQL, HTTP, ENUM, Phonebook Module and LDAP)

    Significant updates to cidlookup module to support LDAP, including ldap lookup AGI script.

    Please note, this is a replacement for CIDLOOKUP which lives in the same name space. Do not install both at the same time.

    (This is excerpted from http://www.freepbx.org/forum/freepbx/users/ldap-support-for-caller-id-lo...):

    I've modified the cidlookup module significantly to provide support for LDAP lookup.

    I now use it extensively to perform caller id lookups against active directory.

    You can find it in ticket #2389. It supports an area-code prefix and a number format option.
    If you set prefix to 417, and format to (XXX) XXX-XXXX
    then a caller by the number of 4173161234 will be searched as
    4173161234
    3161234
    and
    (417) 316-1234

    This should cover most number formats, though if you need more (like '316-1234' to match a formatted local number) I'll have a look.

    Note that its called 'ldapcidlookup' until the changes are (if ever) integrated into the real cidlookup module.

    Please don't enable cidlookup and ldapcidlookup at the same time. They use the same database and naming convention.

    Blacky

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    OSSEC Module for FreePBX

    OSSEC Module for FreePBX

    Purpose:

    This module installs the OSSEC client interface as a FreePBX Module. According to the OSSEC web site, "OSSEC is an Open Source Host-based Intrusion Detection System. It performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response."

    Conditions/Prerequisites:

    This Module is a helper module for use with the OSSEC software installed by default on the following distributions:

    Fonicatec PABX
    Foncordiax

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_OSSEC

    Also see the "Install OSSEC" section on the FonicaPABX-Install page.


    Outbound Route Permissions

    Outbound Route Permissions

    This module allows you to block access to certain routes from specified extensions. You can do bulk changes (for a range of extensions) on the module's main page, or you can individually change access to routes on each extension's page.

    You can also pick a Default Destination if a call is denied (so you can send the caller to a recording, etc.). If you wish to use a different destination for denied calls in a particular situation, see the usage tip below.

    Note that Asterisk is incapable of having two identical routes and trying to force calls to use the other route if one of them is banned by this module. It will not work. You must have unique outbound routes for the proper selection to work. N.B. Just having different trunk selections does NOT make the routes non-identical!

    If you wish to emulate this functionality, you can use the 'Redirect' function. Any number you type in the 'Redirect' range will be PREPENDED to the number dialed, and the call will then be sent through the dialplan again (specifically, it will be sent back to the from-internal context). For example:

    • Route 1: Zap/1 matches 0|.
    • Route 2: Sip/Foo matches 1|.

    If you wanted to stop extension 100 from using Zap/1 at all, and send all his calls through Sip/Foo, you would need to DENY 100 access to Route1, and create a NEW route, Route3:

    • Route 3: Sip/Foo matches 9990|.

    In the 'Redirect' field, type '999'. When extension 100 dials 0123456, they match Route 1. Route 1 FAILS, and then system invisibly changes the number dialed to be 9990123456 (note the '0' he dialled originally is preserved, and you then strip 9990 from the front in Route 3), which matches Route 3 and the call is then sent via Sip/Foo.

    Redirect rules are only checked if the route is DENIED.

    You can set a Default Destination if calls are denied. If you wish to use something other than the default in a specific instance, you can use a Redirect prefix and a Misc. Application. Example: set the redirect prefix to 000123, then create a Misc. Application and set the Feature Code to _000123. (note the underscore at the start and the period at the end of the Feature Code - both are necessary), then make the destination of the Misc. Application whatever you wish.

    Caveats: If you already have a large dialplan, see How to increase the execution time and/or memory allowed for "orange bar" reloads - you may need to increase one or both of those values. Also, you probably should be running the SVN version of FreePBX (however, it appears to work with FreePBX 2.5.1.2).

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release
    (the filename is routepermissions-version.tgz)

    Usage tips:

    Apparently some users seem to be having problems because they don't understand that you need to have one route where the number called by the user is matched exactly. For example, if you want different groups of users to access different trunks whenever 1NXXNXXXXXX is called, you must have a route that has the pattern 1NXXNXXXXXX (or some acceptable variation - see next paragraph) in the Dial Patterns textbox, and that should be set to use the trunks that you want the majority of your users to be accessing. You allow access to that route for those users, then for the "exceptions" you disallow access to that route and (optionally) use a Redirect Prefix to redirect the call to another outbound route. What you cannot do is use is use a Redirect Prefix in front of the pattern on ALL your outbound routes. One route should contain a pattern that exactly matches whatever the caller dials. Then you can have other routes that include the same pattern, but with a Redirect Prefix.

    Note that saying that the pattern must be matched exactly does not mean that you cannot add or strip digits in your primary route - it just means that one route must have a pattern that exactly matches what the user actually dials. So if your users dial 1NXXNXXXXXX but all of your providers only want to see the last ten digits, you could use 1|NXXNXXXXXX in your primary route, and then if you want to use a Redirect Prefix of 00009 with some extensions, you'd have another route with the pattern 000091|NXXNXXXXXX (note that in real-world use, it's probably better to strip the leading "1" at the trunk level, because different providers have different requirements. But this is just an example to clarify what is permissible).

    Another point: When a call is denied and a prefix is prepended, the call is then sent back to the from-internal context, as if the user had dialed the call with the prefix prepended. While it's normally expected that the system will try to match the modified number using a route, so that the call will be sent out on a different trunk (or group of trunks) for that particular user, that doesn't necessarily have to be the case. Here's a trivial example:

    Let's say you have to pay a charge for directory assistance calls. You have a route set up that handles nothing but directory assistance calls (matching 411, 1NXX5551212, and perhaps other patterns associated with the service). You have one user that refuses to look numbers up online or in the telephone directory, and has run up hundreds of dollars in directory assistance changes. You want to block his calls to directory assistance, but you also want to play a recording of the boss telling him that if he runs up one more cent in directory assistance charges he's fired!

    So you block the calls and use a redirect prefix (I always suggest using redirect prefixes that start with several zeroes because generally speaking, no "normal" dialing pattern would ever start with more than about two zeroes). So let's say you make the redirect prefix 0000034733 (34733=FIRED on a phone keypad, it's just an example here). Now you create a Misc. Application and set the Feature Code to _0000034733. (note the underscore at the start and the period at the end - the underscore specifies that this is a pattern and the period that there will be additional digits after the prefix). Make the destination of the Misc. Application the Announcement that corresponds to the boss's recording.

    Now, whenever he makes a call to directory assistance, the number he called will have the prefix prepened, and then the call will be sent back to from-internal where the Misc. Application will catch it. And note that you can use a Misc. Application in this way to send the call to almost any system destination. Coupled with a Misc. Destination, you could even reroute calls from a particular user to a particular number, to go to a different particular number. This potentially makes this module a very powerful tool in routing calls from a particular extension.

    Here's another example: You can have speed dial codes that are specific to a group of extensions. For example, let's say you want to make 222 a universal speed dial on your system for the home telephone number of the department manager, but you have several departments, each with their own manager. You could make a Misc. Destination for each manager's home phone (with the manager's number in the "Dial" field), then make a Misc. Application for each (making the destination the Misc. Destination you just created), but in the Feature Code textbox use a unique prefix in front of the 222 (first manager would be 00001222, second would be 00002222, third would be 00003222, etc.).

    Also create a "catch all" Misc. Application that goes to Terminate Call: Congestion, or to a "Sorry, you call cannot be completed" recording or something of that nature, and assign the Feature Code 0000000000 to it (this will only be used if a caller dials 222 from a phone that is not part of a department with a manager).

    Then make a CUSTOM trunk with the following Custom Dial String (this is the only field you need to fill in): Local/0000000000@from-internal

    After creating the trunk, create a new Outbound Route with 222 as the only entry in the Dial Patterns textbox, and select the Local/0000000000@from-internal trunk (created in the previous paragraph) as the only trunk choice for that route.

    Finally, in the Outbound Route Permissions section of each extension's configuration page (for every extension that is part of a group with a manager that should be reachable by dialing 222), check "No" for the 222 Outbound Route, then enter the appropriate prefix of the correct manager in the Redirect Prefix text box (00001, 00002, 00003, etc.). Alternately, you can make bulk changes to entire groups of extensions at once from the Outbound Route Permissions page. Now, when a user in a department dials 222, the call to the "222" route will be disallowed, but the correct prefix will be prepended and then the call will flow through the Misc. Application/Misc. Destination pair and call out to the appropriate manager. Should someone dial 222 from a phone not part of a department, use of the Outbound Route will be allowed (unless you simply disallow it and don't specify a redirect prefix), but it will go to the Custom Trunk which will send it to the "catch all" Misc Application.

    Why it doesn't work when you try to use the same dial pattern in two different routes:

    Some people try to make two routes that contain identical dial patterns and wonder why the second route in never used, even when access to the first is denied.

    Perhaps it will help if I explain it this way. When you place a call, irregardless of what you may or may not have done in routepermissions, Asterisk goes through your routes one by one and tries to match the number called to the patterns in your routes. It stops searching on the FIRST match it finds, and that's it - under no circumstances will it look at any other route once it's found a match. Only AFTER it has found a match (actually, only after it's already sent the call to a trunk) does it check to see if the user has permission to use that route. If yes, the call goes through, but if no, the call stops dead in its tracks (and if you haven't supplied a redirect prefix, it goes to the default destination).

    Let's say you have a second route with identical dial patterns as the first. Your outbound calls will never use it, no matter what you do. Remember: Asterisk stops searching on the FIRST match, and it doesn't check to see if the user is allowed to use the route until AFTER it's made that match.

    So that's the point of the redirect prefix. Let's say your first route has the pattern 1NXXNXXXXXX (not something I'd recommend unless you want to allow some really high-cost calls to the Caribbean, but it's just an example here). If in your second route you also put 1NXXNXXXXXX, that pattern will never be matched. It HAS to be unique. So what I might do is instead use something like 0001|1NXXNXXXXXX for the second route. Then when you deny access to that first route, you put the 0001 prefix in the "redirect" text entry box. Now let's say you make a call to 1-800-555-1212 from an "alternate route" extension:

    ● User dials 1-800-555-1212

    ● 18005551212 is sent to from-internal context which begins looking for a match on the number in the route dial patterns.

    ● A match for 18005551212 is found in a route, the one and only route that will ever be used for the number 18005551212.

    ● The call is then sent to the first trunk in the list associated with that route.

    ● One of the first things the trunk does is to determine if the user (identified by Caller ID number) is allowed to place calls via the route that the call just came from (which is still available in a variable). In this case it finds that no, the user is NOT allowed to place a call on this route, BUT that a redirect prefix of 0001 has been supplied

    ● The called number is then modified to be 000118005551212

    ● 000118005551212 is sent back to the from-internal context which begins looking for a match on that number in the route dial patterns.

    ● A match for 000118005551212 is found in a route (hopefully NOT the same one that would match 18005551212), the one and only route that will ever be used for the number 000118005551212.

    ● Because of the bar character in the dial pattern, the digits 0001 are removed from the called number - note that at this point the route has already been selected - so the number again becomes 18005551212 before being passed to the trunk.

    ● The call is then sent to the first trunk in the list associated with that route.

    ● One of the first things the trunk does is to determine if the user (identified by Caller ID number) is allowed to place calls via the route that the call just came from (which is still available in a variable). In this case it finds that yes, the user IS allowed to place a call on this route.

    ● The call then goes out the selected trunk - or if that trunk is busy, it will try any other trunks associated with that route.

    I hope that helps you understand why you can't use the same pattern in two different routes and expect it to work. You must use a redirect prefix on at least one of the patterns so that it will be recognized as unique.


    Panel (Operator Panel Layout)

    The "Operator Panel Layout" Module for FreePBX

    This module provides layout control of the Flash Operator Panel (FOP)

    Operation

    This module populates a 'panel' database table with layout information relating to FOP.

    Some versions of retrieve_op_conf_from_mysql.pl will detect the existence of the 'panel' database table and use the layout information to generate the FOP

    Preconditions

    This module requires support for the 'panel' database table in retrieve_op_conf_from_mysql.pl . Please see Ticket #2989 for details.

    Open Issues

    The layout preview is crude. It gives an indication of the positioning of the layout areas but it does not attempt to simulate the FOP appearance

    Author

    nick.lewis[-at-]atltelecom.com

    The latest release can be found at:

    http://www.freepbx.org/trac/browser/contributed_modules/release


    phpMyAdmin

    phpMyAdmin

    Purpose:

    This module installs phpMyAdmin as a FreePBX Module.

    Conditions/Prerequisites:

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBXIAF

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_phpMyAdmin


    Set CallerID

    Set CallerID

    Adds the ability to change the CallerID within a call flow.

    Set CallerID allows you to change the caller id of the call and then continue on to the desired destination. For example, you may want to change the caller id from "John Doe" to "Sales: John Doe". Please note, the text you enter is what the callerid is changed to. To append to the current callerid, use the proper asterisk variables, such as "${CALLERID(name)}" for the currently set callerid name and "${CALLERID(num)}" for the currently set callerid number.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Silent Monitor with Whisper

    Silent Monitor with Whisper

    This module adds feature codes to allow supervisors or administrators to spy on a user. Includes additional feature codes for whisper and private whisper modes if running Asterisk 1.4 or higher.

    See Ticket 2441 for more information.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Sys Info

    Sys Info

    Purpose:

    This module installs Sys Info as a FreePBX Module.

    Conditions/Prerequisites:

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBXIAF

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_Sys_Info


    Teletorture

    Teletorture

    An endless IVR that you can send telemarketers to. Based on the work of Steve Murphy.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Temporary Extensions

    Temporary Extensions

    Author's description:

    I was looking around for a particular use case where

    * employee visits abroad and carries a cell/mobile phone. * employee wants an extension forwarded to that phone while he is out of office. * Admin can allocate an extension and set the destination number as his call/mobile. * Admin can also set an expiry date on the extension.

    Once the extension is created, calling in to the system or calling internally to that extension will forward the call using specified international routes (that are used when calling from an internal phone). When you dial the extension past the expiry date, "The extension you dialed, has expired!" message is played back to the caller (this is to stop people abusing the system).

    In this case the trunk cannot be set for this particular extension alone. All calls will go through the trunks/outbound routes that are defined for calling from an internal phone. If this module proves useful for folks around, I can spend some more time and improve it as per suggestions/feedback.

    Module is presently available at Ticket #3624 module submission page:
    http://freepbx.org/trac/ticket/3624


    Tweet2Call

    Tweet2Call

    Polls a specified twitter account for direct messages that contain a valid department like sales, support, billing and a 10-11 digit phone number. When such a message is found it then generates a call via Asterisk (tm) call files to the requested number from the requested queue.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release

    Project page: http://dontcallmyboss.com/projects/


    U.S. Weather by Zip Code

    U.S. Weather by Zip Code

    Purpose:

    This module installs the U.S. Weather by Zip Code program by Ward Mundy.

    Conditions/Prerequisites:

    This module is compatible with the security models used in the following distributions:

    Fonicatec PABX
    Foncordiax
    PBXIAF

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/FreePBX_Module:_U.S._Weathe...


    Usersets

    The "Usersets" Module for FreePBX

    This module provides user based access control for outbound routes

    Operation

    If the use of a userset is specified by an outbound route then the route will not be accessible unless the caller is listed in the userset.

    If not listed the caller will hear the audible prompt "Cancelled" and the call will terminate

    Within a userset there are two types of users:

    (i) Users that are trusted - These users need to provide no authentication. The fact that they are calling from a trusted extension number gives them access to the outbound route.

    (ii) Users that need authentication - These users need to provide authentication to demonstrate that they are who they claim to be. These users are prompted for their voicemail password before being given access to the outbound route.

    If this module is enabled then it hooks into the outbound routes page (in the same way as the pinsets module). All existing usersets are displayed in a list box on the page.

    Preconditions

    This module expects the ext_vmauthenticate class to be in extensions.class.php as per FreePBX Ticket #2777.
    If not the modules functions.inc.php will need to be modified to generate the VMAuthenticate dialplan command itself e.g.
    $command = "VMAuthenticate(" .($mailbox ? $mailbox : ) .($context ? '@'.$context : ) .($options ? '|'.$options : ) .")"

    Open Issues

    A caller's number is tested in turn against each entry in the userset. For large usersets this can be a slow process. More time sensitive users should be put near the top of a userset list.

    Author

    nick.lewis[-at-]atltelecom.com

    The latest release can be found at:

    http://www.freepbx.org/trac/browser/contributed_modules/release


    Voicemail Admin

    Voicemail Admin

    Allows voicemail administration independent of user administration.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release


    Wakeup

    Wakeup

    Provides a feature code for users to place wakeup calls.

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release

    See also:
    Hotel Style WakeUp Calls


    Weather

    Weather

    Provides a Feature Code that users can dial to get a Weather Report, which is spoken using the flite speech synthesis engine.

    This Module requires flite 1.0.3 to be installed. yum -y install flite .

    The latest release can be found at:
    http://www.freepbx.org/trac/browser/contributed_modules/release

    NOTE: This module may be similar to the Nerd Vittles Asterisk Weather Station by Zip Code. Also, see additional comments in this message thread.


    Web MeetMe Support

    Web MeetMe Support

    Purpose:

    This module creates the Feature Code for the Web MeetMe function in FreePBX, and provides for access to the Web MeetMe user interface from inside FreePBX.

    Prerequisites:

    Before this module can be used, Web MeetMe must be installed on your PBX. As of this writing, there are scripts to install Web MeetMe in three distributions:

    Fonicatec PABX (Pre Installed)

    Foncordiax (Pre Installed)

    PBX In A Flash

    Full installation instructions and a link to download the latest release can be found at:

    http://www.fonicaprojects.com/wiki/index.php/WebMeetMe_Support_Module


    FAQ

    FAQ

    It can't be open source without an FAQ.

    Feel free to add a child page to this book to answer any question you feel is Frequently Asked.


    FreePBX v3 FAQ

    How do I install FreePBX v3?

    There are detailed installations instructions available on our installation page.

    How can I upgrade from v2 to v3?

    FreePBX v3 is a developer release and not ready for production installations. As it matures, we will review the upgrade options.

    I would like to write a module, how can I get started?

    The development community around FreePBX is very active on the Freenode IRC channel #freepbx-dev and is usually the best way to get in contact with us directly. There is also a V3 Forum Thread and other options listed on our getting help page for developers.

    I would like to see something new/changed in the core. How do I request that?

    The core developers are constantly looking for feedback and are pretty quick at implementing any suggestions or solutions to problems in the core design. Please drop by the IRC channel for best results. We hope you'll be pleasantly surprised!

    Why is FreeSWITCH supported before Asterisk?

    FreePBX is designed to be engine agnostic. Doing the initial development against an engine other than Asterisk provided a new reference frame in assuring that the approach is really engine independent. Work on an Asterisk generator has already begun, and we would love to see developers familiar with Yate and other engines come forth to help drive those alternatives.

    Won't the engine agnostic design limit FreePBX v3 to the most common denominator?

    No. Being engine agnostic does not mean that all modules and features must run with all engines. We fully anticipate that modules will be written that address capabilities only available or very specific to a specific engine. For example, it would be very easy for a Queue Module be written that takes advantage of the very feature rich Queue Application in Asterisk, that would not be available today when running with other engines.

    What license is used?

    FreePBXv3 is based on the OSI Approved CPAL v1.0 license. CPAL is identical to the MPL (Mozilla Public License) with two minor additions. It includes an attribution clause to recognize the developers and community that surround the project, and it includes a "network" clause very similar to the AGPLv3 license, providing the same requirements when the product is delivered to customers over the network as a GUI often is.

    Isn' t there a conflict since FreePBX v2 is GPLv2 which is not compatible with MPL or CPAL?

    FreePBXv3 has been re-written from ground up. All the code is new so there is no conflict.

    Why did FreePBX v3 change to a new license?

    Most see the Mozilla Public License, and thus the CPAL, as a developer friendly, "weak" copyleft license that allow for proprietary code to be combined with MPL (and thus CPAL) code in one program, or "larger work." Given the large base of VARs and resellers who build commercial solutions around FreePBX, it was seen as a better match for this project and the ecosystem that surrounds it.

    If I write a module, does it need to be CPAL?

    No. FreePBX modules can be licensed however the original developer of such modules see fit. This is one of the advantages of the MPL license that CPAL is based on. This includes other Open Source licenses as well as any other license so long as that license doesn't itself have a conflict when being included within a larger work.

    Can I make my own skin and how does the CPAL license effect this?

    FreePBX v3 is designed to be easily skinned. This has been a long requested feature on version 2 and has been built into v3 form the start. This means you can create a skin unique to your own business. We also hope it results in some great designs contributed back to the project. The CPAL presents no obstacles. The attribution clause requires a small and minor display at the beginning of a session or in the form of a splash screen. It does not need to be displayed afterward and leaves all of the screen real estate in the GUI to design as you see fit.


    Changing the Asterisk manager password

    Changing the Asterisk manager password

    If you are using the default password, you will see the message:

    Warning: You are running FreePBX and Asterisk with the default manager pass. You should consider changing this to something else.

    Running with the default password is a bad idea, simply because everyone else in the world knows it, and (if not properly firewalled, etc etc) could potentially connect to your asterisk box and do bad things(tm).

    Warning: Don't get cute and try to use a password with non-alphabetic or non-numeric characters - things may break in strange ways if you try to use punctuation characters in passwords. Unless you really know what you are doing, stick to numbers and standard alphabetic characters. Also, you should probably read the comments below, to understand the importance of making a full backup before changing anything in case something goes wrong.

    Changing the password

    To do this, you need to edit two files: /etc/asterisk/manager.conf and /etc/amportal.conf

    manager.conf

    This controls the asterisk 'manager' users that are allowed to connect to the asterisk manager interface.

    For full information on the file, see http://www.voip-info.org/wiki/index.php?page=Asterisk+config+manager.conf

    You can have as many users in here as you'd like (for example, an operator panel might use one) and in fact, you should have different users for each application.

    FreePBX requires a user that has a definition like the following:

    [admin]
    secret = secret123password
    deny=0.0.0.0/0.0.0.0
    permit=127.0.0.1/255.255.255.0
    read = system,call,log,verbose,command,agent,user
    write = system,call,log,verbose,command,agent,user
    


    amportal.conf

    There needs to be a corresponding entry in /etc/amportal.conf

    AMPMGRUSER=admin
    AMPMGRPASS=secret123password
    



    Obviously you just need to use the same username (inside the square brackets) and password as above.

    Once you have made the changes, you need to click on "Apply Configuration Changes" in order for the change to propagate throughout the system (If you don't see the orange "Apply Configuration Changes" bar, go to one of the GUI screens in the system and re-submit the page, no changes necessary). If you don't do this, then extensions_additional.conf will have stale data resulting in a broken phone system.


    Changing the MySQL password

    Changing the MySQL password

    Note: Some distributions that include FreePBX and Asterisk have their own way of managing passwords. If you are new to FreePBX, and are using a distribution that includes FreePBX and Asterisk, you may want to read the instructions that came with your installation package to see if there is a script you should run, or some other mechanism for modifying system passwords.

    If you are using the default password, you will see the message:

    Warning: You are running freePBX and mysql with the default password

    Running with the default password is a bad idea, simply because everyone else in the world knows it, and (if not properly firewalled, etc etc) could potentially connect to your mysql server and do bad things(tm).

    Warning: Don't get cute and try to use a password with non-alphabetic or non-numeric characters - things may break in strange ways if you try to use punctuation characters in passwords. Unless you really know what you are doing, stick to numbers and standard alphabetic characters.

    Changing the mysql password

    There are multiple ways to change the password in mysql.

    Using mysql admin

    This requires that you know the existing password. From a shell, run:

    mysqladmin -u asteriskuser -p password newpass

    where asteriskuser is the username (asteriskuser is typically the default username in FreePBX), and newpass is your new password. You will be prompted for the old password interactively.

    Using phpMyAdmin

    Log into phpMyAdmin, and select Privileges from the main page. From there, select the user you want to edit, and click the edit icon next to their name.

    Note on multiple username entries: Note that sometimes there will be multiple user names with different hosts. MySQL identifies users based on the hostname they're connecting from, and allows different passwords for users when they connect from different hosts. Often there is an entry with localhost and another with %. % is a wildcard in MySQL, and means any host in this case. If you have freePBX running on the same machine (which is most likely true) then the localhost entry is a better match than %, so it is the one that will be used. You can usually safely delete the % entry if you're not using it. If you are using a different host, it's better to use that specific host's name or IP than %. See MySQL documentation for more information.

    Scroll down to the "change password" section, and enter the new password.

    Using SQL

    Connect to the mysql interactive shell:

    mysql -u username -p

    Usually you will use root or another user with administrative privileges as the username.

    Run the following SQL command:

    SET PASSWORD FOR asteriskuser@localhost=PASSWORD('newpass');

    asteriskuser should be the username of the freePBX user. localhost should only be changed if your freePBX and MySQL servers are different machines. Be sure to include quotes around the new password.

    type quit to return to the OS shell.

    Verifying the password

    If you want to be sure that the password has been changed, run:

    mysql -u asteriskuser -p

    amportal.conf, cdr_mysql.conf, res_mysql.conf

    Once the password works, you need to update three files:

    • /etc/amportal.conf:

    AMPDBUSER=asteriskuser

    AMPDBPASS=mypass

    • /etc/asterisk/cdr_mysql.conf:

    password=mypass

    user=asteriskuser

    • /etc/asterisk/res_mysql.conf:

    dbuser = asteriskuser

    dbpass = mypass

    Where asteriskuser is the username (asteriskuser is the typical FreePBX default username) and mypass is the changed password.

    (Thanks to gstueve for the comment regarding the latter two files.)


    Your version of FreePBX is out of date

    Your version of FreePBX is out of date

    If you received this error whilst using the Connect to Online Module Repository
    function, this means that your system is out of date. Upgrading to the
    latest released version is always painless and transparent.

    You can not upgrade by simply clicking on the 'Upgrade'
    button on the Online Modules page - The only way to upgrade a Core
    version is by downloading the released packages

    If you're unsure on how to upgrade, follow the Updating instructions.
    A normal upgrade takes less than 15 seconds (after doing the download)
    and there is no interruption to service. Trixbox users MUST read the
    'Important' section further down, or else asterisk won't start
    properly. You have been warned!

    Note that you can use the 'Online Support' module to connect to IRC
    and talk to people there if you're unable to upgrade successfully.

    If you like freePBX, and use it, why not make a donation? You can
    use the button on the right, for any amount. It's all appreciated.
    Also, if you need commercial support, you can use the buttons on the
    left for prompt help!

    Possible errors:

    Trixbox Users (important!)
    You need to delete the file /usr/lib/asterisk/modules/app_trunkisavail.so

    [root@asterisk1 ~]# rm /usr/lib/asterisk/modules/app_trunkisavail.so

    [root@asterisk1 ~]#

    That module also breaks any non-trixbox upgrades, so it's a good idea to get rid of it anyway.

    If you're still seeing the 'You need to upgrade' message:
    Unfortunately, there is no way I could force the 2.1 machines to ignore their cached XML update file. You've got two options:

    Wait an hour until it times out, and then you'll have the new
    module list (It's ok - all your modules are still there, your machine
    is still working)

    or

    From mysql run the command

    [root@asterisk1 freepbx]# mysql asterisk

    (You may need to put -uasteriskuser and -pamp109 on that line as well - check the file /etc/amportal.conf for ASTDBUSER and ASTDBPASS)

    Reading table information for completion of table and column names

    You can turn off this feature to get a quicker startup with -A

    Welcome to the MySQL monitor. Commands end with ; or \g.

    Your MySQL connection id is 1856 to server version: 4.1.20

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> truncate module_xml;

    Query OK, 0 rows affected (0.03 sec)

    mysql> \q

    Bye

    [root@asterisk1 freepbx]#

    After that, when you go to online modules, it'll download the correct, fresh, copy.


    Asterisk With NVFaxDetect

    Asterisk With NVFaxDetect

    Originally Created by: kbmetz

    1. Login to the FreePBX interface of the appropriate Asterisk box. Click on the Setup tab along the top and then select the Inbound Routes selection on the left navbar. Once this page opens, it will default to Add Incoming Route.

    2. Complete the Add Incoming Route window as follows:
    DID Number: <Enter the DID number you created in Step 1>
    Fax Extension: <Change this to "system">
    Fax Email: <Enter FAX recipient's e-mail address here>
    Fax Detection type: <Change to "NVFax">
    Pause after answer: <Change to "20">
    Set Destination: <Select "Core:" and then the recipient's voice extension number>

    3. Click Submit and then click the Red Reload Bar along the top. Asterisk will restart.

    4. SSH into the Asterisk box you're configuring. Type the following commands:

    • asterisk -r
      • CLI> set verbose 10
      • CLI> show application nvfaxdetect

    YOU ARE FINISHED IF YOU SEE A CLI MESSAGE SAYING:

    This application listens for fax tones (on IAX and SIP channels too)
    for waitdur seconds of time. In addition, it can be interrupted by digits,
    or non-silence. Audio is only monitored in the receive direction. If
    digits interrupt, they must be the start of a valid extension unless the
    option is included to ignore. If fax is detected, it will jump to the
    'fax' extension. If a period of non-silence greater than 'mindur' ms,
    yet less than 'maxdur' ms is followed by silence at least 'sildur' ms
    then the app is aborted and processing jumps to the 'talk' extension.
    If all undetected, control will continue at the next priority.
    waitdur: Maximum number of seconds to wait (default=4)
    options:
    'n': Attempt on-hook if unanswered (default=no)
    'x': DTMF digits terminate without extension (default=no)
    'd': Ignore DTMF digit detection (default=no)
    'f': Ignore fax detection (default=no)
    't': Ignore talk detection (default=no)
    sildur: Silence ms after mindur/maxdur before aborting (default=1000)
    mindur: Minimum non-silence ms needed (default=100)
    maxdur: Maximum non-silence ms allowed (default=0/forever)
    Returns -1 on hangup, and 0 on successful completion with no exit conditions.

    IF, INSTEAD, YOU RECEIVE A MESSAGE SAYING THAT NVFAXDETECT ISN'T INSTALLED, YOU MUST COMPLETE THE FOLLOWING STEPS:

    1. cd /usr/src
    2. wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/spandsp-...
    3. tar zxf spandsp-0.0.2pre25.tar.gz
    4. cd spandsp-0.0.2
    5. ./configure --prefix=/usr && make && make install
    6. yum -y install ghostscript
    7. amportal stop (Hurry! Asterisk will be down until you complete!)
    8. cd /usr/src/asterisk/apps
    9. wget http://nerdvittles.com/aah2/app_nv_faxdetect.c
    10. wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk...
    11. wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk...
    12. wget http://aussievoip.com/makefile.patch
    13. patch < makefile.patch
    14. cd ..
    15. make
    16. make install
    17. amportal start

    NOW, SEE IF NVFAXDETECT IS INSTALLED:

    • asterisk -r
      • CLI> set verbose 10
      • CLI> show application nvfaxdetect

    IF YOU NOW SEE THE APPLICATION INSTALLED, YOU SHOULD BE GOOD TO GO!


    Cannot restore to previous version of FreePBX

    Can't do a restore

    You've upgraded to the latest freePBX version, but you can't do a
    restore - it comes up wiht some wierd error about section not found?

    There's some files left over that are interfering with freePBX. You need to clean them out. It's an easy fix:

    rm -rf /var/www/html/admin

    Then do an ./install_amp again. Then you can put your datafile back
    in place, do a restore, and then, do an ./install_amp
    --force-version=whateverversionyouwere running - if you are upgrading
    from 2.8, use --force-version=2.0.1, 2.7 and 2.6 used 1.10.010


    Common Problems

    * Invalid Conference Number when using Page or Conferences
    * 'You are running freePBX and asterisk with the default manager pass.' warning appears
    * 'You are running freePBX and mysql with the default password' warning appears
    * YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL! when viewing Call Records
    * 'You Need to Upgrade' when trying to use online modules.


    Invalid Conference

    Invalid Conference Number

    This is caused by not having a zaptel timing source. Often, this
    will happen when you've upgraded your kernel, but haven't recompiled
    your zaptel to suit

    .

    Quick Fix

    cd /usr/src/zaptel

    make install

    /etc/init.d/zaptel stop

    /etc/init.d/zaptel start

    Or modprobe ztdummy, which provides the timing souce if you don't have any hardware installed.

    http://www.voip-info.org/wiki-Asterisk+timer+ztdummy

    Important Note for RedHat? Enterprise Linux, CentOS 4.2 or similar.

    There is a BUG in the latest kernel from RedHat?, that causes
    zaptel to fail to compile. The way to fix this is to edit the file
    /usr/src/kernels/2.6.9-3

    4.EL-i686/include/linux/spinlock.h and change 'rw_lock_t' on line 407 to 'rwlock_t'.


    Echo Info

    I posted this to Whirlpool a while ago, about how Echo works, what
    causes it, and how you can get around it. It's reprinted here for your
    reading pleasure.

    username_taken writes...

    ..hideous echo coming from the GXP-2000's.

    Actually, the GXP's don't generate echo (well, they do, a bit. But
    you don't notice it. See below). Echo is a perfectly normal part of the
    telephone process. When you call someone (PSTN to PSTN) there is
    _always_ echo. But, here's the tricky part. You don't notice it. When
    the delay is less than 5msec, it merges with the
    (I'm-using-a-two-wire-phone-)side­ tone (which is the sound of your own
    voice in your earpiece) and basically vanishes from your awareness.

    The reason why it's so incredibly visible in VoIP systems is that
    there's an added delay (could be up to 100msec, 1/10th of a second, on
    a slow machine with transcoding) put onto the audio stream. Without
    echo cancellation, calling any phone that has two wires for the audio
    signal, no matter how it's connected, will be pretty much useless.

    This doesn't _have_ to happen at the remote end, by the way. If
    you're using an X100P card in Australia, you will pretty much always
    have totally awful echo, due to the impedance mismatch of the
    Australian phone system (600 ohms) and the American (900 ohms). The
    X100's have no functionality to change the impedance, so you're pretty
    much stuck with it. You _can_ be lucky, and be extremely close to the
    exchange, and have bugger all echo problems. But this is _really_
    close. I don't know of anyone more than 500m away who's been able to
    use an X100P and have a good audio path. (Although, if you have older
    copper [thicker] to your place, you've got a better chance of having no
    echo with an X100. There's a reason for this, but I don't know what it
    is 8)

    The TDM400's have programmable FXO and FXS ports, and then can
    actually 'train' themselves to your phone line (see the incredibly
    poorly documented fxotune in /usr/src/zaptel - I should write something
    down about what it does and how it works one day). By setting
    'opermode=AUSTRALIA' on the command line of the wctdm kernel module, it
    sets the card to the correct impedance, ring voltage, and other various
    arcane things which I haven't decoded yet)

    Now, your home PSTN line has _already_ got an echo canceler on it,
    but it only cuts in when you're calling someone far away - the other
    side of the country, or internationally. You'll find that the places
    you expect to have echo, that are far away, have none. This is normal.
    This is Telstra doing it's job 8) You have to only care about the short
    echos of your own sidetone and the short remote echo (Note, this
    _isn't_ true for an ISDN link.You don't have a two wire system, so you
    don't have a sidetone - no immediate short echo. Yay. But, you can
    still have short and long echo's too, depending on where you're calling
    and how their phone is connected. Also, you may or may not have
    'someone' doing your long echo cancellation for you, too — eg,
    depending on where you call, you _may_ have echo cancellation on
    international calls, but you definitely won't on STD calls). This is
    where the zaptel echo canceler comes in, and it does a fair-to-middlin'
    job of this, when you're using the MG2 EC.

    So, for those that are struggling to catch up - you're using a
    standard POTS line (Plain Old Telephone Service, eg, a two-wire
    standard telstra line). You pick up the phone, dial '1' and blow into
    the mouthpiece. That's your sidetone, and is your first source of echo
    - this is usually easily dealt with if your FXO port is configured
    correctly (eg, not a X100P 8) However, you may also have remote end
    echo. When you call Fred down the street, his two wire system is
    generating echo too, but depending on how far 'down the street' is -
    you live in cairns, and Fred might live in melbourne - they're all on
    highway 1! 8) you may or may not get remote end echo. Realistically,
    this is rarely a cause of echo problems on a PSTN line, it's usually
    local echo that causes grief. Telstra are pretty good with their EC
    stuff. (Fred could also be using a speakerphone which is causing far
    end echo. It gets complex)

    However, username_taken has a digital system. An ISDN circuit
    (usually) has no echo cancellation on it, which means you have to
    handle it yourself. This can be done (simply, very well, and
    expensively) by buying a hardware echo canceler, which is full of DSP's
    and various funky stuff, and plugging it in. All your echo problems go
    away. Or, it can be done (reasonably simply, kinda OK, and for free)
    with the zaptel echo canceler. There were some bad, nasty bugs with the
    pre-1.2 trunk EC's, including them overflowing when the echo was too
    loud (this is how people have mentioned they 'fixed' their echo by
    turning down txgain - it just means that the EC isn't overflowing. If
    the user shouts, they'll get their echo straight back again), and
    various other silly, but difficult to find bugs.

    Now, as I mentioned at the top, there's also a third source of
    echo, but you don't notice it - the other party does. It's local echo.
    This is caused, most of the time, by a telephone that doesn't have
    acoustic shielding in the handset between the microphone and speaker.
    The noise travels down the inside of the handpiece, is picked up by the
    microphone, and the person at the _other end_ hears what they said,
    faintly.

    Now, finally, to the the point of this saga: that VoIP phone's
    don't 'cause' echo. They just make it audible by introducing an extra
    delay. The reason why people go 'Geez, those GXP-2000's cause terrible
    echo' is because they have just got an X100P card, they've plugged in
    into their PSTN line, and they have a bloody awful setup. They use
    _anything_ and they'll have terrible echo. However, they hear that
    people don't have echo so they go, 'well, it kinda works. I'll get a
    TDM400 and a polycom' or something like that - by getting rid of their
    untuned, $2 FXO card, they've fixed the cause of their echo. Spending
    $500 on the phone was just so they had a funky phone on their desk 8)
    (GXP's, by the way, DID used to case echo, by them having no echo
    cancellation on their speakphones, which means that as soon as you
    stuck your phone on hands free, the person at the other end hated you
    with a passion. This has been fixed in the current versions)

    Any more echo questions? I think I've covered most of the stuff you
    'need to know' - there are other things like 'complex echos' (eg, the
    'old' conferencing method was splitting the tx and rx out [causing
    echo], sticking all the tx lines into an amplifier, and firing them
    back out into the rx of everyone's line [again causing echo]), and how
    you can disable ec on your home line to play with it (that tone that
    faxes and modems beep at the start? That's a 'turn echo cancelation
    off' signal to the exchange), and all sorts of other things.

    PS: I just realised, I didn't emphasise the point of this post.
    Edit the file /usr/src/zaptel/zconfig.h, and find the three lines that
    say:

    1. define ECHO_CAN_KB1

    /* This is the new latest and greatest */

    /* #define ECHO_CAN_MG2 */

    Change them around You want to have KB1 commented out, and MG2 enabled:

    /* #define ECHO_CAN_KB1 */

    /* This is the new latest and greatest */

    1. define ECHO_CAN_MG2

    Type 'make install' and then stop asterisk, reload the modules, and
    start asterisk again. You're now running the 'good' echo canceler! You
    can check this by doing a 'dmesg' after you 'modprobe zaptel' - it
    should say something like this on the last two lines:

    Zapata Telephony Interface Registered on major 196

    Zaptel Version: SVN-trunk-r969 Echo Canceler: MG2

    --Rob

    Asterisk x100p echotraining article at voip-info.org - also see this comment.

    Solving Common Echo Problem article at VOIPSpeak.net


    FAX

    * Asterisk With NVFaxDetect
    If you want to try to receive incoming faxes with Asterisk and FreePBX, here are the setup instructions
    * Faxing with rxfax and txfax
    * Installation of HylaFax with IAXmodem


    I'm using Trixbox, I upgraded FreePBX and now things don't work!

    I'm using Trixbox, I upgraded FreePBX and now things don't work!

    Trixbox did a "fork" of FreePBX, so that the FreePBX they supply is no longer a genuine version of FreePBX, it is their own "forked" version. If you try to use modules written for genuine FreePBX, or do an upgrade from the FreePBX site, it will most likely "break" Trixbox. At that point you have three options:

    • Try seeking assistance in one of the FreePBX or Trixbox forums - perhaps someone there can assist you, and get you up and running again (for starters see this thread in the FreePBX forum or this thread in the Trixbox forum).

    • Reinstall Trixbox from scratch, then in the future only do updates from their repositories.

    • Move to another distribution that provides genuine, un-forked FreePBX. Those distributions include (in alphabetical order): AsteriskNOW, Elastix, Fonica PABX and PBX in a Flash, and possibly others by the time you are reading this. Each of these distributions has its strengths and weaknesses, but the main thing they all have going for them is that they use genuine, un-forked FreePBX.

    Naturally, we would recommend that you take the latter approach. However, if you do choose to stay with Trixbox and their forked version of FreePBX, please keep in mind that we can offer you little or no support - if you have questions or are experiencing problems, your best bet would be to post a message in one of their forums. If they try to pass the buck by saying it's a FreePBX issue, remind them that they have taken the responsibility to maintain their own forked version of FreePBX, so it's a Trixbox issue, not a FreePBX issue.

    And also, if you choose to stay with Trixbox and someone in the FreePBX community attempts to assist you, please keep in mind that while the advice they offer might be appropriate for genuine FreePBX users, it may not work for Trixbox users (and might, in fact, make the problem worse). As users of the un-forked version of FreePBX, we generally have no idea what changes the Trixbox folks may have made, and therefore any advice we offer may or may not be applicable to your system. Use it at your own risk.

    For discussion of this issue, see this FreePBX forum thread.


    I've Written a Module and Want to Submit It, How do I do That

    New module submissions are a regularly occurring event and you will find many modules that have been submitted as tarballs in the Ticket system that are not available in the online system. Why is that?

    The FreePBX project is designed as a Framework that can easily accommodate new modules and for that reason, new modules get written and submitted. This does not mean that we put every module that comes along into the project. As the project has matured and stabilized, we are putting a lot more thought into the architecting of the FreePBX as it continues to evolve and mature into a world class product. In order to do that, we need to carefully evaluate what officially enters the system since adopting a module has many implications. We try very hard once something becomes part of the project to take on the commitment of maintaining and supporting it and making sure that future upgrades of the project will continue to work with the Modules that are part of it. If you are thinking about writing a module that you would like to be part of the core project, you should talk with one of the active developers in advance.

    This does not mean that the other modules are less valuable or inferior in any way, if we don't adopt them. In the past we have not had any mechanism to facilitate and house these modules, other than a tar ball stuck in a module submission ticket somewhere. We will be working on addressing this shortly, so that we can have an SVN repository location for such third party modules to provide easier access. We are also investigating the use of the command line module_admin program (you probably didn't know that existed did you?) to provide an online ability to install such third party modules. Some day we will get this into the GUI but there are other changes that need to happen in the GUI to accommodate this change.


    HOWTOs

    Another venerable open source tradition are the HOWTOs.

    Short tutorials on subjects that span multiple modules for the purpose of doing something.

    If you found something difficult to do, and eventually learned how to do it, think about writing an article and postin it here.


    Basic usage of route prefixes to reroute calls from specific extensions

    Basic usage of route prefixes to reroute calls from specific extensions

    This document is to explain the usage of route prefixes to select a specific route for outgoing calls. It assumes you already have a good working knowledge of how FreePBX Outbound Routes and Trunks work - if your not certain of that, you may want to read Hints on Route Dial Patterns and Trunk Dial Rules before reading this document.

    In the old days of telephone-company supplied PBX's, it was a common practice to require PBX users to dial "9" to get an outside line. Although you may not have viewed it this way, this was an early example of using a prefix to select a route - in this case, a route for local outgoing calls. By the way, it's no longer considered good practice to require users to dial a prefix for local calls, but you still find this relic of the past on many existing PBX systems.

    Sometimes a company would purchase a "foreign exchange" (FX) line in another city. For example, a company in Detroit that had many customers in Windsor, Ontario might purchase a Windsor FX number. It would be set up to use a different prefix on the PBX, so employees might dial "9" for a local call in Detroit, and "8" for a local call in Windsor.

    In a similar manner, a company might have wanted a line specifically dedicated for the use of certain executives. This might be "hidden" behind a code that regular employees weren't supposed to know. For example, dialing "77" might give the executives access to "their" line.

    Note that in all cases, the routing prefix could not conflict with any other number in the user's number space. For example, if you used three digit extensions in the range 100-899, then you couldn't use "8" or "77" as dialing codes. You might have to use something like "99" for local calls, "98" for the FX line, and "977" for the "secret" trunk.

    All of these were examples of using a prefix to route calls at the time of the call. The problem, of course, was that employees wouldn't always use the correct prefixes. The employee in Detroit might dial 9+1-519-NXXXXXX (where NXXXXXX is the local number) to place a call to Windsor, effectively making an expensive international call instead of a cheap local call. Or, a bored regular employee might start dialing random digits and discover the bosses' "secret" line. So, as soon as electronic switching came into use, methods were devised to take control away from the end user and put it in the system itself. The user would simply dial the number; the system would figure out how to route it (and whether the user should have access to any "special" trunks).

    Now, one thing FreePBX excels in is selecting trunks based on the pattern dialed. And if you really want to (and still have your head stuck in the 1950's), you can still use the old-style manual prefixes with FreePBX. For example, if someone dials 9+1-800-555-1212, you can easily strip the 9 at either the route or trunk level (for now we will concentrate on routes). So in your route, you might have a pattern like 9|1800NXXXXXX, and similar patterns for other toll-free prefixes. Numbers before the | character are not sent to the trunk, so the 9 would be stripped off.

    But, we don't NEED to use prefixes to select routes. Suppose we were actually replacing an old PBX in Detroit, and we brought the Detroit number into FreePBX on a ZAP/DAHDI channel, and the Windsor FX line in on on a second ZAP/DADHI channel. We'd have a trunk for each channel, and a route for each trunk. We'd then use a pattern like 1313NXXXXXX and/or 313NXXXXXX in one route to send Detroit area calls to the Detroit trunk. We could use patterns like 1519NXXXXXX and/or 519NXXXXXX in a different route to send all area code 519 calls to the Windsor trunk (I know that doesn't take into account that not all area code 519 calls are local to Windsor, but this is just an example).

    So, users are relieved of the burden (or responsibility, depending on your point of view) of selecting the correct trunk for calls to a specific area. The system does that for them. And as noted above, out of the box FreePBX handles this very well.

    The problem is that if we want to give a specific user's calls (or the calls of a group of users) different handling, up until recently there's been no way to do it natively in FreePBX. Sure, we could set up a manual prefix that the executives would dial to access the "boss route" and then strip it at the route level, but these are busy people (in their own eyes, anyway) and don't want to be bothered dialing prefixes. The problem is even worse if you have different departments that use different groups of trunks - sooner or later someone in one department will find out the "secret" dialing prefix that the other department's employees are supposed to use, and mischief will result.

    Now you may be thinking ahead a bit and realize that if forcing users to dial 9 for a local call is no longer acceptable practice, then you need some way to distinguish between calls that stay on your system and calls that do not. In North America, many system administrators have adopted the practice of numbering all local extensions starting with 11 or 10, because no area code begins with 0 or 1. So, extensions might be numbered from 1000 through 1199, which allows for 200 extensions (and no conflict with any ten or eleven digit pattern used for "outside" calls). If you don't have anywhere near 200 extensions (and don't expect to), you might appropriate some of those unused extension numbers as dialing prefix codes. But that assumes that users would actually be dialing those codes, and that exactly what we'd like to avoid. (By the way - consider this a slightly off-topic sidebar - you can also use dialing timeouts on local extension numbers, and use the # key as a shortcut to avoid the timeout, which actually gives you more available extensions for the same amount of button depressions - but some people just can't seem to get the hang of pressing the # key at the end of a local extension number).

    In any case, the principle is this. By default, if you dial a particular "outside" number, it will go out on the route that matches that pattern exactly, and that route would select one or more specific trunks. But you could have a second route, with the same dial patterns except prefixed by (for example) 1199| and then if someone dials 1199+that same "outside" number, the call would go out that route, the prefix would be stripped and the call would go out the trunks associated with that route. And you could have as many additional routes and route prefixes as you need.

    If you're still following along at this point, let's now consider this: Suppose the user didn't have to dial the route prefix? In many endpoints, you can set up the dial rules so that if you dial a specific pattern, it will prepend a prefix before sending it to FreePBX. Since the user isn't manually dialing the prefix, we can use something a bit longer and perhaps more obscure. For example, we might use something like 000001 to access the first alternate route, 000002 for a second alternate route, etc. Since no "normal" number in any country that we're aware of begins with that many zeroes, it's safe to use something like that as a prefix pattern without risk of conflicting with something a user might actually dial. This also makes it easier to actually key the prefix to a particular extension, for example a route specifically for use by extension 1123 could be given the prefix 000023 (or even 000123), which makes it a bit more mnemonic when you are trying to figure out which route goes with a particular extension.

    But instead of forcing the user to dial this prefix, or programming it into each endpoint individually, we now have the option to do this directly from within FreePBX. Unfortunately, the methods to do this are not part of the "official" FreePBX distribution yet.

    The easiest method is to use the (at this point unsupported, third-party) Outbound Route Permissions module. When you use this module, it adds a new section to each extension's configuration page that lists each of your Outbound Routes. For each extension, you can allow or deny access to each route. But there is a third option - if you choose to deny access to the route, you can specify a "Redirect Prefix". This simply adds a route prefix to the number, the same as if the user had dialed it manually, and sends it back through the dialplan. So, you simply give "regular" users access to the "regular" routes, but deny access to the "special" routes (so even if they happen to know your internal routing prefix, it won't do them any good). Then you could give other users access to the "special" routes, but deny them access to the "regular" routes, while using a "Redirect Prefix" so that when they dial a call normally associated with that (regular) route in the normal manner, it will prepend the prefix and send the call through the system again, so the call will be processed just as if the user had dialed the prefix manually.

    Now you may be wondering why you need the prefix at all - if you deny access to one route and use the same dialing patterns in another route, won't the call go out over the second route without the prefix? Well, we might wish it worked that way, but it doesn't. Remember that we are using Asterisk underneath FreePBX, and Asterisk doesn't work that way. At the ROUTE level, all numbers must be unique - if two routes have overlapping patterns, Asterisk will only match on the first.

    So what you do is, you prepend the routing digits - but you let FreePBX do it instead of requiring the user to do it - and then send the call through a Outbound Route that strips the routing digits before sending the call to the appropriate trunk(s).

    There are other methods to accomplish this. Instead of using the Outbound Route Permissions module, you can manually add the prefix using code in extensions_custom.conf - see How to give a particular extension different or restricted trunk access for outgoing calls for details. And, there is a third-party, unsupported Custom Contexts module that uses a different method of route selection. That module arguably allows more precise control, but many users (including the author of this document) find it more difficult to use if all you want to do is change the route access for certain extensions. Plus, the author of that module apparently has not had the time or interest to keep it updated, and there have already been issues with it not working after a FreePBX version update, although a patched version was released that corrected that issue. It is a more powerful module, but very few users really need all the functionality it provides (again, in the opinion of the author).

    I hope this document has helped you understand a bit of the theory (and history) behind adding a prefix to certain calls to force them to use a particular Outbound Route (and, therefore, a particular trunk or group of trunks), and how this can be used to our advantage to force calls from a particular extension (or group of extensions) to use certain specific trunk(s) instead of the default trunk(s).

    Note that although this document describes the rerouting of calls from particular extensions, the same technique can be used in other situations. As an example, one user had calls for two companies coming in on two different DID's, but at night they wanted to forward the calls to an answering service. In order for the answering service to get a different Caller ID for each company (so they could answer the call using the correct company name) it was desired to send the calls for each company out via a different trunk. But, FreePBX would only use the first Outbound Route that it found that matched the pattern for the answering service telephone number.

    Originally, at night the calls were being sent to a single Misc. Destination that went to the answering service telephone number. Let's say that the answering service number was 5552368. Instead of making a single Misc. Destination forwarding to 5552368, the trick was to make two Misc. Destinations using (for example) 0000015552368 and 0000025552368 as the respective destinations, the creating two new Outbound Routes, with 000001|5552368 as the dial pattern for the first route, and 000002|5552368 as the dial pattern for the second route. Each new Outbound Route was set to select the correct trunk (a different one in each of the routes), and both Outbound Routes were placed higher in priority than the "general" Outbound Route that would normally handle calls to 5552368. Then, all that was left to do was to send each DID to the correct Misc. Destination (using a Time Condition) at night.


    Configuring IMAP voicemail for FreePBX

     

    A couple of notes first:

    1. IMAP support is only present in Asterisk 1.4, not 1.2.
    2. I can only attest to use of the Cyrus IMAP daemon. The other commonly used IMAP daemon, dovecot, may or may not require changes to the instructions here. If you find out that is the case, let me know, and I will update this HOWTO.
    3. That said, on to the meat:
    4. Download and build the UW imap client. Do NOT install it; asterisk will bind the compiled client into itself. Look at the file doc/ imapstorage.txt in the asterisk 1.4 source tree for specific instructions.
    5. Configure asterisk for IMAP voicemail support. This is also explained in the same imapstorage.txt file.
    6. Install asterisk by 'make install'.
    7. Go to /etc/asterisk, and edit the file vm_email.inc. The voicemail text message in /etc/asterisk/vm_email.inc will not work if sent to an IMAP server. The text is required to end each line with \r\n, not \n. Dovecot may not care (dunno), but Cyrus (which clarkconnect runs) bitches about 'bare newlines'. I fixed it (for now) by manually adding the \r characters where needed. Unfortunately, this may be overwritten by updates, so make a copy to restore (this is ugly and needs to be fixed somehow.)
    8. Edit voicemail.conf and add the 4 lines following (beware that this also can/may be overwritten):
    9. imapserver=localhost
      imapflags=notls
      imapfolder=INBOX/Voicemail
      expungeonhangup=yes
      authpassword=YOURIMAPPASSWORD
    10. Now, start up asterisk, and browse to your config. For the extensions, put 'imapuser=YOURIMAPUSERNAME' in the VM Options field. For Cyrus, it seems you need one username&password for all extensions. If not, let me know how to change this.
    11. For any extra extensions, change the mailbox field in Device Options to have default@NNN, where NNN is the primary extension. This is so MWI will work. NOTE: you will still be prompted for your mailbox, even if you call "My Voicemail" speed-dial, since asterisk can't tell who you really are.
    12. In your email client, create a mailbox called "Voicemail".

    This *should* all work (at least it did/does for me.) Issues/glitches, let me know, and I'll update this.

    Hints and Tips

    * Asterisk Tutorials Free video tutorials on Asterisk, TrixBox, and FreePBX
    * Custom feature codes to read back the feature status of extensions - Allows users to find out how features such as Call Waiting, Do Not Disturb, and the variations of Call Forwarding are presently set, simply by dialing a feature code
    * Feature Codes - Numbers you dial for various things (Call Forwarding, Divert, etc)
    * Follow-Me Function implemented using Queues tutorial at VOIPSpeak.net
    * Hints on Route Dial Patterns and Trunk Dial Rules - Helps to clear up confusion for new FreePBX users
    * How to change incoming CallerID - Does your provider chop off or add digits to CallerID, so call return doesn't work? Here's a way to fix it (until we get a way to do it in the trunk definition)
    * How to get the DID of a SIP trunk when the provider doesn't send it (and why some incoming SIP calls fail) - Can't get an inbound route for a particular SIP trunk to work? Calls from one particular SIP provider won't come in at all, or only come in on your default route? Or, maybe you have two or more SIP trunks from the same provider, and Asterisk thinks all your incoming calls are from only one of the trunks? The answers might be here
    * How to make multiple extensions use a common voicemail box
    * How to make voicemail accessible from an outside line - You can allow your users to access their voicemail from anywhere there's a phone
    * How to upgrade Asterisk - This is not necessarily something you should do, but if you feel you must, here's how
    * I upgraded, but I can't do a restore
    * MythTvOsd - Displaying caller ID info on MythTV's on-screen-display
    * New FreePBX users guide to diagnosing problems - Read this BEFORE you go into the #freepbx IRC channel
    * Resolving Audio Problems - No audio? One-way audio? Here are some common fixes for audio issues - also read this page if you are trying to set up FreePBX behind a NAT firewall
    * Resolving FreePBX and Sipura/Linksys Supplementary Service and Feature Code Conflicts
    * Setting up a trunk and route for free Directory Assistance in the USA - Don't pay the phone company for looking up a number!
    * Setup a Linksys/Sipura SPA-3000 with FreePBX - Also applicable to SPA-3102
    * Tested and working SIP provider configurations
    * Trunk Hints - Configuration hints for various VSP's


    Hints on Route Dial Patterns and Trunk Dial Rules

    Hints on Route Dial Patterns and Trunk Dial Rules

    New users of FreePBX are often confused by the fact that there is a place to enter "Dial Rules" when creating a new Trunk, and "Dial Patterns" when creating a new Outbound Route. Since the construction of these seems similar, users try to do something in the wrong place and it doesn't work. This is a brief attempt to explain the difference.

    Trunk Dial Rules

    First let's deal with trunks, because they are perhaps the easiest to understand. The thing to remember about Trunk Dial Rules is that they are ONLY used for adding numbers to, or subtracting numbers from the number being sent to the trunk. Trunk Dial Rules are NEVER used to allow or restrict numbers that may be dialed. Therefore, it follows that any entry not containing a | character (to strip off number at the start of the entry) or a + character (to add numbers at the start of an entry) in totally useless - it will simply waste processor time while the system looks at those entries.

    To give an example, here's a common newbie mistake. Let's say that you have a couple different trunks that allow outgoing toll-free numbers in the USA, and one of them is Free World Dialup, which requires a star (*) key in front of the actual number. For the moment, let's assume that you want to restrict these trunks to toll-free numbers only. So in the first trunk, you might be tempted to put some lines like this:

    1800NXXXXXX
    1822NXXXXXX
    1833NXXXXXX
    1844NXXXXXX
    1855NXXXXXX
    1866NXXXXXX
    1877NXXXXXX
    1888NXXXXXX

    And then in the Free World Dialup trunk, you congratulate yourself as you cleverly add the * to each toll-free definition:

    *+1800NXXXXXX
    *+1822NXXXXXX
    *+1833NXXXXXX
    *+1844NXXXXXX
    *+1855NXXXXXX
    *+1866NXXXXXX
    *+1877NXXXXXX
    *+1888NXXXXXX

    Congratulations, you've managed to waste a bunch of processor time! In the first example, NONE of the entires are accomplishing a thing because none of them contain a | or + character. You could (and should) remove every one of them. Call filtering by number dialed is done by ROUTES, not by TRUNKS.

    Note: There is, however, one exception to the general "definitions without a | or + are useless in a trunk" rule. A definition without a + or |, if matched, will stop the processing of definitions beyond that point. Consider the following example:

    555XXXX
    1321+NXXXXXX

    This will add 1321 to any 7 digit number, EXCEPT those starting with 555. So, a definition can also be used as a "stopper" to prevent that pattern from being matched by another definition that is lower in the list (thanks to groogs in the #freepbx IRC channel for this clarification).

    And in the second example (the Free World Dialup trunk), you could accomplish the same thing by ONE line, like this:

    *+18XXNXXXXXX

    or

    *+1NXXNXXXXXX

    or, because you know that "real" Free World Dialup numbers are five or six digits long, you could even use

    *XXXXXX.

    (Note the period as the last character) - Which would prepend the * to any number 7 digits long or longer (although you may not want to do this if you use Free World Dialup as a route to other networks, but that's a more advanced discussion).

    Again, this bears emphasizing: You CANNOT use Trunk Dial Rules to allow or restrict certain numbers from going out on a trunk. You can only add or strip digits.

    Route Dial Patterns

    Route Dial Patterns are used to specify what numbers are allowed to go out via that route. When a call is placed, the actual number dialed by the user is compared with the Dial Patterns in each route (from highest to lowest priority) until a match is found. If no match is found in any route, the call fails (there is "no route" for that call).

    If the number dialed matches a pattern in more than one route, only the rules in the route with the highest priority are used. In other words, if a call tries to use that route and fails, it does not keep trying additional routes to see if it matches another. This is actually desirable behavior because it allows you to force certain calls to go out via lower cost routes.

    Route Dial Patterns cannot be used to add digits to the number dialed by the user. However, you can strip off leading digits before passing them to a trunk. This is most useful if you use a specific dialing code to access a particular route (for example, "9" to access an outside line).

    Note that each route can be set to access one or more trunks. Each trunk may require different translations (changing what was actually dialed to something else before sending it on is called a translation in telephone-speak) so you don't want to strip digits at the route level if only some of your trunks will require it and some don't.

    Route Dial Patterns only allow calls, they cannot block calls. The only way to block certain patterns is to make sure they are not included in any route. Or, you can include the blocked pattern in a higher priority route, then make sure that route doesn't send calls to any trunks that cost money. The easiest way to do this is to create an ENUM trunk.

    For example, let's say you want to allow all calls within Country Code 1 EXCEPT calls to 1-900 numbers and to local 976 numbers (in a real situation you'd probably have additional restrictions, but this is just to illustrate the technique). In a lower-numbered route (which has a higher priority) you could include these lines in the Route Dial Pattern:

    1900XXXXXXX
    1NXX976XXXX

    Then make sure that the only trunk that route accesses is the ENUM trunk (create one if you don't have one). Because ENUM is always free, chances are the call will never complete, but if it does it will not cost anything. Now make a higher numbered route (lower priority) and either include a general pattern such as:

    1NXXNXXXXXX

    Or if you want additional security, you could instead use a list of specific area codes that you wish to allow (omitting those that do not exist or that you don't want to allow calls to be placed to):

    1202NXXXXXX
    1203NXXXXXX
    etc.

    Yes, it may be a fairly long list, but it will work. You may still want to use ENUM as your first trunk choice (if you want to check for a "free" route to the called number, before going to your usual provider), but then you will be sure to include a trunk that permits outgoing calls to these numbers.

    How do I....?

    How do I allow seven digit dialing for local calls in North America?

    In the route that handles calls to your local area code, include this in your Route Dial Patterns:

    NXXXXXX

    In the trunk(s) accessed by that route, include this in the Trunk Dial Rules:

    1aaa+NXXXXXX

    Replace aaa with your local Area Code.

    How do I block certain International destinations while allowing others?

    Again, make sure you've set up an ENUM trunk which can be used as a destination for calls you don't want to pay for. Then think about your dial patterns and how you want to allow or block them. Remember that less specific rules must always be placed in a lower priority than more specific rules. For example, let's say we want to allow calls to landlines in country code 64, but not to mobiles or high-cost numbers. In a higher priority (lower-numbered) route, include the patterns you want to block, e.g.:

    011642.
    011648.
    01164900.

    Associate this route with the ENUM trunk only. Then in a lower priority (higher-numbered) route, place the more general pattern:

    01164.

    Then associate this route with the ENUM trunk (if you want to check for a "free" route first), followed by the trunk(s) of the provider(s) you wish to use for calls to country code 64. Don't forget to strip the "011" or "00" international prefix (or whatever the prefix is in your part of the world) in the ENUM trunk Dial Rules.

    How to access additional advanced extension options

    How to access additional advanced extension options

    Sometimes FreePBX users want to access additional options for extensions. The key to this is to use the Follow Me module. Once it is installed, it can be used for more than just setting up a Follow Me for an extension. Quoting from the Follow Me documentation:

    "There are other 'creative' uses of the Follow-Me function. At the simplest, you can simply put in the extension of the Follow Me number with a choice to go to its voicemail if not answered and you will be accomplishing exactly the same thing as if the extension was being dialed. However, you can now diverge with such simple things as changing your ring time to override the default, adding an announcement, going to an alternative voicemail or other destination if not reached, and of course adding multiple numbers and ring strategies when someone tries to call that number."

    So what you do is select Follow Me in the left-hand menu that appears on most FreePBX pages. From there, you can select an extension and then configure a Follow Me and/or any of the additional options. Mouse over the option name on the Follow Me page for a more complete description:

    Follow-Me List: If you don't really want a Follow Me and are only using this page to set some advanced extension options, then make sure that only that extension's number appears in this list (for example, for extension 234 only 234 should appear in the list!). Conversely, you may want to use a follow-me to set up a form of intelligent call forwarding, with the ability to take the call back and forward it someplace else if the first number you try is busy or doesn't answer - in that case you might put the extensions or numbers you wish to forward to in the list, but not the original extension's number.

    Ring Time (max 60 sec): Use this to change the default amount of time an extension rings before going to voicemail, or another no-answer destination (see below).

    Announcement: This is used to specify an announcement to be played to the caller prior to ringing the extension (this is where you can play one of those "This call may be recorded or monitored" type announcements, for example). Note that this announcement will play BEFORE the extension commences ringing, and therefore cannot be interrupted by the called party picking up.

    Play Music On Hold?: This allows you to select a Music-on-Hold category so that you can play music (and/or pre-recorded announcements) while the extension is ringing. This IS interruptable, by the extension picking up or the Ring Time expiring.

    Alert Info: Allows you to set up distinctive ringing with certain types of SIP extensions. What you place in this text field will be determined by what the SIP endpoint expects to see (often a string that beings with "Bellcore") - see your SIP endpoint's documentation. The biggest use of this for a single extension is to help distinguish which extension is ringing when there is more than one in a room.

    Destination if no answer: Where the call goes when the Ring Time has expired. Normally you'd set this to the extension's voicemail, but you could also send the call back to the IVR, or to another extension, or whatever - it's up to you.

    Note that all the above options (and the others that I did not mention) may have additional uses if you are actually setting up a Follow Me (that is, you have more than one destination in the Follow Me List). To discover these, mouse over each option - you should see a small text box that gives you additional usage details about each option.

    There is one other question that frequently arises, and that is how to restrict one extension or a group of extensions from making outgoing calls via certain trunks, while allowing unrestricted access to other extensions. One way to do this is to set a route password (or PIN set) on the individual routes to which you wish to restrict access - this has the advantage that "approved" users can make calls from any phone on the system, while the night cleaning crew cannot make outgoing calls just because they have physical access to a "approved" phone (unless someone knows the password). However, people hate dialing passwords or PINs, and the higher they are in the organization the more they seem to think it is a waste of their time and effort to put up with this type of security feature.

    Another option is to use the UNSUPPORTED Custom Contexts module - this will let you set access restrictions for individual extensions, but because the module is unsupported there is no guarantee that it will continue to work with future versions of FreePBX (if you do use this module, make sure you have the most recent version installed whenever you upgrade FreePBX!). It's also a bit difficult to maintain, particularly if you frequently add or remove routes, because of the necessity of setting priorities for each route (and making sure they are set correctly when a route is added, removed, or moved).

    A third option is to use the method devised by Moshe Brevda and documented in this blog post: Restricting outbound calls in FreePBX (whitelist). This method allows call restriction on a per-extension basis, with exceptions placed in a "whitelist" of numbers that can be called despite the block.

    Finally, there is the method I have described in this FreePBX forum post: A different approach to placing outgoing calling restrictions on certain extensions. This differs from Moshe's approach in that although it also allows call restriction on a per-extension basis, my method restricts access to specific outbound routes - an outbound route can be restricted or non-restricted. If an extension is restricted and tries to access an outbound route that is restricted, the call will be blocked. If either the extension or the outbound route are not restricted, the call will go through.


    How to automatically reject calls from telemarketers and other "junk" callers

    How to automatically reject calls from telemarketers and other "junk" callers

    Note 1: This is a preliminary version of this page; it may be updated with additional information or to correct errors!

    Note 2: The third-party Caller ID Superfecta module also provides a method for rejecting "junk" calls, that might be easier to implement than the method shown here.

    This technique uses the service EveryCall.us to look up the numbers of incoming calls that are coming in via selected trunks. If you get a lot of calls from telemarketers and other "junk" callers, this may help you avoid having to deal with them. It's not foolproof, of course, but it will hopefully catch a good percentage of your "junk" calls.

    We are using EveryCall.us for two reasons - first, you don't have to register just to do a phone number lookup, second, they have set up a special way to query their service that is very fast and that sends only a minimal amount of information (a "score" associated with a number, or -1 if it's not in their database at all). So we just look at the score and if it's over 10 (you can change that) we send it to the junk call treatment. Here's how to set it up.

    Step 1: Make sure curl is installed on your system. From a Linux command prompt, type curl --help
    If you get a list of curl options, you are good to go. If not, install curl in the usual manner (e.g. yum -y install curl may work on a CentOS system).

    Step 2: Still at the Linux command prompt, enter touch /var/lib/asterisk/agi-bin/check-everycall-us.agi

    Step 3: Use a text editor (nano, Midnight Commander's editor, or whatever you like) to edit the /var/lib/asterisk/agi-bin/check-everycall-us.agi file. Copy and paste the following code into it:

    #!/bin/bash
    
    BADCALLSCORE="0"
    RETRIEVEDSCORE=`/usr/bin/curl -s -m 2 -A Mozilla/4.0 http://www.everycall.us/query\?${1}`
    BADCALLSCORE=`echo ${RETRIEVEDSCORE} | grep score | sed -e 's/.*score=//' -e 's/ <br\/>//'`
    
    if [ -z $BADCALLSCORE ]
    then
    	BADCALLSCORE=0
    fi
    
    echo "SET VARIABLE badcallscore ${BADCALLSCORE}"
    

    BE SURE NOT TO LOSE ANY BACKTICKS during the copy and paste operation! Be sure to save your changes.

    Step 4: Change the permissions and ownership of /var/lib/asterisk/agi-bin/check-everycall-us.agi to be the same as the other .agi files in the /var/lib/asterisk/agi-bin directory. I always use Midnight Commander's "Advanced chown" (under the File menu) to view and change permissions, not being a Linux geek at heart. The main thing is to make sure that the owner and group are set to asterisk, and the owner has read/write/execute permissions.

    Step 5. Now use your text editor again - this time you want to open /etc/asterisk/extensions_custom.conf and add the following to the existing file:

    [custom-check-everycall-us]
    exten => _X!,1,NoOp(Checking Everycall.us for bad caller)
    exten => _X!,n,AGI(check-everycall-us.agi|${CALLERID(number)})
    exten => _X!,n,NoOp(Everycall.us returned score of ${badcallscore})
    exten => _X!,n,GotoIf($[0${badcallscore} < 10]?notbadcaller)
    exten => _X!,n,NoOp(Bad caller score above threshold - changing DID to 9999999999)
    exten => _X!,n,Goto(from-trunk,9999999999,1)
    exten => _X!,n(notbadcaller),NoOp(Bad caller score below threshold - continuing)
    exten => _X!,n,Goto(from-trunk,${EXTEN},1)
    exten => h,1,Macro(hangupcall,)
    

    Save your changes. Note that the number 10 on the 4th line is the score that determines a "bad" call - if a lot of bad calls are slipping through you can try making this lower. On the other hand, if good calls are getting caught, you may want to make it higher.

    Step 6: In the FreePBX "Inbound Routes", create a new Inbound Route that will be used to dispose of the "bad" calls. Make the Description something like Blocked per Everycall.us, and set the DID Number to 9999999999 (leave the Caller ID Number blank). Then select whatever destination you like - I personally like the option "Terminate call: Play Ringtones to the caller until they hangup", but you can do whatever you like, including creating a special IVR just for those folks, if that's your bent. By using an inbound route in this manner, you have additional flexibility for disposing of the call, and you are terminating the call inside the FreePBX dialplan, which may have some implications for call detail recording, etc.

    Step 7: In every trunk you want to monitor, you'll need to go into the trunk setup and change the statement context=from-trunk to context=custom-check-everycall-us - the good thing about this method is you can choose to check incoming calls on some trunks but not others. The bad part is you have to change the context= statement in every trunk that you want to check. NOTE: If the context statement is going to someplace other than from-trunk already, you'll need to find the custom dialplan referenced by that statement, and modify that to go to custom-check-everycall-us after it has done its work (instead of going to from-trunk). If that custom dialplan changes the DID of the call then make sure that the EXTEN variable contains the new DID before passing the call to custom-check-everycall-us.

    Don't forget to apply your configuration changes when you are all finished!

    Please note: The above information should be considered preliminary. The code shown above should still be considered experimental code. Use it at your own risk, and please let us know how it works for you, particularly if you actually receive any calls that score high enough to get "the treatment." Also please watch for any "false positives" - keep in mind that I am NOT a programmer, so don't rely on any of the above code without testing it for yourself!


    How to bypass Grand Central's requirement to press 1 to accept the call

    How to bypass Grand Central's requirement to press 1 to accept the call

    Google's GrandCentral service offers incoming DID's in a number of places that may not be immediately available from other providers, and their service is free. There are, however, two downsides to using GrandCentral:

    • At the time of this writing, you need an invitation from another GrandCentral user. This is solely a requirement imposed by Google (prior to Google's purchase of GrandCentral, anyone could sign up for a GrandCentral account, without the necessity of an invite). Anyway, I'll spare you my rant about Google, suffice it to say I think they have forgotten their corporate motto.
    • GrandCentral lets you route the call to more than one destination, so when the call is answered they ask you to press 1, presumably to confirm that you want to accept the call at that number, and that you're not an answering machine or voicemail box. While this is a great feature in some scenarios, it's not so great if we want the call to come into FreePBX and go to an IVR, or if perhaps we want the call to go to a FreePBX voicemail box.
    Fortunately, there is a workaround suggested by user "cbrain" in this thread on BroadbandReports.com. This works best if you can dedicate one DID (even if it's a local PSTN line) to calls received from GrandCentral. Or, because GrandCentral lets you make a Gizmo Project number a destination, you can get a free Gizmo Project account and then use your Gizmo Project DID as your incoming route for GrandCentral calls (the following instructions from "cbrain" assume the latter):

    I just gave it a try and it works.

    First go to "config edit" and add the following to -extensions_custom.conf-

    [custom-gc-did]
    exten => 1,1,answer
    exten => 1,n,wait(2)
    exten => 1,n,SendDTMF(1)
    exten => 1,n,Goto(ext-group,2,1) ;use a setup ring group or extension

    Then go to FreePBX - setup - Inbound Routes - and set up or edit your Gizmo Project DID. In the - set destination - section set - Custom App: - to - custom-gc-did,1,1 -. [NOTE: In a comment below, Cliff said: In recent FreePBX versions you can no longer directly enter a custom app into Inbound Routes. After you set up "extensions_custom.conf" go to the "Tools" tab - "Custom Destinations" and add "custom-gc-did,1,1" to "Custom Destination" - give it a name FreePBX will use, save, reload, and you can then choose it from "Inbound Routes."]

    Then setup your ring group or extension.

    If you need to have access to incoming from GrandCentral from your cell or other, change your inbound route from FreePBX directly to the same ring group or extension and toggle between press 1 and direct ring.

    (End of quote from posted message)

    In case it's not obvious, the key to the above instructions is that you have Asterisk answer the line, wait two seconds, and then send a DTMF "1". Then you send the call to wherever you really want it to go, whether that is a specific IVR menu, a particular extension or ring group, a voicemail box, or wherever. But, you only want to do this for calls coming from GrandCentral (e.g. over your Gizmo Project DID), so that your regular callers don't get blasted with a DTMF "1" every time they call you.

    Note that once you have sent the "1", the call will have been considered as answered by the caller's telephone company. If you transfer to an extension that gives a ringing tone, and the caller abandons the call, they may wonder why they have been charged for an "uncompleted" call (from their perspective). So, you may want to play a short announcement so that the caller knows that the call has been answered and is being transferred. Obviously, this is not a concern if you send the call directly to an IVR menu, or a voicemail box.

    Thanks to "cbrain" for the instructions. By the way, I can't comment on how well the above instructions work, because nobody's ever sent me a GrandCentral invite!

    How to change incoming CallerID

    How to change incoming CallerID

    (New material added March, 2009:) I should point out at the beginning that there is now an unsupported third-party module for FreePBX called Set CallerID, which "adds the ability to change the CallerID within a call flow." So, for example, you could create a Caller ID instance using this module, then make the destination of an Inbound Route that Caller ID instance. This basically accomplishes the same thing that is described below, but keeps you from having to mess around with adding contexts to extension_custom.conf.

    Almost all of the examples below could be used with the Set CallerID module by doing the following: Set the CallerID Name to ${CALLERID(name)} so it will remain unchanged. Then set the CallerID Number to the target of the Set statement (the part after the = sign, but not including the close parenthesis). So, where in the first example below you see the line:

    exten => _X!,1,Set(CALLERID(num)=0${CALLERID(num)})

    If using the Set CallerID module you would take just the part in bold - 0${CALLERID(num)} - and use that as the CallerID Number.

    If for some reason you don't wish to install the module, or it doesn't meet your requirements, the method described below still works.

    (Original page starts here:) The following is an example of how to add a digit to incoming CallerID on a particular trunk - some people seem to want this because their phones will not do a proper callback if the leading digit(s) are missing.

    Step 1: Go into the trunk for that provider (if not a Zap trunk-see below for Zap) and under Incoming Settings | USER details you will see a "context=" line - usually this will be "context=from-trunk". Note what is there now (if it is something other than "from-trunk") and change it to "from-trunk-custom", or add "-custom" to the end of whatever is there now

    Step 2: Edit etc/asterisk/extensions_custom.conf (you can use nano, Midnight Commander's built-in editor, or other plain-text editor of your choice) and add the following at the bottom of the file:

    [from-trunk-custom]
    exten => _X!,1,Set(CALLERID(num)=0${CALLERID(num)})
    exten => _X!,n,Goto(from-trunk,${EXTEN},1)
    


    Again, change the "from-trunk" in the first and third lines if you originally had something else in your trunk context. In the SECOND line, the 0 (following the =) is the digit to be added - if you want to add something other than 0, you'll have to change that.

    Step 3: Reload or restart Asterisk

    From CLI: reload (OR, if you want to restart Asterisk for some reason, you can use restart now, or restart when convenient if you don't want to drop calls. You could also do amportal restart from the Linux command line).

    If you need to make this change for your Zap trunk, the procedure is slightly different:

    Step 1: Edit etc/asterisk/zapata.conf (you can use nano, Midnight Commander's built-in editor, or other plain-text editor of your choice). You will see a "context=" line - usually this will be "context=from-zaptel". Note what is there now (if it is something other than "from-zaptel") and change it to "from-zaptel-custom", or add "-custom" to the end of whatever is there now.

    Now continue with Steps 2 and 3 above, substituting "from-zaptel" (or whatever you found in the "context=" line in zapata.conf) in place of "from-trunk" in lines 1 and 3 of Step 2 (i.e., just replace "trunk" with "zaptel" in those lines).

    Note that the variable ${CALLERID(num)} is only available in Asterisk 1.2 and later. If you need to manipulate it in other ways, see the section on String Handling Functions on the Asterisk variables page - for example, to always strip the first digit or character off of incoming Caller ID, you could probably use ${CALLERID(num):1} (adding the :1 to return all characters AFTER the character in the first position - this could also be used to strip a leading "+" if a provider adds that).

    Here's another example, in which digits are both removed and added - in the FreePBX forum, colinjack wrote, "My SIP provider CallerID comes in the format +44123456789 but my database uses 0123456789 - so I needed to remove the '+44' and add a '0' to the callerid to allow it to query the user database." And he added this to extensions_custom.conf to accomplish this:

    [from-trunk-custom]
    exten => _X!,1,Set(CALLERID(num)=0${CALLERID(num):3:12})
    exten => _X!,n,Goto(from-trunk,${EXTEN},1)
    


    Then he changed his sip trunk context statement to context=from-trunk-custom

    One final example. In this case the provider was sending the CallerID number prefixed with a "+" (plus sign), but there was no assurance that this would always be true. In order to facilitate using the callback feature on certain phones, it was desired to strip the "+", but only for calls that appeared to be coming from points in the "North American Numbering Plan Area" (country code 1). So this code tests for "+1" at the start of the CallerID and if it is present, it strips only the first character (the "+"):

    [from-trunk-custom]
    exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != "+1"]?noplusatstart)
    exten => _X!,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to ${CALLERID(num):1})
    exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1})
    exten => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)
    


    Once again the sip trunk context statement should be changed to context=from-trunk-custom

    Just in case anyone wonders, you can use the same custom context (in extensions_custom.conf) for multiple trunks, as long as they originally had the same "context=" destination. Or, if you need to make different changes to the Caller ID from different trunks, then just make multiple custom contexts in extensions-custom.conf, and change the names slightly (e.g. you could call one from-trunk-add-0-custom and another from-trunk-strip-2-custom, or whatever - just make sure to use the same context name in the trunk "context=" line and in the header of your custom context).

    Finally, for those using naftali5's Dialplan Injection module (which may not install or work correctly with the most recent versions of FreePBX), you can place these code fragments in a Dialplan Injection instead of extensions_custom.conf. Simply enter the lines beginning with the "Set" or "Goto" command, like this:

    Set(CALLERID(num)=0${CALLERID(num)})
    Goto(from-trunk,${EXTEN},1)
    


    Then note the number of the dialplan injection (it will be printed in angle brackets next to the injection name in the list of injections), and in your trunk use context=injection-number where number is the number of the injection. For example, let's say you named the injection as "Change Caller ID", and after you created it you saw this in the right hand column: Change Caller ID <15> - in your trunk, you'd then use context=injection-15


    Added comment by original author: There was a note that briefly appeared on this page that was mostly incorrect (because the person who wrote the note apparently missed the fact that the added from-trunk-custom context must be created by the user in etc/asterisk/extensions_custom.conf, which is NOT overwritten by FreePBX updates). The only part of that note that might have been valid was the idea that the line exten => _X!,n,Goto(from-trunk,${EXTEN},1) could perhaps be replaced by include => from-trunk. I make no comment on the validity of that because I have not tested it; however I did test the method I posted above and it did work. Also, I cannot offer an explanation for why some users seem to be having problems using this method with Trixbox; since Trixbox has been forked from FreePBX I suppose it may be possible that they are doing something different that causes the above not to work.


    How to create a system-wide speed dial number

    The correct way to create a system-wide speed dial number in FreePBX is now a two-step process:

    First, create a Misc Destination, then put the number you want to call (with # suffix if it's an outside number) in the dial: text field, e.g. 18005551212#

    Then create a Misc Application, put the extension or speed dial number you want to use in the Feature Code: text field, and make the Destination the Misc Destination that you just created.

    So you call the number you specified in the Misc. Application and it routes to the destination you specified in the Misc. Destination. This keeps everything within the FreePBX interface. Also, you can specify the Misc. Destination from anywhere in FreePBX that you can select a destination, such as from an IVR menu (if that is ALL you want then you don't even need to create the Misc. Application).

    Here's another approach that probably adds more overhead to the call process, but may be more desirable in certain circumstances: Create a Ring Group with only one number in the group, that being the number you want to call (with # suffix if it's an outside number); then the Ring Group number becomes your speed dial number. While that method probably uses slightly more processing time on each call, it does give you the ability to use the options associated with Ring Groups (such as specifying the amount of time to allow the call to ring, or playing Music on Hold instead of a ringing signal to the caller). Perhaps more significantly, if you set the Ring Time to a shorter time than the called number's voicemail timeout, you can have unanswered calls go to your FreePBX voicemail (or to another FreePBX extension or some other destination of your choice) rather than the called phone's voicemail, if that's what you'd prefer.


    How to enable changing an IVR menu (or other System Recording) from an extension or remote location

    How to enable changing an IVR menu (or other System Recording) from an extension or remote location

    The normal method for creating an IVR menu recording, or other custom system recording is to use the System Recordings feature in FreePBX. But starting in FreePBX 2.5, you also have the ability to allow any system recording that you have created (that is, one NOT created using built-in recordings) to be changed by dialing a feature code. Once you have created or uploaded a System Recording, you should be able to find it listed in the right-hand menu on the System Recordings page. Click on that link, and it will take you to the "Edit Recording" page for that particular recording. On that page, you should see a "Link to Feature Code" checkbox. Checking that box will allow the system recording to be changed from an extension by dialing the Optional Feature Code shown to the right of the checkbox. If you don't like the Optional Feature Code assigned by default, you can change it using the Feature Code Admin feature.

    If you check the box, you should also consider setting a Feature Code Password so that no one can change the recording without knowing the password.

    That is all you need to do allow a system recording to be changed from any of your extensions. But if you want to be able to call in from outside to change the recording, simply create a new Misc Destination and select the feature code from the dropdown (it will begin with "Edit Recording:"). You can then use that Misc Destination as a "hidden" option (one that's not announced to callers) from your main IVR menu (or another IVR menu), or you could even make it the destination for one of your DID's.

    Note that whenever you change a system recording in this manner, the previous recording is irretrievably lost (other than by retrieving it from a system backup - you do have backups, don't you)? So if you have a professionally produced IVR recording, but want to give someone the ability to remotely change it in an emergency, make sure you back up the recording somewhere else on the system. The original can be found in the /var/lib/asterisk/sounds/custom directory, and you can either make a backup copy to another directory, or you can make a copy with a different filename in the same directory. You will then either have to restore the original recording manually once the emergency has passed (by copying the backup copy over the changed recording), or you could set up a cron job to copy the save original recording over the (possibly) changed recording at a specific time every day, or if you are creative you could even use a bit of dialplan code in /etc/asterisk/extensions_custom.conf to restore the original recording, then use the Custom Destinations module (under the "Tools" tab) to assign it a feature code if desired.

    Credit to user "SkykingOH" in this thread for pointing out the "Link to Feature Code" functionality in FreePBX 2.5 and above:
    http://www.freepbx.org/forum/freepbx/users/handling-of-the-ivr-voice-rec...


    How to enable distinctive ringing (Alert Info) for calls from particular extensions or all local extensions

    How to enable distinctive ringing (Alert Info) for calls from particular extensions or all local extensions

    Every so often, someone asks whether it's possible to make calls from local extensions produce a distinctive ring that is different than the ring produced by calls coming in from outside the FreePBX switch. A variation on that request is that someone will ask how calls from certain "important persons" (such as the boss) can be made to ring differently than "normal" calls.

    The only way to satisfy the first request from within FreePBX was described by mickecarlsson in this FreePBX forum thread:

    Quote:
    We have done this by setting all inbound DID's with alert info and have our endpoints configured so that it will trigger the second ring signal if alert info is received. Internal calls will ring whatever the signal is set to on the endpoint as default.

    In other words, it's sort of a negative option - you set all external calls to produce a distinctive ring (on the Inbound Route pages) and then if the phone doesn't produce the distinctive ring, you know it's an internal call. While that may be perfectly adequate for many users, perhaps you would like the distinctive ring to be produced on internal calls, not the ones coming in from outside. Or, maybe you'd like the distinctive ring to be produced only if the call originates at a certain extension, or group of extensions.

    It is not possible to do this (yet) from within a FreePBX configuration page, not even by adding a module, although any aspiring module writer is more than welcome to take this on as a project. But it may be possible to achieve the desired result, provided four conditions are met:

    • The phones or endpoints must support receiving a SIP Alert-Info header, and acting on that header to produce a distinctive ring.

    • You must determine the strings that the phones or endpoints expect to see for the desired distinctive ring pattern. A typical Alert-Info string is "Bellcore-dr3", which produces a double ring (like a typical British ring) on some devices (other devices may omit the "d", using "Bellcore-r3" instead). Note that these strings may be configurable on some phones or devices (e.g. Linksys/Sipura models - you must do an Admin login, click on advanced settings, go to the Regional tab, then look under the Distinctive Ring/CWT Pattern Names section to see or change the expected "Alert-Info" strings).

    • You must accept that whenever you upgrade Asterisk, you need to use a text editor to look in the file /etc/asterisk/extensions.conf and make sure that the [from-internal] context hasn't changed from the previous version - if it has, you will need to copy the entire [from-internal] context to the [from-internal-original] context in the file /etc/asterisk/extensions_override_freepbx.conf as described below.

    • You must be willing to get "under the hood" (or "under the bonnet" as our British friends might say) and do a little bit of manual dial plan construction, as explained below.

    If you can meet those four conditions, then here is how it's done. Open the file /etc/asterisk/extensions_override_freepbx.conf (NOT extensions.conf!!!) and enter the following code therein (you will need to change certain lines, but you can cut and paste the sample code below to get you started):

    [from-internal]
    include => set-alert-if-local
    
    [from-internal-original]
    include => from-internal-xfer
    include => bad-number
    
    [set-alert-if-local]
    exten => 234,1,GotoIf($["${CALLERID(num)}" > "999"]?notfromlocal)
    exten => 234,n,GotoIf($["${CALLERID(num)}" < "100"]?notfromlocal)
    exten => 234,n,Set(__ALERT_INFO=Bellcore-r3)
    exten => 234,n(notfromlocal),Goto(from-internal-original,${EXTEN},1)
    ;The following three lines must not be changed!
    exten => _.,1,Goto(from-internal-original,${EXTEN},1)
    exten => s,1,Goto(from-internal-original,s,1)
    exten => h,1,Macro(hangupcall)
    

    The lines that will need to be modified are the four lines following the [set-alert-if-local] context tag, which can be duplicated as often as necessary for the number of extensions you have and the various ring patterns you may wish to produce. You need to change them as follows:

    All four lines must begin with either exten => extension, or exten => _pattern, — this defines which extension or group of extensions the rule is to apply to. Don't forget the leading underscore if using a pattern. So, where it says exten => 234, you might change that to exten => 1150 to produce distinctive ringing on extension 1150, or you may use exten => _5XX (note the underscore character that must be used at the start of a pattern) to apply the same distinctive ringing pattern to extensions 500-599.

    The first two lines define the upper and lower boundaries of what is considered a local extension - in the example shown, anything above 999 or below 100 would not be considered local. Therefore, you can set the distinctive ring to occur only if the call is from a particular group of extensions (a subset of your local extensions) or even compress this down to a single line and do an exact match on a particular calling extension (e.g. the boss!). You can use any of the following comparison operators in these lines: = != < > <= >=

    The third line sets the Alert Info string, and must be the correct string for the endpoint. You could have multiple rules to have different distinctive rings for different individual calling extensions, or groups of extensions. If you do stack rules, be careful that the first (and only the first) statement for each extension or extension pattern contains the line number 1 (e.g. exten => 234,1, ...)

    The fourth line after the [set-alert-if-local] context tag should be included verbatim, except of course that if you have multiple rule sets then each one must have a unique label here (and that label must also be changed to match in the first two lines after the [set-alert-if-local] tag). So, if I had multiple rules here, instead of using notfromlocal I might use notfromlocal234 (to indicate that this was the label associated with extension 234), so I could keep my labels straight when reading down the list (also that would be easier to auto-generate if anyone ever writes a module to do this).

    All the other lines should probably be left unchanged, although I have a feeling that someone will say I should not use the _. pattern in the catch-all line that follows the comment. I was basically following the lead of whoever wrote the [from-sip-external] context in extensions.conf (see the comment in that section of code).

    When I wrote this I was using FreePBX version 2.5, so if you have upgraded to version 2.6 or later, be sure to check /etc/asterisk/extensions.conf and make sure that the [from-internal] context hasn't changed - that's what I copied verbatim to the [from-internal-original] context here, so if that changes in extensions.conf then it must be changed here in extensions_override_freepbx.conf as well. Any time you upgrade FreePBX, make sure that the [from-internal-original] context here matches the [from-internal] context in extensions.conf exactly!


    How to execute a custom dial plan fragment before sending a call to a trunk (for playing an announcement, etc.)

    How to execute a custom dial plan fragment before sending a call to a trunk (for playing an announcement, etc.)

    In a FreePBX forum post, Alex Edwards wanted to accomplish the following:

    "I'd like to warn my FreePBX users when they're dialling an expensive international fixed-line, or worse, international mobile. (This is from the UK).

    "I've put a long list of international codes as a route, with a route password - which is a great start.

    "However, ideally I'd like to play an explanatory message too - possibly a Misc Destination / Application / Announcement? ....."

    In other words, what he wanted to do was execute a bit of custom code (a dial plan fragment) prior to sending the call to a trunk. One way to do this is to use a CUSTOM trunk. Here's how Alex did it (slightly revised for clarity):

    First, you need to add your custom dial plan fragment to extensions_custom.conf (if you have the Dialplan Injection module installed, you could also put this code fragment there, but for the moment we'll assume you're using extensions_custom.conf). Alex added the following to the top of that file (slightly modified for clarity):

    [mobile-warn-custom]

    exten => _X.,1,Answer
    exten => _X.,n,Wait(1)
    exten => _X.,n(begin),Noop(Playing announcement Expensive-Call-Warning)
    exten => _X.,n,Playback(custom/International-Mobile-Warning,noanswer)
    exten => _X.,n,Wait(1)
    exten => _X.,n,Dial(mISDN/g:out/${EXTEN},300)

    Note that the final line gives the actual destination of the call, and will have to be tweaked for your own particular situation. Also, the Wait statements are probably optional, or could be made longer than one second if desired. The recording specified in the fourth line (International-Mobile-Warning) is a custom recording that tells the caller that the call will cost around £1 a minute, so look for a cheaper alternative! You will need to create the recording you want to use, if none of the standard Asterisk recordings will work in your situation.

    Second, create a new CUSTOM trunk. For the Custom Dial String, use the following:
    Local/$OUTNUM$@mobile-warn-custom

    If you used something other than "mobile-warn-custom" to identify your custom dial plan then be sure to use that here as well. While you are creating your CUSTOM trunk, mouse over the words "Custom Dial String" and it will show you some suggested formats that might give you an idea of how the "Dial" argument in the final line of your custom dial plan should read (in case you are having trouble figuring that out).

    Finally, create your route, and make sure it has higher priority than all the other routes that might otherwise handle calls to the same numbers. Don't forget to click the orange bar when finished.

    An alternate method was suggested by user stonet. In /etc/asterisk/extensions.conf there is a context called macro-dialout-trunk-predial-hook which, according to comments in extensions.conf, is "intentially left blank so it may be safely overwritten for any custom requirements that an installation may have" and that any such "customizations to this dialplan should be made in extensions_custom.conf." What that means is you can create a [macro-dialout-trunk-predial-hook] context in /etc/asterisk/extensions_custom.conf and it will override the (intentionally blank) context in extensions.conf. The macro is called whenever a call goes out over any trunk, therefore if you can determine which trunk has been called you can execute your custome dial plan fragment.

    That's the approach that stonet took. He wanted to play the message when calls went out on any of three trunks, so rather than giving the trunks names he gave them numbers. The SIP trunks on which he wanted to play the message he named 7000, 7001, 7002 and 7003, and then he used this code, which should be placed in /etc/asterisk/extensions_custom.conf:

    [macro-dialout-trunk-predial-hook]
    exten => s,1,NoOp(Trunk ${OUT_${DIAL_TRUNK}} selected)
    exten => s,n,Gotoif($["${OUT_${DIAL_TRUNK}:0:7}" != "SIP/700"]?skip)
    exten => s,n,NoOp(Playing Progress Announcement)
    exten => s,n,Playback(pls-hold-while-try,noanswer)
    exten => s,n(skip),MacroExit()
    

    Note that the full trunk name is printed on the CLI by the first line, so you can see what needs to be matched in the Gotoif statement. It usually consists of the technology type, a forward slash, and the trunk name, although that can vary (especially in the case of a Custom trunk). When this method is used, you don't need to create any custom trunks, and you have more flexibility in the variables you can use for conditional jumps, but you are responsible for making sure that you correctly construct your conditional Gotos so they do what you need to do. This also assumes that the [macro-dialout-trunk-predial-hook] context will not be used by any other part of FreePBX. If you use this method, make sure that the last statement in the macro is MacroExit(), and it would probably be a good idea to read some documentation on Asterisk macros before you begin.

    Keep in mind that the Gotoif statement can contain multiple conditions. For example, let's say that the two SIP trunks that we wanted to play an announcement on were named "voipcompany" and "foobar" - the Gotoif line could then look like this:

    exten => s,n,GotoIf($[$["${OUT_${DIAL_TRUNK}" != "SIP/voipcompany"] & $["${OUT_${DIAL_TRUNK}}" != "SIP/foobar"]]?skip)

    You can the use & (and), | (or), or ! (logical unary complement) characters. The first two are placed between expressions, while the ! is placed in front of an expression (with NO space between the ! and the expression) to give the opposite result of the expression (an expression that evaluates to true becomes false, and vise-versa). Usually it's clearer to just use != in an expression, however. See the page on Asterisk Expressions for more information.

    You may want to check the forum thread to see if any additional comments have been posted that may clarify these procedures. The thing we want to illustrate here is that when you need to add a custom dial plan fragment prior to sending a call to an actual trunk, one way to do it is to use a CUSTOM trunk, send that to your custom dial plan, and then make the last line of your custom dial plan send the call to an actual trunk or other destination. The other way to do it is to use the [macro-dialout-trunk-predial-hook] macro call that's already built into FreePBX.

    For those who may be trying to duplicate what Alex did, here is the list of numbers that Alex put into the route definition (to play a warning for high cost mobile calls). Note that this may or may not include all caller-pays mobile prefixes, and that the '9|xxxx.' variants at the bottom of the list are only required if you use 9 for an outside line:

    00124235.
    00124245.
    00124255.
    0012687.
    00147341.
    0017672.
    00201.
    002126.
    002162.
    002169.
    0021891.
    002207.
    002209.
    002215.
    002216.
    002226.
    002233.
    002234.
    002235.
    002236.
    002239.
    002246.
    002250.
    002256.
    002267.
    002289.
    002299.
    002307.
    002308.
    002309.
    0023223.
    0023230.
    0023233.
    002327.
    0023328.
    0023480.
    0023490.
    002389.
    0023990.
    002402.
    002424.
    002425.
    002426.
    0024322.
    0024378.
    0024381.
    0024384.
    0024385.
    0024386.
    0024388.
    0024389.
    0024390.
    0024394.
    0024395.
    0024396.
    0024397.
    0024398.
    0024399.
    002456.
    002457.
    002485.
    002487.
    002499.
    0025008.
    0025191.
    002538.
    002547.
    0025574.
    002567.
    002577.
    002588.
    002609.
    002613.
    0026311.
    0026323.
    0026391.
    002658.
    002659.
    0026658.
    002666.
    002677.
    0026860.
    002693.
    00277.
    00278.
    002917.
    0030693.
    0030694.
    0030697.
    0030699.
    00316.
    003247.
    003248.
    003249.
    00336.
    00346.
    0035058.
    003519.
    00352621.
    00352628.
    00352661.
    00352668.
    00352691.
    00352698.
    003538.
    003546.
    003548.
    003556.
    0035679.
    0035699.
    0035796.
    0035797.
    0035799.
    003584.
    0035850.
    0035948.
    0035987.
    0035988.
    0035989.
    003620.
    003630.
    003670.
    003706.
    003725.
    0037365.
    0037368.
    0037369.
    0037376.
    0037378.
    0037379.
    003749.
    0037525.
    0037529.
    0037533.
    0037544.
    003774.
    003776.
    0037866.
    0038039.
    0038050.
    0038063.
    0038066.
    0038067.
    0038068.
    0038097.
    00381377.
    003816.
    003826.
    003859.
    0038761.
    0038762.
    0038763.
    0038765.
    0038970.
    0038971.
    0038975.
    0038976.
    0038977.
    0038978.
    0039328.
    0039329.
    0039333.
    0039338.
    0039339.
    0039340.
    0039347.
    0039348.
    0039349.
    0039393.
    00407.
    004174.
    004176.
    004177.
    004178.
    004179.
    0042060.
    0042072.
    0042073.
    0042077.
    004219.
    004237.
    0043650.
    0043660.
    0043664.
    0043676.
    0043680.
    0043681.
    0043688.
    0043699.
    004475.
    004477.
    004478.
    004479.
    004530.
    004540.
    00467.
    00474.
    00479.
    004850.
    004851.
    004860.
    004866.
    004869.
    004872.
    004878.
    004879.
    004888.
    004915.
    004916.
    004917.
    0049700.
    005016.
    005024.
    005025.
    005037.
    005043.
    005048.
    005049.
    005058.
    005063.
    005074.
    005075.
    005076.
    005077.
    00519.
    00521.
    00535.
    005415.
    00557.
    00558.
    00559.
    005698.
    005699.
    005731.
    00584.
    005917.
    005926.
    005938.
    005939.
    005959.
    005978.
    0059894.
    0059896.
    0059898.
    0059899.
    00601.
    00614.
    00628.
    00639.
    006420.
    006421.
    006424.
    006425.
    006427.
    006428.
    006429.
    00658.
    00659.
    00661.
    00669.
    006707.
    006738.
    00674555.
    0067568.
    0067569.
    006784.
    006785.
    006799.
    0068577.
    007300.
    007333.
    00770.
    007777.
    0079.
    008170.
    008180.
    008190.
    008210.
    008211.
    008216.
    008217.
    008218.
    008219.
    00849.
    008523.
    008526.
    008528.
    008529.
    008536.
    008559.
    0085620.
    008613.
    008615.
    0088016.
    0088017.
    00880181.
    0088019.
    008869.
    00905.
    009192.
    009193.
    009194.
    009197.
    009198.
    009199.
    009230.
    009231.
    009232.
    009233.
    009234.
    009235.
    009236.
    009375.
    00947.
    00959.
    009607.
    009609.
    009613.
    0096170.
    0096171.
    009627.
    009639.
    009656.
    009657.
    009659.
    0096650.
    0096654.
    0096655.
    0096656.
    009677.
    00968968.
    0097059.
    0097150.
    0097155.
    009725.
    009733.
    009745.
    009746.
    0097517.
    009769.
    0097798.
    00989.
    009929.
    009945.
    009957.
    009959.
    009965.
    009989.
    9|00124235.
    9|00124245.
    9|00124255.
    9|0012687.
    9|00147341.
    9|0017672.
    9|00201.
    9|002126.
    9|002162.
    9|002169.
    9|0021891.
    9|002207.
    9|002209.
    9|002215.
    9|002216.
    9|002226.
    9|002233.
    9|002234.
    9|002235.
    9|002236.
    9|002239.
    9|002246.
    9|002250.
    9|002256.
    9|002267.
    9|002289.
    9|002299.
    9|002307.
    9|002308.
    9|002309.
    9|0023223.
    9|0023230.
    9|0023233.
    9|002327.
    9|0023328.
    9|0023480.
    9|0023490.
    9|002389.
    9|0023990.
    9|002402.
    9|002424.
    9|002425.
    9|002426.
    9|0024322.
    9|0024378.
    9|0024381.
    9|0024384.
    9|0024385.
    9|0024386.
    9|0024388.
    9|0024389.
    9|0024390.
    9|0024394.
    9|0024395.
    9|0024396.
    9|0024397.
    9|0024398.
    9|0024399.
    9|002456.
    9|002457.
    9|002485.
    9|002487.
    9|002499.
    9|0025008.
    9|0025191.
    9|002538.
    9|002547.
    9|0025574.
    9|002567.
    9|002577.
    9|002588.
    9|002609.
    9|002613.
    9|0026311.
    9|0026323.
    9|0026391.
    9|002658.
    9|002659.
    9|0026658.
    9|002666.
    9|002677.
    9|0026860.
    9|002693.
    9|00277.
    9|00278.
    9|002917.
    9|0030693.
    9|0030694.
    9|0030697.
    9|0030699.
    9|00316.
    9|003247.
    9|003248.
    9|003249.
    9|00336.
    9|00346.
    9|0035058.
    9|003519.
    9|00352621.
    9|00352628.
    9|00352661.
    9|00352668.
    9|00352691.
    9|00352698.
    9|003538.
    9|003546.
    9|003548.
    9|003556.
    9|0035679.
    9|0035699.
    9|0035796.
    9|0035797.
    9|0035799.
    9|003584.
    9|0035850.
    9|0035948.
    9|0035987.
    9|0035988.
    9|0035989.
    9|003620.
    9|003630.
    9|003670.
    9|003706.
    9|003725.
    9|0037365.
    9|0037368.
    9|0037369.
    9|0037376.
    9|0037378.
    9|0037379.
    9|003749.
    9|0037525.
    9|0037529.
    9|0037533.
    9|0037544.
    9|003774.
    9|003776.
    9|0037866.
    9|0038039.
    9|0038050.
    9|0038063.
    9|0038066.
    9|0038067.
    9|0038068.
    9|0038097.
    9|00381377.
    9|003816.
    9|003826.
    9|003859.
    9|0038761.
    9|0038762.
    9|0038763.
    9|0038765.
    9|0038970.
    9|0038971.
    9|0038975.
    9|0038976.
    9|0038977.
    9|0038978.
    9|0039328.
    9|0039329.
    9|0039333.
    9|0039338.
    9|0039339.
    9|0039340.
    9|0039347.
    9|0039348.
    9|0039349.
    9|0039393.
    9|00407.
    9|004174.
    9|004176.
    9|004177.
    9|004178.
    9|004179.
    9|0042060.
    9|0042072.
    9|0042073.
    9|0042077.
    9|004219.
    9|004237.
    9|0043650.
    9|0043660.
    9|0043664.
    9|0043676.
    9|0043680.
    9|0043681.
    9|0043688.
    9|0043699.
    9|004475.
    9|004477.
    9|004478.
    9|004479.
    9|004530.
    9|004540.
    9|00467.
    9|00474.
    9|00479.
    9|004850.
    9|004851.
    9|004860.
    9|004866.
    9|004869.
    9|004872.
    9|004878.
    9|004879.
    9|004888.
    9|004915.
    9|004916.
    9|004917.
    9|0049700.
    9|005016.
    9|005024.
    9|005025.
    9|005037.
    9|005043.
    9|005048.
    9|005049.
    9|005058.
    9|005063.
    9|005074.
    9|005075.
    9|005076.
    9|005077.
    9|00519.
    9|00521.
    9|00535.
    9|005415.
    9|00557.
    9|00558.
    9|00559.
    9|005698.
    9|005699.
    9|005731.
    9|00584.
    9|005917.
    9|005926.
    9|005938.
    9|005939.
    9|005959.
    9|005978.
    9|0059894.
    9|0059896.
    9|0059898.
    9|0059899.
    9|00601.
    9|00614.
    9|00628.
    9|00639.
    9|006420.
    9|006421.
    9|006424.
    9|006425.
    9|006427.
    9|006428.
    9|006429.
    9|00658.
    9|00659.
    9|00661.
    9|00669.
    9|006707.
    9|006738.
    9|00674555.
    9|0067568.
    9|0067569.
    9|006784.
    9|006785.
    9|006799.
    9|0068577.
    9|007300.
    9|007333.
    9|00770.
    9|007777.
    9|0079.
    9|008170.
    9|008180.
    9|008190.
    9|008210.
    9|008211.
    9|008216.
    9|008217.
    9|008218.
    9|008219.
    9|00849.
    9|008523.
    9|008526.
    9|008528.
    9|008529.
    9|008536.
    9|008559.
    9|0085620.
    9|008613.
    9|008615.
    9|0088016.
    9|0088017.
    9|00880181.
    9|0088019.
    9|008869.
    9|00905.
    9|009192.
    9|009193.
    9|009194.
    9|009197.
    9|009198.
    9|009199.
    9|009230.
    9|009231.
    9|009232.
    9|009233.
    9|009234.
    9|009235.
    9|009236.
    9|009375.
    9|00947.
    9|00959.
    9|009607.
    9|009609.
    9|009613.
    9|0096170.
    9|0096171.
    9|009627.
    9|009639.
    9|009656.
    9|009657.
    9|009659.
    9|0096650.
    9|0096654.
    9|0096655.
    9|0096656.
    9|009677.
    9|00968968.
    9|0097059.
    9|0097150.
    9|0097155.
    9|009725.
    9|009733.
    9|009745.
    9|009746.
    9|0097517.
    9|009769.
    9|0097798.
    9|00989.
    9|009929.
    9|009945.
    9|009957.
    9|009959.
    9|009965.
    9|009989.

    How to get the DID of a SIP trunk

    Duplicated Page

    This was an inadvertently duplicated page, left in place in case you got here from a search engine or followed a menu link on this site. Please follow this link to reach the page you want.


    How to get the DID of a SIP trunk when the provider doesn't send it (and why some incoming SIP calls fail)

    How to get the DID of a SIP trunk when the provider doesn't send it (and why some incoming SIP calls fail)

    The symptom: On a SIP trunk, you can't get an inbound route to work - it just doesn't seem to recognize the number. You might be able to get the call to come in on your any DID/any CID route, or maybe the call doesn't get answered at all. When you type sip debug from the CLI, you can see (when you scroll back to the point where the call came in) that a sip INVITE packet arrived, and perhaps it contained the DID number in the sip To: header (in the form To: <sip:NUMBER@IP ADDRESS>), but you also see that the FROM_DID was set to s. In other words, you see a line that looks like this:

      -- Executing Set("SIP/9995552368-09876543", "FROM_DID=s") in new stack
    

    Before you attempt anything else, you may want to try this suggestion by Dan Swartz: Check the registration string (in the trunk settings for the provider), and if it's not already there, try putting the DID at the end of the registration string, prefixed by a '/'. It may (or may not) require a leading '1' too. e.g. '/18005551212' (or your country code if you are not in the U.S./Canada, etc.). So, your registration string would take this format:

    accountid:password@your.provider/yourDIDnumber
    

    Remember to try your DID both with and without the country code prefix. If this doesn't work, it's time to try a workaround (however, you may want to read the addendum at the bottom of this article first!). Perhaps you can see the DID number in the sip INVITE packet's To: header, but the CLI reveals that Asterisk isn't picking it up, and therefore it goes to your default inbound route.

    (Oh, and for anyone who's still trying to figure out how to turn off sip debugging, the CLI command is sip no debug)

    Fortunately this isn't a hard thing to work around, as long as the DID number really is in the sip To: header.

    NOTE: In the following examples, we now use the s extension rather than _. - this is considered better practice (and safer) but the disadvantage is that the context will fail if the provider is sending any type of DID, even if it's incorrect or incomplete. If the code doesn't seem to work, try replacing the s extension with _X! (the extension is to the right of the => and space characters).

    First, create a context in extensions_custom.conf that looks like this:

    [custom-get-did-from-sip]
    exten => s,1,Noop(Fixing DID using information from SIP TO header)
    exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
    exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
    exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
    exten => s,n,Goto(from-trunk,${pseudodid},1)
    

    Or, thanks to naftali5, you can cut the above down to one line of code that does the same thing, but is a bit less obvious to the casual reader:

    [custom-get-did-from-sip]
    exten => s,1,Goto(from-trunk,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
    

    (And speaking of naftali5, if you are using his Dialplan Injection module - which may not work with the most recent versions of FreePBX, so don't run out and get it if you aren't already using it unless you are sure it has been updated to work with the version of FreePBX that you are using - and want to put the above line in the Destination section, then you will need to use a slightly different syntax, changing the commas to bar characters, so it looks like this:

    * Custom App: from-trunk,${CUT(CUT(SIP_HEADER(To)|@|1)|:|2)},1
    

    The part after Custom App: is what you paste into the text box. This ONLY applies to Dialplan Injection users)

    Then, in the trunk associated with the provider, change the trunk context statement (which should read context=from-trunk) to:

    context=custom-get-did-from-sip
    

    (Or for Dialplan Injection users, just use

    context=injection-n
    

    but replace n with the actual injection number, which will appear next to the injection name in the right-hand column menu of injections.)

    And note that with such providers, you may have to move that context statement from the USER details to the PEER details section. This is why calls from some SIP providers sometimes fail to come in at all - they effectively never "see" the User context and details, therefore they don't see the context statement there and have nowhere to go. It's also why you sometimes see instructions for sip providers that leave the User context and User details sections totally blank, but include a context statement in the peer details - in most such cases it's because the provider is treating the customer as an end user (like someone using a softphone or a VoiP adapter) rather than as a peer, and they aren't sending DID information.

    The above instructions may also solve the problem where you have two (or more) trunks from the same provider, but Asterisk always treats it as if all calls are coming in on one of the two trunks, therefore again not allowing you to set up separate inbound routes for each trunk. As long as the provider sends the number in the sip To header, the above code should set the DID properly.

    If the first part of the To: statement is something other than a DID number (a user name, for example), then you may have to add a line just before the final Goto statement. For example, let's say the provider is sending To: <sip:Fred@IP ADDRESS> and your DID number (or at least, the number you want to use to denote your inbound route) is really 5551212. You'd then use code similar to this:

    [custom-get-did-from-sip]
    exten => s,1,Noop(Fixing DID using information from SIP TO header)
    exten => s,n,Set(pseudodid=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
    exten => s,n,Set(pseudodid=${IF($["${pseudodid}"="Fred"]?5551212:${pseudodid})})
    exten => s,n,Goto(from-trunk,${pseudodid},1)
    

    Or, as long as you only have ONE trunk from that provider, you could always just cheat a little and hardcode the desired DID in a separate custom context, like this:

    [custom-stupid-provider]
    exten => s,1,Noop(Fixing DID to 5551212)
    exten => s,n,Goto(from-trunk,5551212,1)
    

    And use the name of this context in the trunk settings. I hear you asking, why not just do it this way on all trunks with this issue? Well, because if you add a second trunk from the same provider, this won't work correctly for both trunks, and if you ever change your number and then forget what you've done and just try to set your inbound route to the new number, it won't work. And besides all that, if you have more than one SIP provider that doesn't send proper DID, you'd have to create a separate custom context for each of them, instead of having one custom context that works for all of them.

    One final note for Free World Dialup users, you may find that sip calls will still not come in until you put the following statement in sip.conf:

    insecure=invite
    

    I have no idea why that works, but it seems to make a difference.

    What if the provider doesn't send the number in the sip To: header?

    There is at least one provider that actually sends a s character instead of a number in the sip To: header. What can you do with a provider like that? Well, all may not be lost. If you only have a single trunk from that provider, you can just use the "cheat" shown above, since it doesn't rely on the contents of the sip headers. If, however, you have TWO or more trunks from the same provider, you can do a sip debug from the CLI and watch as calls come in on each trunk and note whether there are any consistent differences.

    For example, if you have two lines on the same account, the provider will often assume that you are using a VoIP adapter (such as a Sipura or Linksys) and will use port 5060 for line 1, and port 5061 for line 2. That difference might show up in the headers of the sip INVITE packet, for example:

    Via: SIP/2.0/UDP 111.222.333.444:5060;branch=z9hQ4bK67sc0a8e;rport
    

    In this case, you see that there is a colon (:) before the port number and a semicolon following, and that there are actually TWO colons on the line before the port number, so maybe this would work:

    [custom-really-stupid-provider]
    exten => s,1,Noop(Fixing DID using port from SIP VIA header)
    exten => s,n,Set(pseudodid=${CUT(CUT(SIP_HEADER(Via),;,1),:,3)})
    exten => s,n,Set(pseudodid=${IF($["${pseudodid}"="5060"]?5551111:${pseudodid})})
    exten => s,n,Set(pseudodid=${IF($["${pseudodid}"="5061"]?5552222:${pseudodid})})
    exten => s,n,Goto(from-trunk,${pseudodid},1)
    

    Or, if you only have two trunks from this provider, you probably could just condense the two test lines into one, by testing for one port number and assuming the other if the conditional test fails, like this:

    exten => s,n,Set(pseudodid=${IF($["${pseudodid}"="5060"]?5551111:5552222)})
    

    Note that the code in this section is untested, it's just to give you some ideas about how to possibly handle the really oddball situation were you have two (or more) lines from the same provider, and cannot find any other way to differentiate them. And, don't automatically assume you have a bigger problem than you actually have - for example, it may well be that having different port numbers on the different trunks would allow Asterisk to distinguish them enough that the simple "cheat" method would work (you'd have to make one for each trunk, of course).

    Again, if a particular piece of code doesn't seem to work at all, try replacing
    exten => s, . . . . .
    with
    exten => _X!, . . . . .
    in all lines of the context (just in case the provider is sending some unknown number). But if that works, you should consider using whatever the provider is actually sending as the DID for your Inbound Route, which would eliminate the need for this extra code altogether.

    Addendum

    There are a few other reasons that incoming calls may fail that have nothing to do with the main topic of this How-To, but are common enough that they should be mentioned anyway. The first is that in every trunk configuration, there must be a statement that reads:
    context=from-trunk
    Some providers will tell you to set the context statement to something else - don't do it (unless you have a valid reason, such as following the instructions above). Providers are generally more familiar with Asterisk than FreePBX, and often don't realize that you can't just use any context name you like in FreePBX unless you also create that context somewhere (usually extensions_custom.conf).

    Also the placement of that context= statement can be important. If a provider is treating you as an extension (which would likely be the case if most of their customers use VoIP adapters and/or you are a "Bring Your Own Device" customer) then in most cases you will not need to have a USER context or USER details at all in your trunk, but you still need to have a context=from-trunk statement (or another context= statement if you are following instructions elsewhere on this page) and in this case it will need to be in your PEER details, not your user details. So, if incoming calls aren't working, try putting context=from-trunk in your trunk PEER details, and if that works, then totally remove the USER context and USER settings from your trunk configuration, since they aren't doing any good anyway.

    To further complicate matters, I have noted that with a couple of providers, nothing seems to work until you do the following. The symptom typically is that you have no problem connecting with other providers, and (if you have tried this) you have no problem connecting with the provider in question if you are using an external hardware device (such as an ATA), but no matter what you do you can't receive calls from the provider. I hate recommending this because I don't know exactly why it works, but it's a trick I've used for a couple years now to resolve issues with a couple of specific providers. Don't try this until you've first tried adding the DID at the end of the registration string, prefixed by a '/', as shown near the top of this page.

    Open the file /etc/asterisk/sip_general_custom.conf in any text editor and check to see if the following lines are in there:

    bindport = 5060 ; Port to bind to (SIP is 5060)
    bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
    insecure=invite
    tos=0x68
    srvlookup=no
    

    If any of the above lines are missing, add them to the file. In my experience these lines will not cause problems with other providers but they do magically get things working with a select few providers that are more used to serving customers using an ATA than through a trunk into an Asterisk box. If this gets things working you can try removing lines one at a time to find out which are actually doing the trick, or you can just leave them all in place - as I say, in my experience they don't seem to cause problems with other providers, although obviously your experience might be different.

    Yet another issue that you may encounter, especially if you are upgrading from an earlier version of FreePBX, is that if you have disallow= and allow= statements in your trunk configuration (to specify the use of particular codecs), starting with Asterisk 1.4 the disallow= statement(s) (particularly if it's disallow=all) must be placed above the allow= statements. This is one of many cases where Asterisk upgrades have broken existing functionality for no good reason whatsoever, other than that the Asterisk developers could not be bothered to ensure backward compatibility.

    One other note: There is an obscure bug in Asterisk that can cause incoming calls to fail. If Asterisk ever receives a Caller ID NAME that contains only one quotation mark (usually a name with a quotation mark at the start of the string but not at the end) it will not handle the call properly, and may ignore the incoming call completely.

    Additional Reference: