Compile/install Zaptel and Asterisk

cd /usr/src/zaptel
make clean
./configure; make menuselect
At menu press "x"
make; make install

cd /usr/src/asterisk-1.2.x
make clean
./configure; make menuselect
At menu press "x"

make; make install
mkdir /var/run/asterisk
mkdir /var/lib/asterisk/sounds
mkdir /var/lib/asterisk/sounds/custom
cp -rv /usr/src/sounds/* /var/lib/asterisk/sounds

edit zaptel.conf for “fxsks=1-8” for 8 fxo channels (fxs channels for fxo ports and visa versa)
nano /etc/zaptel.conf

loadzone = us
defaultzone = us
fxsks = 1-8

(Ctrl-X>y>ENTER)

Those are the ONLY lines required in zaptel.conf.  Everything else should be commented out (“;”) or deleted.
Create a zapata.conf file in /etc/asterisk with the following for 8 fxo ports

nano /etc/asterisk/zapata.conf

;# Flash Operator Panel will parse this file for zap trunk buttons
;# AMPLABEL will be used for the display labels on the buttons
;# %c Zap Channel number
;# %n Line number
;# %N Line number, but restart counter
;# Example:
;# ;AMPLABEL:Channel %c - Button %n
;# For Zap/* buttons use the following
;# (where x=number of buttons to dislpay)
;# ;AMPWILDCARDLABEL(x):MyLabel

[channels]
language=en
;include zap extensions defined in AMP
#include zapata_additional.conf
AMPLABEL:Channel %c - Button %n
context = from-pstn
switchtype = national
usecallerid = yes
callerid=asreceived
echocancel = yes
echocancelwhenbridged = yes
        

;add the is option if you are problems with DTMF detection
relaxdtmf = yes 

rxgain = 12.0
txgain = -3.0

;The following is for fxo ports only
signalling = fxs_ks
group = 0
channel => 1-8

(Ctrl-X>y>ENTER)

Those are the ONLY lines required in zapata.conf.  Everything else should be commented out (“;”) or deleted.
If you have, for example, 2 FXS ports and 2 FXO ports then change "context=from-pstn" to "context=default" and add the following to zapata.conf after the gain.

context=from-zaptel
group=0
signalling = fxs_ks
channel => 1-2

context=from-internal
group=1
signalling = fxo_ks
channel => 3-4
callerid=asreceived

/usr/sbin/wancfg zaptel

If autoconfig does not work just go through menus

Create new wanpipe1.conf file
Detect card
Enable TDM Voice, Hardware Echo, SPAN 1
Save