[Asterisk-bsd] On the bleeding edge of asterisk and zaptel with FreeBSD 6.1-STABLE

Kim Culhan w8hdkim at gmail.com
Sun Jun 18 05:55:48 MST 2006


Reading all the recent postings describing various build failures made me wonder
if these programs were still buildable and functional without the
benefit of FreeBSD ports.

Turns out they are, so I did a quick writeup of the procedure used:

6-18-06 kc

To build asterisk from cvs HEAD for FreeBSD:

1) Install subversion from ports in /usr/ports/devel/subversion

2) Obtain asterisk and libpri from digium via subversion:

        a) svn checkout http://svn.digium.com/svn/asterisk/trunk asterisk
           (Checked out revision 34576.)

        b) svn checkout http://svn.digium.com/svn/libpri/trunk libpri
           (Checked out revision 353.)

3) Obtain the FreeBSD zaptel driver via subversion:

           svn co --username svn --password svn
https://svn.pbxpress.com:1443/repos/zaptel-bsd

(The above must all be on one line..)

           (Checked out revision 39.)

4) Install newt from /usr/ports/devel/newt

5) Build libpri, making the following provisions/changes

        a) Edit the libpri Makefile, making
           INSTALL_BASE=/usr/local

        b) Replicate the freebsd zaptel directory from
            beneath zaptel-bsd/trunk/zaptel to the same
            level as the libpri directory:

            cp -R zaptel-bsd/trunk/zaptel .

            So you have /usr/local/src/asterisk/libpri
            and /usr/local/src/asterisk/zaptel
            on the same directory level.

        c) Compile Digium libpri: gmake

        d) Install with: gmake install

6) Compile and install zaptel-bsd:

        a) cd zaptel-bsd/trunk

        b) make;make install

7) Compile and install asterisk:

        a) gmake

        b) Pay attention to the make process as it will probably stop and
             prompt for a restart. This means type gmake again..

        b) gmake install

8) Arrange to load the zaptel loadable kernel modules
    (compiled and installed in step 6 above)
    when the system boots by adding the following to the
     /boot/loader.conf file:

zaptel.ko_load="YES"
qozap.ko_load="YES"
wcfxo.ko_load="YES"
wcfxs.ko_load="YES"
wct1xxp.ko_load="YES"
wct4xxp.ko_load="YES"
wcte11xp.ko_load="YES"

You can arrange for asterisk to start at boot time by installing this
shell script
in /usr/local/etc/rc.d

This script was included with a FreeBSD port:


#!/bin/sh

# PROVIDE asterisk
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown

#
# Add the following lines to /etc/rc.conf to enable asterisk:
#
# asterisk_enable="YES"
#

. /etc/rc.subr

name=asterisk
rcvar=`set_rcvar`

command=/usr/local/sbin/asterisk
pidfile=/var/run/asterisk.pid

asterisk_enable=${asterisk_enable:-"NO"}

/usr/local/bin/ztcfg

echo -n " zaptel"

load_rc_config $name

run_rc_command "$1"


The above procedure worked for me on FreeBSD 6.1-RELEASE which is
also known as FreeBSD-STABLE

YMMV if attempting this with other versions

Also, your mileage may really vary if you attempt this with anything other than
Digium hardware

I couldn't guess what would happen if running 'generic clone' or any other
cheeze ball knock-off hardware..  :)

My dmesg output looks like:

FXS device: vendor=e159 device=1 subvendor=b100
wcfxs0: <Wildcard TDM400P REV E/F> port 0xb800-0xb8ff mem 0xf3b60000-0xf3b60fff
irq 22 at device 1.0 on pci6
FXS Attach for wcfxs0: deviceID : 0xe159
wcfxs0: [FAST]
Freshmaker version: 71
Freshmaker passed register test
Module 0: Installed -- AUTO FXS
Module 1: Installed -- AUTO FXS
ProSLIC sanity check failed
Module 2: Not installed
Module 3: Installed -- AUTO FXO
Found a Wildcard TDM: Wildcard TDM400P REV E/F (4 modules)

I'm not paid by Digium and I don't know anyone there, but I do believe in the
spirit of supporting them as they support us with Asterisk

regards
-kim


More information about the Asterisk-BSD mailing list