How to set up Asterisk
Greg's home page
Greg's diary
Greg's photos
Greg's links

Setting up Asterisk

I've been meaning to set up VoIP services for a long time, but I didn't finally get around to installing Asterisk until late December 2005. It hasn't been easy. At the time of writing, I still don't have a functional configuration. Currently, this page documents some of the problems I've had. I'll update it when I have things working.

The documentation

I started by buying the book Asterisk: The Future of Telephony , from O'Reilly. It was less help than I had hoped; it seems to have been sloppily and hurriedly produced. For example, at the end of Chapter 1, the rest of the book is described with chapter numbers off by one. This text appears to be a duplication of the overview in the Preface, which at least gets the chapter numbers correct. It looks as if Chapter 1 was originally intended to be part of the introduction, which would also have made more sense. Chapter 2 describes how to prepare a system, and chapter 3 explains how to install Asterisk, something that the FreeBSD ports collection does for me, so I started at chapter 4, “Initial Configuration of Asterisk”. Here are some of the issues I've had.

Configuration files

I'm still trying to understand the configuration files. Here's what I have so far:

My setup problems

Armed with such documentation, it's not surprising that I ran into problems. The next problem was that starting Asterisk didn't. Once I found the log files (in FreeBSD they're in in /var/log/asterisk), I found the messages:
Dec 29 11:44:02 WARNING[63086]: Unable to open pseudo channel for timing...  Sound may be choppy.
Dec 29 11:44:02 WARNING[63086]: Unable to lookup 'static'
Dec 29 11:44:02 WARNING[63086]: Unable to open IAX timing interface: No such file or directory
Dec 29 11:44:02 WARNING[63086]: Unable to get our IP address, Skinny disabled
Dec 29 11:44:02 WARNING[63086]: found category [general]
Dec 29 11:44:02 WARNING[63086]: Unable to re-open DSP device: No such file or directory
Dec 29 11:44:02 WARNING[63086]: find_desc could not find <dsp>
Dec 29 11:44:02 NOTICE[63086]: Device dsp not found
Dec 29 11:44:02 WARNING[63086]: load_module failed, returning -1
Dec 29 11:44:02 WARNING[63086]: Loading module failed!

None of these messages made much sense. Why is it a warning to find a category [general]? About the only thing that did make sense was the message Device dsp not found. This system doesn't have a sound card configured; since I didn't want sound, that's not important. More to the point, though, there's nothing in there saying why Asterisk stopped. The book says (p 75):

Note that WARNING and NOTICE messages are not errors; however, ERROR messages should be investigated.

Without any other help, I ran Asterisk under ktrace and finally found a comment in modules.conf:

; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
noload =>
;noload =>
Looking up elsewhere, I discovered that OSS and ALSA are sound card drivers. That makes more sense of the last log message above. After making the following change, I was able to start Asterisk and leave it running.
--- modules.conf-dist   Thu Dec 29 10:32:13 2005
+++ modules.conf        Thu Dec 29 13:03:07 2005
@@ -30,7 +30,7 @@
 ; By default, load OSS only (automatically) and do not load ALSA
 noload =>
-;noload =>
+noload =>
 ; Module names listed in "global" section will have symbols globally
 ; exported to modules loaded after them.

Finally I had things running. It turns out that you can run Asterisk in “console” mode (i.e. not as a daemon). I suppose it's not surprising that it should have its oven views of what the console output should look like:

Emetic printout

Fortunately you can turn these colours off with the -n option.


I can't really conclude yet, of course; I'm not done. But the current state of affairs is that I'm continuing with the book, and the next chapter looks (marginally) better. The book has three authors, something that I've always found a problem. I suspect that chapters 4 and 5 were written by different people. Maybe, by the time I've fought my way through to the end of the book, I'll be happier with it. I'll certainly have more experience.

Greg's diary Greg's photos Greg's links Greg's home page
Valid XHTML 1.0! $Id: asterisk.html,v 1.2 2005/12/30 02:05:35 grog Exp $