PBX In A Flash Setup

Also Works with Trixbox

****  WORK IN PROGRESS  ****

Absolute Dummies:  Inital setup and Configure a SIP device

Help On Configuring Other Services

And Problems / Surprises

Help Forums & Documents:

Digium / Asterisk


PBX In A Flash

Asterisk v1.4 CLI Command

Trixbox2 Without Tears (PDF) Still relevant.

Configuring Stuff:

Adding An Extension

Uddle CBC Asterisk PBX: Configure Trixbox for IAX access

Adding an IPKall Number

A SIP URI Number as an Extension (Example: A number from Telephreak)

Setup A Callcentric DID

Asterisk v1.4 CLI Commands: Use it to troubleshoot a problem

Unknown Destination Problem using FreePBX v2.4

Setup Vitelity DID Number

Setup Sipbroker  A Gateway To Other VoIP Networks

Absolute Dummies: Initial Setup

After the simple install and reboot, you will need to log in and do a few things.

Type in 'help-trixbox' and you will get a list of commands.

The first is 'netconfig'. This will get your Internet connection started. If you have a static IP address, enter that along with the Gateway IP address and your ISP's DNS server address.

Changing The Default Passwords

Here are some commands for important passwords that you will need to change:
passwd-maint    set master password for web GUI
passwd-amp      set password for amp only
passwd-meetme   set password for Web MeetMe only
passwd          set root password for console login
passwd admin    set admin password for checking system mail

You will get a couple of warnings about changing default passwords later on when you open up FreePBX.

Default Asterisk Manager Password Used

You are using the default Asterisk Manager password that is widely known, you should set a secure password.

Edit the two files :

Modify AMPMGRPASS in the file /etc/asterisk/amportal.conf

'vi /etc/asterisk/amportal.conf'

Modify secret in the file /etc/asterisk/manager.conf

'vi /etc/asterisk/manager.conf'

Next at the prompt enter 'amportal restart'

Update the Software 

Next is to update all the software to the latest revision.  For Trixbox, at the command line by typing in:

yum -y update

For PBX In A Flash the two commands are:




Open a browser and enter in the IP address of the Trixbox or PIAF machine.

Click on the upper right hand corner where it says switch. You will get a login screen. The user is maint and the password is what you changed it to. You will get the screen below.

Put the cursor over one of the menus that says Asterisk. When it unfolds out, click on FreePBX.

Home Phone Line Setup

First you will need a card that plugs into your PC. It is a model "X100P". There are many of them on eBay.

Setup Zaptel Devices like the X100P.

genzaptelconf -dsv

The above command is no longer there when you type in help-trixbox.

In FreePBX, click on Zap Channel DIDs.

Next click on Add Channel

In Channel enter "1"

In DID enter in the phone number so that the phone number is attached to Zaptel channel 1. Submit the changes.

Add Trunk. Add Zap Trunk. In the Outbound caller ID enter the phone number. Submit the changes.

Click on Outbound Settings. It should already be named 9_outside. Select to edit it. In the Dial Rules Wizard choose the Lookup Numbers for Local Trunk (10-digits). For the Outgoing Settings in Zap Identifier, scroll to g0. Submit the page.

Click on Incoming Settings. In Description call it whatever you want. In the DID Number box enter your phone number. Last thing, direct the call to where ever you want.

System Recordings

These are the recordings that you make and upload yourself. I use a neat application called WinSCP. WinSCP is an open source free SFTP client and FTP client for Windows.

MP3 support was taken out of Trixbox v2.3 and up. What I do is to upload just the system files that will be used for announcements. There seems to be a limit on the amount of files you can upload and have them in the list of system files. My limit on Trixbox v2.3 was 43 files. These system files will be included in the pull down menus when you want to add a recording to an IVR. The rest of the files can be uploaded to the /var/lib/asterisk/sounds/custom directory.

The file must be PCM Encoded, 16 Bits, at 8000Hz. There is a way to convert them using a program called 'sox'. It's a command line program. It is already included with Trixbox but it does not include support for MP3's. SOX has to have the MP3 support compiled with it when installed.


Here is how you can convert the file using either an MP3 or a WAV file. The place to upload the file should be: /var/lib/asterisk/sounds/custom

sox -v 0.4 infile.wav -t raw -r 8000 -s -w -c1 outfile.sln

This will convert the file to a .sln which is the native audio file format that can make it easy to convert between codec.

Below are the codecs that are supported in Asterisk

  • G.711 ulaw (as used in US) Uses highest bandwidth 96K
  • G.711 alaw (as used in Europe) Uses highest bandwidth 96K
  • G.722 - 16 kHz wideband codec; passthrough, playback and recording in Asterisk 1.4; full support incl. transcoding in Asterisk 1.6, a backport for 1.4 is available, or use this possibly more up-to-date patch
  • G.723.1 - pass-thru for people who need a license , free for other people
  • G.726 - 32kbps in Asterisk 1.0.3, 16/24/32/40kbps in CVS HEAD; flawed until Asterisk 1.4 which corrected the implementation and introduced g726aal2 for backwards compatibility with Asterisk 1.2 installations
  • G.729 - may require a license unless using pass-thru, free version available for use in countries without patents or for educational use only
  • GSM
  • Speex - configurable 4-48kbps, VBR, ABR, etc. see bug 2536. For Asterisk 1.4. there is patch 1051 available that adds wideband support for the OpenWengo software client

Adding Recordings

I use WinSCP to transfer all of the recordings to the Trixbox machine. I am encoding the files to a .sln file extension. This file format is the easiest to transcode to any codec without a lot of CPU overhead. and it sounds great.

The next thing would be to create a Custom Application or 'custom app'.

Editing the file "/etc/asterisk/extensions_custom.conf" I added the following:


; ,Answer (answers the line)

; ,Flite (text to speech)

; ,ControlPlayback (filename,FFmS,RW,FF,Stop,Pause,Restart)

; ,Hangup

exten => tape-002,1,Answer

exten => tape-002,n,Flite("Fun phone tape number 2")

exten => tape-002,n,ControlPlayback(custom/P002,5000,#,*)

exten => tape-002,n,Hangup

exten => tape-003,1,Answer

exten => tape-003,n,Flite("Fun phone tape number 3")

exten => tape-003,n,ControlPlayback(custom/P003,5000,#,*)

exten => tape-003,n,Hangup

exten => tape-004,1,Answer

exten => tape-004,n,Flite("Fun phone tape number 4")

exten => tape-004,n,ControlPlayback(custom/P004,5000,#,*)

exten => tape-004,n,Hangup

and so on for each recording......... I have 125 of them.

Adding Your Custom Recordings:

Now to specify each custom recording. Under the Admin pulldown menu, choose Custom Destinations. In the first box that says Custom Destinations, place the name of the custom app which in this case, the 2nd recording of Phunfone. In your extensions_custom.conf, or file where you have defined each recording,add custom- to the beginning so it looks like this:


We take from [custom-phunfone], tape-002 (recording number), and "1" which points to the first instruction of the application.

Next you give it a name that you can reference to. In my case I used:

Phunfone 002

After all of your apps have been entered next is to create an IVR. I entered the three digit tape number in the empty box. Next in the "Custom Applications" box, I scrolled down for tape #002 'Phunfone 002'. Then just do the same for the rest of the recordings.


After you are done, click on Save and then the orange bar pictured below.

Adding a Streaming Radio Station (Custom Application)

Trixbox v2.4 does not support playing MP3's. Some of us in the Trixbox forums are trying to convince the developers to add it in, even if it does have a bit of a performance hit.

First I will show you how to add the station to your IVR menu. Back at the main window you go to the menu 'asterisk, then config edit. Now click on extensions_custom.conf or at the command line shell edit the '/etc/asterisk/extensions_custom.conf' file and added:

exten => s,1,Answer
exten => s,2,MP3Player(http://media.kuband.info:7310/)
exten => s,3,Hangup

It is best to use a low bit stream like 16k or so.  Higher bandwidth will not make it sound better.  It is already better than any of the recording prompts on your system.

Next is to get to Custom Destinations which is under the Tools tab in the PBX settings of FreePBX.  In the Custon Destinations box you would enter custom-wtnd,s,1  Next give it a name in the Description box.  I used WTND-LP.


Back to the IVR again. Click on "Increase Options" to add another array of entry boxes, then in the first box I'm using 222. Next in the Custom Applications box I put WTND-LP.

For now you cannot make an extension stream audio.  But if you are using Sipbroker and have a routing code through them, you can create an extention that way to play your favorite stream.  See this page about setting up a Sipbroker account.

Go to Inbound Routes.  Enter your Description in the box.  Enter in the DID Number in the box, that would act as an extension.  Down at the bottom scroll down the Custom Applications to the application you want to run.  In this case it is WTND-LP.


Allow Anonymous Inbound SIP Calls?


Setting this to 'yes' will potentially allow ANYBODY to call into your Asterisk server using the SIP protocol.

It should only be used if you fully understand the impact of allowing anonymous calls into your server.


Someone could call you by entering in their softphone,

"EXT@" "extension@yourserveraddress"


To enable this, in FreePBX, click on General Settings. Check out some of the other settings to see if they can be useful.


Neat New Handy Feature

You can use a module that is called Announcement to playback a System Recording (like a timeout or error in dialing), and then goes to another destination.


When you click on it, you need to give it a Description. That will be the name in the drop down menu in the IVR for you to select. The file you select is from a list of files you uploaded using the system's upload feature.


E-Mail Links to Messages

You can have the system send you an e-mail when you receive a voice mail message. One thing that you need to do is to edit the file that points to your IP address or domain name.  Substitute where it says AMPWEBADDRESS with your domain name or IP address.

vi /etc/asterisk/vm_email.inc

Problems I am having with Trixbox

Adding System Recordings: Add Recording: Cannot upload more than 42 custom recordings. All files are .sln files.


The .sln files are called a Signed Linear format. They are of an Asterisk Native audio format. Sound files in the sln format are compressed but seems to have the same file size as the MP3 source file.  These files have the highest dynamic range and quality. This file type is the easiest to convert to a different codec on the fly with the appropriate codec for the particular channel. If your Asterisk system uses different codecs for different interfaces/clients, this format will present the best quality for each codec.


System Status Page: I have been getting errors when the initial page loads up when logging into the GUI. Short solution is to stop the browser from loading. This is the page with the System Status. There are a bunch of PHP errors. It started when I did a yum update.

Wish List for FreePBX/Trixbox

1. An extension that runs or forwards to an IVR.

2. An extension that plays recordings.