VoIPowering your Office with Asterisk�Building a Test Lab, Part 3

Finally, we swap in your company logo, configure firewall settings, and connect to the PSTN.

By Carla Schroder | Posted Apr 17, 2006
Page of   |  Back to Page 1
Print ArticleEmail Article
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Welcome to our final installment in building your own Asterisk@Home test lab. Part 1 covered hardware requirements, and installing Asterisk@Home. Part 2 took us as far as setting up a local PBX and having local extensions calling each other. Today we shall connect to the big bad outside world.

But first, I am going to keep my promise of showing you how to replace the stock Asterisk@Home logo with a logo of your own. You might want to do this just to put your company identity on your Asterisk server, or you may need to reassure a nervous boss who thinks that the name "Asterisk@Home" means it is not suitable for the enterprise. On the contrary, Asterisk@Home is an enterprise powerhouse, so don't let the name get in the way.

Name your logo aaw_logo.png, then copy your logo to the /var/build_aah/www/ directory on the server. Asterisk@Home comes with an SSH server already running, so you can use this command to copy the file from a second PC on your LAN. Of course you must use your own server IP or hostname:

$ scp aaw_logo.png root@aah_server1:/var/build_aah/www/

Now you must log in as root on the Asterisk server. You can do this from the LAN neighbor as well:

$ ssh root@aah_server1
root@192.168.1.20's password:
Last login: Tue Apr 11 17:52:43 2006 from 192.168.1.10
Welcome to Asterisk@Home
-------------------------------------------------
For access to the Asterisk@Home web GUI use this URL
http://192.168.1.20
For help on Asterisk@Home commands you can use from this
command shell type help-aah.
[root@asterisk1 ~]#

Then download and execute the aah-change-logo script, using these commands:

# wget http://www.voip-info.org/users/415/415/images/396/aah-change-logo.sh.txt
# dos2unix aah-change-logo.sh.txt
# sh aah-change-logo.sh.txt

The script finds and replaces all instances of the logo, so when you're finished you'll see your own logo in AMP. Figure 1 shows what it looks like with an "Asterisk@Work" logo:

Figure1.

Making Internet phone calls
Now it's time to make some calls to the outside world.

All you need is a broadband Internet connection, and a commercial VoIP service provider that does "PSTN termination." PSTN termination means they provide an interface between your Asterisk server and the Public Switched Telephone Network (PSTN). This lets you call anywhere just like normal old-fashioned telephone service. These accounts are not very expensive; if you budget $50 per month for your testing account you should have leftover money every month. You'll get a single phone number and the ability to place and receive calls.

Some extras to consider—though perhaps they are not so important for your test lab—are migrating an existing phone number and 911 service. Not all providers offer these.

You want a "byod," or bring-your-own-device provider that is friendly to Asterisk, like this sampling of inexpensive, Asterisk-friendly providers:

Every provider has their own Asterisk setup instructions, so be sure to follow them, because there is no generic configuration that works for all of them. When you configure Asterisk to use one of these providers, this is called setting up a new trunk. You'll need both an incoming and an outgoing trunk.

Firewall configuration
To get through your firewall you'll need these ports forwarded to your Asterisk server:

4569 TCP/UDP
5004-5082 TCP/UDP
10000-20000 TCP/UDP

If you have a NAT firewall you must edit /etc/asterisk/sip.conf on the server, adding these lines:

externip = 1.2.3.4
localnet = 192.168.1.0/255.255.255.0
nat=yes

For "externip" use your own public IP, and "localnet" is your LAN. Be sure to check the instructions of your service provider for any special firewall configurations.

If you're not used to editing text files in the console, now is the time to learn, because even with Asterisk@Home you'll have to do this. Asterisk comes with both the vi and Nano text editors. Nano is easy to use. Open files like this:

# nano/etc/asterisk/sip.conf

Basic commands are always displayed when Nano is open, so you'll learn your way around quickly.

Digital Receptionist
Your Digital Receptionist routes incoming calls, so the next step is to set up this feature.

Open Setup -> Digital Receptionist. The first setup window walks you through recording a greeting. The following windows are self-explanatory, and will walk you through setting up your various options. You may have several different Digital Receptionist menus, as Figure 2 shows:

Figure 2.

Ring groups
Setting up Ring Groups is optional. Some folks like to have all extensions ring on incoming calls. Asterisk can ring all extensions at once, or one at a time in sequence. Open Setup -> Ring Groups. Select the extensions you want in the group, like Figure 2 shows, and the action to take if no one answers:

Figure 3.

Incoming calls
Now open Setup -> Incoming Calls. This controls how incoming calls from outside your network are handled at different days and times, as Figure 4 shows:

Figure 4.

This is where you put your Digital Receptionists to work.

All finished
Now you can test just about any Asterisk function you can think of: different features, different hardware, do load-testing, and various networking tweaks and optimizations. Be sure to bookmark the VoIP Planet glossary, and check back often as we add additional telephony terms to it.

Resources
Asterisk: the Open Source PBX
Asterisk@Home
Voip-Info.org
My very own Linux Cookbook is designed for beginning to intermediate Linux system administrators and users
TCP/IP Network Administration, Third Edition is a great networking reference

Comment and Contribute
(Maximum characters: 1200). You have
characters left.
Get the Latest Scoop with Enterprise Networking Planet Newsletter