Home > Asterisk, Software, Trixbox > Trixbox – Asterisk 1.4 & FreePBX 2.3.0 – w00t

Trixbox – Asterisk 1.4 & FreePBX 2.3.0 – w00t

September 24th, 2007 Leave a comment Go to comments

We’re going to cover a lot of ground, this ‘guide’ assumes you at least know what linux is and hopefully at least used it once or twice.
The intention here is a complete walk thru to get a Trixbox system (2.2 or higher) up an running for a home setup. Some hardware/software you might want:

Sipura 2000 (you can still find them some places, if you can’t the Linksys PAP2-NA should work just fine assuming you get an unlocked one)

You will want an old clunker PC that has a CDROM and a hard drive you can format. The only thing it should require in the end is something a little faster than 500mhz, one power cord, and one network cord.
You will also want a cheap headset or microphone to test with your computer.

Your going to want some sort of SSH client. I use SSH Secure Shell from www.ssh.com (direct link). Putty will work fine as well.

What provider will you use?
Broadvoice – Steep activation fee, lots of complaints in the past, but nothing but good, reliable service for me the past 6 months. $20 a month for unlimited World (including something like 30 countries). Instant setup!
Axvoice – Good solid service for the price, occasionally get all circuits busy when dialing international or local. Good unlimited plan for $18.99 for US/CAN
Telasip – Solid slightly more cutting edge service, $14.95 for 1500 outbound US/CAN unlimited incoming, and can pass your own callerID (useful later)

Of course you don’t have to use any of these, there are tons of other providers, but I run all these everyday and can recommend them all. This guide
will also use these three for sample setups.

Now that you got all that, download the ISO from www.trixbox.org (direct link). Burn it off, and pop it in your clunker, turn it on and hope that power
supply still fires up ;-p. You’ll be presented very few options to go wrong with, it should just breeze through, ask a couple basics like the password,
then it should spit out the CD and reboot. At this point you should login as root and run ‘netconfig’. You want to give the box a static IP since you
will have to forward some ports to it later. Give it an IP that is out of the range of your DHCP on your router and set the nameserver and gateway to
your router’s IP. Type ‘ifdown eth0 && ifup eth0′ this should restart the network and connect you to the internet. You should not need a
keyboard anymore for your trixbox install.

Fire up Firefox (or IE if you swing that way) and point it to http://yourtrixbox
This should give you:

Go ahead and fire up SSH and connect as root to your asterisk server. Now the first thing you want to do is change your passwords. We have a couple to change. Run the following as root:


When you change the FreePBX password you’ll have to update two files as well.

nano -w /etc/asterisk/manager.conf

Find ‘secret = amp11′ under the [admin] section. Change ‘amp11′ to your new desired password. CTRL+X followed by Y to save and exit.

Now, we need to edit the /etc/amportal.conf to use our new password.

nano -w /etc/amportal.conf

Find the line that says ‘AMPMGRPASS=amp11′ and change the ‘amp11′ to the new password you just set. CTRL+X followed by Y to save and exit.

amportal restart

Chaning mySQL passwords

In the same terminal:

mysqladmin -u asteriskuser -p password newpass

The default pass should be amp109, replace newpass with your new password

Update /etc/amportal.conf to use our new password.

nano -w /etc/amportal.conf

Find the line that says ‘AMPDBPASS=amp109′ and change amp109 to your new password, CTRL+X followed by Y to save and exit.

Still more, /etc/asterisk/cdr_mysql.conf

nano -w /etc/asterisk/cdr_mysql.conf

Find the line that says ‘password=amp109′ and change the ‘amp109′ to the new password you just set. CTRL+X followed by ‘Y’ to save and exit.

service mysqld restart
amportal restart

To change the default mysql root password, do the following:

mysqladmin -u root -p password newpass

The default should be passw0rd (notice the zero), change newpass to your password you just set.

Phew! Just for security eh?

Now you should be able to login by press ‘switch’ at the top right of the Trixbox page, enter ‘maint’ for the username and your maint password you just set. Once in you should hover over the Asterisk tab and click FreePBX, find the Module Admin and Check for updates online, upgrade all you can, click process, then come back around and install all the modules you want, I generally leave out the game ;-p. Click process and then click the Apply Changes near the top of the screen, the window will grey out and the server should re-write it’s config files and restart (not the whole computer).

Setting Up Extensions!

Click the Extensions link in FreePBX, your going to be adding a Generic SIP Device. You only need to fill out the Display Name (House), Extension 2000, and make sure you set a secret for the device (a simple password). You can turn on voicemail if you’d like. Do the same for extension 2010 but make the display name Desktop (or Laptop).
Now you should have two extensions, 2000 (House) and 2010 (Desktop)

Let’s move on to Ring Groups, there is order to the chaos I’m doing these in.
We’re going to use Ring Groups to give our cellphone pseudo extension numbers. It’s going to allow us to forward calls directly to your cellphone.
Click on the Ring Groups and follow the below picture to add your first.
Make sure you change the 123456789 to your cell phone

Then do the same thing again, but use your wife/girlfriend’s cell phone number and make the Ring Group Number 3001
You should have then both terminate on no answer since your cellphone has voicemail.
Apply the settings and let’s move on.

Why don’t we connect your softphone so we can do some system recordings.
Download Xlite (Windows) (Linux)
Install and bring up the Sip Account Settings.
You need:
Display Name: Desktop
Username: 2010
Auth. User: 2010
Domain: 192.168.x.x <— YOUR TRIXBOX IP

If everything goes well it will register and say your username in the display.
Now we’re going to head over to the system recordings page, enter your extension number 2010, dial *77, recording a message for your default
greeting, I find it helps to write it out before. IE: “Hi, you’ve reach Bob & Sally at 1800BOBSALLY. Press 1 for House, Press 2 for Bob Cell, Press 3 for Sally cell….”
If dialing *77 doesn’t perform as advertised just dial *99 and you get the same options.
Save the recording with your own name.
Now that’s all done we can build the IVR! Oh! One more thing, click the DISA link, enter Default for the name, enter a pin and save the settings.
Now Apply the settings and we’ll move on.

Building the IVR

For a small system like this, this is pretty simple and straight forward. Going to the IVR link in FreePBX you can fill out a name for IVR
I use something like House. You can leave the default settings until you get to the bottom, you should have 3 blank areas with some options to the right of them. Enter 1 in the first blank box, and select your extension for the House in your options to the right. Enter 2 in the next box, and select Bob Cell from the Ring Group option. Enter 3 in the next box, you guessed it, Sally cell.
Save the settings at the bottom, then click Increase options once. In the new box, enter 4 and select the DISA/Default option (…but I didn’t record an option for number 4……)
Save and Apply the settings.

Let’s pull you back to the ol’ SSH client as root:
ping all these servers and find the one that has the lowest ping time (1ms would be good)

Then, nano -w /etc/hosts and make a line like the following substitute the ip for your fastest: sip.broadvoice.com

CTRL + O to save CTRL + X to exit

On to the trunks!

Trunks are kinda like the equivelent to a “line” in a Ma Bell world. It’s really going to be our connection to our SIP provider. For now let’s
assume you went with BroadVoice.

Max Channels: 2 (two calls total on the line at once)

Dial Rules (this will catch all 10 digit dialing and some):

Give the trunk a name like broadvoice

Peer Details:
canreinvite=no ;if your behind NAT

Blank the incoming fields and move down to the registration. It will be something like the following:

Save the settings & Apply.

Let’s setup the Outbound Routes
There is a default blank that we can just edit. In the dial rules this is what I have:

This catches pretty much everything and throws it to my trunks. If you don’t have 911 or International in your plan remove 911 and 011.
At the bottom you can select your Broadvoice trunk, save & apply.

Now just go back to your Inbound Routes and change the default destination to the IVR and calls should end up there.
Pick up your cellphone and run a test.
Don’t forget with the SSH client you can type ‘asterisk -r’ as root and connect to the server to watch calls in real time.

Categories: Asterisk, Software, Trixbox Tags:
  1. April 11th, 2008 at 07:42 | #1

    Your blog is very informative, I have learned so much from it. It is like daily newspaper :) . Added to fav?s.

  1. No trackbacks yet.

Spam Protection by WP-SpamFree