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.


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