VoIPowering Your Office: Asterisk 1.4�Part 1:Trips and Traps

The new version is almost out of beta. There's lots that's new, and some familiar features are on their way out.

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

The last time we paid a visit to Asterisk 1.4 was way back in October. Since then I've both torture-tested it and been tortured by it. It's still in beta and has a few prickles yet, but it's very close to a final release. Let's take a look at some of the changes, and some helpful tips and tricks.

Finding Help files
Asterisk contains quite a bit of help—if you know where to look. The source tarball contains both sample configurations (/usr/src/asterisk-1.4.0-[version]/configs) and help documents (/usr/src/asterisk-[version]/doc). You can also find the latest versions of these in the Asterisk Subversion tree at svn.digium.com/view/asterisk/trunk/.

Commands All Different
Console commands are all rearranged. The old ones still work, but you'll see this:

#asterisk1*CLI> dial 250@local-users
The 'dial' command is deprecated and will be removed in a future release. Please use 'console dial' instead.
Interestingly, console dial doesn't work in 1.4.0-beta3. But most of the new commands do, and I expect it will be fixed. The new command syntax is <module > <verb> <args> . You can see your available commands by typing help:
#asterisk1*CLI> help
You'll get details on invidual commands with
#asterisk1*CLI> help show parkedcalls
Usage: show parkedcalls
       Lists currently parked calls.
You can still type reload after changing any configuration files that support reloading, or you can be more surgical:
  • dialplan reload loads changes in extensions.conf
  • reload chan_sip.so is for sip.conf and sip_notify.conf
  • reload chan_iax2.so is for iax.conf and iaxprov.conf

Music on hold
Changes in hold music are causing consternation and woe, because Asterisk 1.4 does not include .mp3 music files, but instead uses .wav-formatted music files. .wav has the best sound quality (like that matters over a telephone!), doesn't need an .mp3 player, and is easy on CPU cycles. .mp3 is highly compressed, so your server has to work harder to uncompress and play them. If you have CPU cycles to spare you can use .mp3 files; you'll have to install Asterisk-addons to get the format_mp3 player.

Deprecated everything
With Asterisk 1.4, you're going to get real tired of the word deprecated. This is programmer-speak for "this feature that you love best of all is going to be removed soon." Take a stroll through /usr/src/asterisk-1.4.0-[version]/CHANGES to see what's cookin'.

One application that is sorely missed is AgentCallbackLogin. Users who are running call centers are filling the heavens with cries of woe over losing this. It's still in 1.4, but not for much longer. There is no direct replacement. The entry in CHANGES says

Deprecation of AgentCallbackLogin in favor of a dialplan-based solution
Mmmkay. That sounds like a lot of work, and it is. Read doc/queues-with-callback-members.txt to study up on the replacement. It starts off not very encouragingly:
Pardon, but the dialplan in this tutorial will be expressed in AEL, the new Asterisk Extension Language. If you are not used to its syntax, we hope you will find it to some degree intuitive. If not, there are documents explaining its syntax and constructs.
My initial reaction to this is "aieee". But it's not that bad. doc/ael.txt is helpful.

Customizing the Asterisk CLI prompt
Old critters like me don't care to read colored text on black backgrounds, which is the default Asterisk console color scheme. The easy way to get around this is to have these lines in /etc/init.d/asterisk:

# Full path to asterisk binary
DAEMON=$AST_SBIN/asterisk TERM=linux asterisk
The DAEMON line is already there—just add TERM=linux asterisk. Restart Asterisk from the Linux command line this way:
# /etc/init.d/asterisk restart

Then when you attach to a running Asterisk session (asterisk -r) from an X terminal (like Konsole, xterm, or Gnome terminal) you'll keep your local terminal color scheme. But this doesn't affect the Asterisk root console, because those colors are hard-coded into Asterisk. You can see for yourself in the source directory, in /usr/src/asterisk-1.4.0-[version]/main/term.c.

You can customize the prompt a bit, if the default prompt is too dull for you. First add these lines to /etc/asterisk/extensions.conf in the [globals] section:

${ENV(UNIX)}
${ENV(ASTERISK_PROMPT)}
Then in /etc/profile on the Asterisk server, set the ASTERISK_PROMPT values:
 ASTERISK_PROMPT='%t, %l2, %h*> '
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC ASTERISK_PROMPT
Your export variables will probably be different; just tack ASTERISK_PROMPT on at the end. Reboot, run asterisk -r from your X terminal, and voilá! The prompt is customized and your colors do not change:
17:51:30, 0.54, asterisk1.alrac.net*>

This example displays the time, the load average for the past five minutes, and the fully-qualified server name. Look in /usr/src/asterisk-1.4.0-[version]/doc/cliprompt.txt to see a list of values to use.

More deprecating
A large number of popular applications and channel variables have gone away, like SetCIDname, SetCIDnum, CALLERIDNAME, CALLERIDNUM, DateTime, TIMEOUT, and MUSICCLASS. I'll go into detail on these next week, and take a look at some interesting and useful applications new to Asterisk 1.4.

Resources
Asterisk.org
Voip-info.org

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