I've been fighting with Asterisk the last few days. I think now I have almost tamed the beast though. At first I was running into problems with the web interface. However, at the time I was running the packages that come with Ubuntu 8.04 server. I decided that it would just be better to just compile the latest stable version on my own.
This is fine except that the latest stable version's config files don't actually work. When I started Asterisk I would get an error about how it could not create /var/run/assterisk.pid. This, inspite of the fact that after looking at /etc/init.d/asterisk, it was telling asterisk to create the file in /var/run/asterisk where the asterisk user and group had full rights. Bizaar.
After leaving it for the weekend (My family went to go visit Grandma at her new house) I took a fresh crack at it this morning. It sfunny how when you leave something for a few days you get a whole fresh new look at things.
I decided that even with hacking the /etc/init.d/asterisk file to hard code the startup command to ensure it was passing the right parameters and getting no where, that the /etc/asterisk/asterisk.conf file must be the culprit.
In the asterisk.conf file that the make command creates, it just housed one section called [global] with a number of directives for where Asterisk should find and create files.
Well it turns out that this is horribly wrong, and people know about it. Lovely.
I changed the file to look like this instead: