[Asterisk-doc] suggested addition for Hardware Installation

Randy Resnick asterisk-doc@lists.digium.com
Thu, 27 May 2004 08:54:54 +0200


Version two, since this wasn't added. I think it's pretty understandable.

---- hardware installation - digium cards for a simple POTS pbx

If you are dedicating the computer to asterisk, free up the most IRQ by 
disabling USB, serial and parallel port support in the BIOS. Otherwise, 
you want to free as many as possible. You will NOT want to see a NIC 
sharing IRQ with a TDM or FXO card! It's best that these cards have 
their own IRQ.

Most BIOS will allow you to manually assign IRQ to specific slots. Go 
into BIOS and look for the IRQ area, often on the second page. If it was 
on AUTO, try setting to manual and see what happens. Chances are, a 
table will become available for manually assigning an IRQ to each slot.

Note: One thing to watch out for on some mobo is slots *sharing* IRQs.
Look in the BIOS and check if it has an entry like "1/5" in the IRQ
table.

Once booted, view /proc/interrupts to see the assigned IRQ:

(output below is just an example with Digium hardware flagged)

# cat /proc/interrupts

             CPU0
    0:   41353058          XT-PIC  timer
    1:       1988          XT-PIC  keyboard
    2:          0          XT-PIC  cascade
    3:  413437739          XT-PIC  wctdm <-- TDM400
    4:    5721494          XT-PIC  eth0
    7:  413453581          XT-PIC  wcfxo <-- X100P
    8:          1          XT-PIC  rtc
    9:  413445182          XT-PIC  wcfxo <-- X100P
   12:          0          XT-PIC  PS/2 Mouse
   14:     179578          XT-PIC  ide0
   15:          3          XT-PIC  ide1
NMI:          0
ERR:          0

Above you can see the three Digium cards each on its own IRQ.
If this is the case, you can go on to install hardware drivers.

Here is a possible /etc/zaptel.conf for the three-card setup above :

fxsks = 1,2
fxoks = 3,4,5
loadzone = us
defaultzone = us

When this file is ready, you can try the following commands:

# modprobe zaptel
# modprobe wcfxo
# modprobe wcfxs

modprobe loads the drivers. It can also unload them [man modprobe]

The zaptel command will now configure the channels for us:

# ztcfg -vv
(output of the command)
Zaptel Configuration
======================


Channel map:

Channel 01: FXS Kewlstart (Default) (Slaves: 01)
Channel 02: FXS Kewlstart (Default) (Slaves: 02)
Channel 03: FXO Kewlstart (Default) (Slaves: 03)
Channel 04: FXO Kewlstart (Default) (Slaves: 04)
Channel 05: FXO Kewlstart (Default) (Slaves: 05)

5 channels configured.

This looks right. The first two are X100P FXO, each with a channel. The 
last three channels are assigned to FXS modules found on the TDM400. 
Note the FXS signaling on the first two (FXO) cards and FXO signaling on 
the three FXS channels. Now we need to configure asterisk before 
starting it.

Here is /etc/asterisk/zapata.conf :

[channels]
language=en

; X100P modem card1 for incoming and outgoing PSTN calls
; incoming calls drop into [from-Line1] context in extensions.conf
; Dial string for this line would be ZAP/1
context=from-Line1
signalling=fxs_ks
usecallerid=yes
echocancel=yes
echocancelwhenbridged=yes
immediate=no
transfer=yes
cancallforward=yes
echotraining=yes
rxgain=0.0
txgain=0.0
musiconhold=default
channel => 1

; X100P modem card2 for incoming and outgoing calls
; incoming calls drop into [from-Line2] context in extensions.conf
; Dial string for this line would be ZAP/2
context=from-Line2
signalling=fxs_ks
usecallerid=yes
echocancel=yes
echocancelwhenbridged=yes
callwaiting=yes
callwaitingcallerid=yes
callprogress=no
busydetect=yes
busycount=7
immediate=no
threewaycalling=yes
transfer=yes
cancallforward=yes
echotraining=yes
rxgain=0.0
txgain=0.0
musiconhold=default
channel => 2

; Dial string for this phone will be ZAP/3
callerid="Bernie A.H. Sales" <2005>
signalling=fxo_ks
context=inhouse
immediate=no
relaxdtmf=yes
callgroup=1
pickupgroup=1
; if there are groups other than default
; in voicemail.conf the voicemail context name
; must be given for MWI to work
; all users of phones on TDM400 are
; inhouse obviously
mailbox=2000@inhouse
channel => 3

; Dial string for this phone will be ZAP/4
callerid="Judy (Blonde)" <2006>
signalling=fxo_ks
context=inhouse
immediate=no
relaxdtmf=yes
callgroup=1
pickupgroup=1
mailbox=2001@inhouse
channel => 4

; Dial string for this phone will be ZAP/5
callerid="Clueless Boss Alert!" <2007>
signalling=fxo_ks
immediate=yes
; boss picks up phone and rings you!
; This is done in the [theboss] context
; of extensions.conf
context=theboss
relaxdtmf=yes
callgroup=1
pickupgroup=1
mailbox=2002@inhouse
channel => 5

You can remove any or all of the above channels, just make sure you 
renumber the remaining ones properly according to the channel order 
output when you ran ztcfg.

Assuming you have a coherent setup in zapata.conf you can try starting 
asterisk:

# asterisk -cvvvvvv

Since you system setup will vary, you will need to have added extensions 
in order to make calls or do anything else, but hopefully this concludes 
the hardware setup until you buy more.