Hi all,

a week or so ago I asked for some advice from you guys about how you 
deal with working out what goes where and who should won stuff when you 
add a new package. I was installing Asterisk on my new LFS/BLFS server. 
Thanks to Randy and Dan for showing me the light ;-).

I'm very happy with the results I've got and I wonder if I should write 
it up as a hint, stick it on the wiki, or even (he hesitates to suggest 
such a thing; such audacity!) try to get it in the book...

Anyway, before committing pen-to-paper so to speak, I though I'd drop 
you a brief summary of what I have done from my notes and get some 
feedback as to if this follows the "book's" standards and would be 
useful or not for the community as a whole.

Here we go:

Build zaptel first if you need it:

the zaptel package provides the kernel modules and interfaces to allow 
access to many types of telephony hardware such as x100p family of 
single port analogue line cards, digium style T400 multi-port analogue 
cards, BRI and PRI (T1/E1) and many others. It also includes some test 
applications and a ztdummy kernel module which is necessary to provide a 
stable timing source to Asterisk when there is no hardware card 
installed the system and you need a timing source, e.g. for IAX to IAX 
trunking.

zaptel needs to find your kernel source tree. This is looked for by 
following the sym-link /lib/modules/kernel-version/build. This is 
created when you run make modules_install druing the kernel installation.

To build and install the zaptel modules:

        ./configure --prefix=/usr
        make menuselect (to select/deselect the modules you wish to build)
        make

as root

        make install

and optionally

        make config (to install the init script and some default configuration 
files). The init script is broken for LFS/BLFS. It's fairly trivial to 
fix however I am unsure if it is really needed as udev seems to achive 
the same thing???

Programs installed into /sbin
fxotune, ztcfg, ztmonitor, ztspeed, zttest

configuration files:
/etc/sysconfig/zaptel

/etc/zaptel.conf

after installing, running ztcfg -vv will show you if the card(s) have 
installed successfully.

-----------------------------------

Asterisk version 1.4.13

Requires:
Zaptel for most analogue and some bri/pri(T1/E1) cards and to provide a 
dummy kernel module ztdummy.ko which can be used to provide a timing 
source for IAX (Asterisk-Asterisk) trunks and "meet me" conferencing.

Optional:
Add-on sound packages, libPRI (both from the digium/asterisk site), 
libnewt for a the zttool command in the zaptel package,
speex (the only "real" Open Source VBR Codec),
MySQL or Postgresql if you want to use a db as the backend.

Set up group and user to run asterisk safely.

        groupadd -g 75 asterisk
        useradd -c "Asterisk PBX" -d /var/lib/asterisk -g asterisk -s 
/bin/false -u 75 asterisk

I think I need a sed to edit the Makefile 
ASTVARRUNDIR=${localstatedir}/run to 
ASTVARRUNDIR=${localstatedir}/run/asterisk. (It was easier for me to 
just edit the file!)

./configure --prefix=/usr
make menuselect (Turn on/off various modules and options. Select sound 
files/language/format and extra sounds "S to save and exit")
make
make install
make samples (installs the sample config files in /etc/asterisk

Asterisk needs write permission for these directories and their contents:

     /var/lib/asterisk
     /var/log/asterisk
     /var/run/asterisk
     /var/spool/asterisk
     /dev/zap/* (If you install the zaptel modules and use the 'make 
config' command, a udev rules file (zaptel.rules) will be written to 
/etc/udev/rules.d. This will allow udev to create the zaptel device 
files as user:group asterisk.

    chown -R asterisk:asterisk 
/var/{lib/asterisk,log/asterisk,run/asterisk,spool/asterisk}

    chmod 750 /var/{lib/asterisk,log/asterisk,run/asterisk,spool/asterisk}
    chmod -R o= /var/{lib/asterisk,log/asterisk,run/asterisk,spool/asterisk}

Asterisk needs read permission for this directory and its contents:

    /etc/asterisk

    chown -R root:asterisk /etc/asterisk
    chmod 750 /etc/asterisk
    chmod 640 /etc/asterisk/*

Some of Asterisk's '.conf' files contain cleartext passwords and other 
potentially sensitive information. Allow reading/writing only by the 
user and group that owns asterisk.

I have modified the rc.d startup script supplied with zaptel to work 
with the lfs/blfs bootscripts and I have added the relevant commands to 
the supplied template to create an asterisk start/stop script too.

Thoughts? (I'm very interested if people think I've got the 
permissions/ownership stuff right or not).

Is this worth writing up properly?

Anyone interested?

Configuration of Asterisk is a bit hard to start with but once you get 
your head round it it's O.K; not much worse than apache or similar once 
you "grok" it.

Cheers.

Alan

-- 
The way out is open!
http://www.theopensourcerer.com

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to