in Telephony

rebuilding Asterisk from scratch

As I mentioned in a previous post, I realized that the knowledge I was going to get out of Asterisk was limited by the amount of hand-holding that Asterisk@Home provides. Don’t get me wrong — A@H is a great way to get started with Asterisk, as it comes with a huge variety of features already built in. However, for someone who is a little more happy hacking about and getting to know every nook and cranny of his VoIP system, I realized that I’d have to start over.

I was also eager to rebuild the VoIP server using a BSD. I find Linux to be just too bloated for use as a VoIP server, and I was also interested in seeing how far NetBSD has come from the days when I used it last; my last NetBSD machine ran 1.6, and they’re onto 3.0 by now. I’m very familiar with the progress made by the FreeBSD Project, and am interested to see how NetBSD stacks up.

So, I downloaded NetBSD 3.0 and walked through a basic install. Not much has changed in the installation program (except that it doesn’t fall over and die at least once, like FreeBSD’s sysinstall) My first challenge was trying to compile the zaptel drivers for NetBSD; the compilation bombed out with thousands of lines of warnings. I scanned the errors and realized that I hadn’t installed the kernel sources, so I went off to download the system sources using AnonCVS. Since I’m not interested in tracking -current, just NetBSD 3.0.x, I used the following syntax:

# CVSROOT=:pserver:anoncvs@anoncvs.NetBSD.org:/cvsroot; export CVSROOT

# cd /usr

# cvs checkout -r netbsd-3-0 -P src

Once that was done, I decided to build a new kernel, because I wanted the swwdog(4) (software watchdog) driver. I decided to install the adjustkernel package to build a stripped-down kernel configuration from GENERIC and the current dmesg. This mostly worked, except that adjustkernel helpfully stripped out my atabus and atapibus drivers (I have no idea why). Fortunately I caught this before I rebuilt the kernel — in any case, config(8) complained appropriately and alerted me to this problem as well.

The kernel was rebuilt as follows:

# cd /usr/src

# ./build.sh tools

# ./build.sh kernel=BABELFISH

After that, I copied the resultant netbsd to / and rebooted. All was well when the system came back.

I was then able to compile and install the zaptel drivers without any problems.

Since I have an X100P clone card, I configured the /etc/lkm.conf as follows:

/usr/pkg/lkm/mod_zaptel.o -s – /usr/pkg/sbin/zaptel_postinstall – –

/usr/pkg/lkm/mod_wcfxo.o -s – – – –

I also needed to set lkm=YES in /etc/rc.conf, and then I ran /etc/rc.lkm to load the appropriate modules.

The zaptel card still needed to be configured, with the following lines in /usr/pkg/etc/zaptel.conf:

fxsks=1

loadzone=us

defaultzone=us

Then I ran ztcfg -vvvv to make sure all was well.

Next up: configuring Asterisk channels.

Write a Comment

Comment