Bobcares

Asterisk -A quick look under the hood

by | Nov 25, 2007

So you have Asterisk installed to your CentOS hardware. Now what? Let’s open up the hood and see what Asterisk can do before we do that, let’s examine some things that you need to know about Asterisk to setup and manage your Asterisk box

In a default Asterisk installation, we will want to put our configuration files in the directory: /etc/asterisk
If you want to have some Asterisk sample conf files to help guide you, you can issue the command: make samples from your Asterisk installation directory. (In my previous posts, I installed mine to /usr/src/asterisk/)

Basic Configuration Files

For the most basic installation, there is a handful of configuration files that you need to be concerned with:

sip.conf and/or iax.conf

These generally depend on your carrier and the connection type that you choose with them. And then as well, the connection that is made between your Asterisk server and your phones. We will get into more detail on the contents of the file later on.

extensions.conf

This is what I consider the backbone of your phone system. Within the extensions.conf you determine what happens when a number is dialed, or what time of the day a call is routed to your phone, which phone a call is routed to, and so much more. Again, we will get into more detail on this file later on.

voicemail.conf

This one pretty much explains itself. It is where you setup the voicemail boxes and users.

zapata.conf

This configuration file would apply if you were using a FXS/FXO Card, which we are not in my example.

Basic Asterisk Commands

You will need to get familiar with the Asterisk Cli (command line.)
For that matter, you will want to get to know Linux and the basic commands there as well. We won’t get into the Linux commands, but here are some Asterisk Commands that you should get to know.

Getting to Asterisk Cli:

asterisk -r

Once you are in the Asterisk Cli, you can issue any of the following

reload

– This command reloads the configuration files, thus applying any changes that you made.

queue show

– This command will show you the status of a Queue (if you have any setup) – it will show you how many calls are waiting in that queue, the average holdtime, each member/agent that is currently in that queue, and how many calls and how long ago each members last call was.

sip show registry

– This command will show you the status of any SIP connections with remote hosts. (eg: Your VOIP carrier.) If you have an authenticated connection with them, it will show as registered otherwise it will show it as unregistered.

iax2 show registry

– This command will show you the status of any IAX connections, and whether they are registered or not.

sip show users

– This command will show you a list of all the SIP Users setup in the sip.conf – along with their secret password. This is great for when you go to setup the phones.

There is so much more that can be done with Asterisk. These are just some basics to get you started.

Understanding Asterisk Codecs

What are Codecs? In lame man’s term, they are the different levels of compression for the audio between the phone and Asterisk box, and between the Asterisk box and your carrier. What’s the differences and which ones are best?

Basically the major differences is the amount of compression. What effect does the compression have on things? Generally speaking, the higher the compression, the less bandwidth used – but at the same time the lower the sound quality. You will also find that a higher compression codecs will require more CPU power to use.

Codec Data bitrate (Kbps) License Required
G.711 64 Kbps No
G.726 16, 24, 32, or 40 Kbps No
G.729A 8 Kbps Yes
GSM 13 Kbps No
iLBC 13.3 Kbps or 15.2 Kbps No
Speex Between 2.15 Kbps & 22.4 Kbps No

The most common codecs used are going to be: G.711 (ulaw or alaw as they are known), G.726, G.729A, and GSM. If you are bandwidth limited but can afford to lose some CPU power, GSM is good. Otherwise I would suggest G.711/ulaw as it’s basically uncompressed so there is limited CPU usage incurred. – I personally like ulaw for quality sake – of course we are not restricted by bandwidth here.

Compatibility – You will definitely want to check the compatibility of these codecs with your carrier and phones. Asterisk supports the major ones without much tweaking required. We will get more into using these codecs as we configure our Asterisk system in future articles.


Articles by Robert Broyles

About the author:
Robert Broyles is Team Leader at the Bobcares Phone Support Center, Phoenix, AZ. While he is not busy managing the team and Phone support, Robert loves to tweak Asterisk systems. His blog can be found at http://hostseries.com/


0 Comments

Never again lose customers to poor
server speed! Let us help you.