!!! DRAFT !!!
Step by step guide to install BN4S0 on TrixBox 2.2 and 2.4
last update : 06/01/2008 - 21h45 GMT+1
Any comments are welcome : thomas.lavigne@xpandit.be

Installing BN4S0

Thanks to Hans M. please find here a step-by-step guide for installing BN420 on Trixbox 2.4
Goal
Command
Result
Install TrixBox 2.4
Just put the CD and follow the instructions
Asterisk Ready
get the kernel sources
edit /etc/yum.repos.d/CentOS-Base.repo
and comment out lines with
exclude=kernel*

Get Asterisk sources
yum install asterisk-devel

Get rid of hisax drivers
edit /etc/modprobe.de/blacklist and add at the end:
hisax
hisax_fcpcipnp
hisax_isac
crc_ccitt
isdn
slhc
capi
capifs
kernelcapi
kernel_capi
avmfritz
hfc4s8s_l1

get misdn + misdnUser
cd /usr/src
wget "http://www.misdn.org/downloads/releases/mISDN-1_1_7.tar.gz"
wget "http://www.misdn.org/downloads/releases/mISDNuser-1_1_7.tar.gz"

Extract and install
cd mISDN-1_1_7
make install
cd ../mISDNuser-1_1_7
make install

Continue the guide below at the step "misdn-init-scan"


Goal
Command
Result
Install TrixBox 2.2
Just put the CD and follow the instructions
Asterisk Ready
First make a complete update
yum -y update
Complete!
Reboot your computer
reboot
The system is going down for reboot NOW!
Check if you use an SMP kernel
uname -r | grep -q smp && echo "--smp--" --smp-- (if you have and SMP kernel otherwise nothing)
Install the DEVEL kernel
yum install kernel-smp-devel -y
or
yum install kernel-devel -y
Complete!
Go to the /usr/src/ folder
cd /usr/src/ [root@asterisk1 src]#
Get the last misdn installer
wget http://www.beronet.com/downloads/install-misdn-mqueue.tar.gz
Extract the dowloaded file
tar -zxvf install-misdn-mqueue.tar.gz install-misdn-mqueue/
install-misdn-mqueue/Makefile
install-misdn-mqueue/README
Go to the folder where the extracted files are
cd install-misdn-mqueue.tar.gz
[root@asterisk1 install-misdn-mqueue]#
Launch the install script
make install
INSTALLATION SUCCEEDED
make[1]: Leaving directory `/usr/src/install-misdn-mqueue/app_bundle'

Launch the Scan script from Beronet
misdn-init scan

Unknown line at line 5959
Unknown line at line 5960
Unknown line at line 5961
Unknown line at line 5962
Unknown line at line 5963
Unknown line at line 5964
Unknown line at line 5965
Unknown line at line 5966
Unknown line at line 5967
Unknown line at line 5968
Unknown line at line 5969
Unknown line at line 5970
[OK] found the following devices:
card=1,0x4
[ii] run "/usr/sbin/misdn-init config" to store this information to /etc/misdn-init.conf

Save the information with
misdn-init config

Unknown line at line 5959
Unknown line at line 5960
Unknown line at line 5961
Unknown line at line 5962
Unknown line at line 5963
Unknown line at line 5964
Unknown line at line 5965
Unknown line at line 5966
Unknown line at line 5967
Unknown line at line 5968
Unknown line at line 5969
Unknown line at line 5970
[OK] /etc/misdn-init.conf created. It's now safe to run "/usr/sbin/misdn-init start"
[ii] make your ports (1-4) available in asterisk by editing "/etc/asterisk/misdn.conf"

Backup the sample config file from Asterisk
mv /etc/asterisk/misdn.conf misdn.old

Copy the content of the sample file from Beront into a new misdn.conf
don't know how to achieve this on a linux. I made a copy paste from Windows with putty.
-copy the content of the file
- type "nano /etc/asterisk/misdn.conf"
- paste the content from the cell here bellow
- save the file by pressing "Ctrl+X" , Y , "ENTER"

Adapt the config file to your need, in this case the goal is to have 4 port connected to for ISDN lines for incoming calls. Here is the file :
;
; DESCRIPTION: Configuration for Asterisk
; GENERATOR:   ScopServ-VoIP v1.2
; TIMESTAMP:   2007-08-14 15:59:32
;


[general]
misdn_init                     =  /etc/misdn-init.conf
debug                          =  0
bridging                       =  yes
stop_tone_after_first_digit    =  yes
append_digits2exten            =  yes
dynamic_crypt                  =  no
crypt_prefix                   =
crypt_keys                     =

[default]
language                       =  en

[belgacom]
ports                          =  1,2,3,4
context                        =  from-trunk
msns                           =  *
echocancel                     =  no
overlapdial                    =  no
senddtmf                       =  yes
far_alerting                   =  yes
te_choose_channel              =  no
dialplan                       =  0
localdialplan                  =  0
cpndialplan                    =  0
nationalprefix                 =  0
internationalprefix            =  00
rxgain                         =  0
txgain                         =  0

Give a frendly name to your card/trunk
change [belgacom] by something you like : [example]

Launch misdn
misdn-init start

Unknown line at line 5959
Unknown line at line 5960
Unknown line at line 5961
Unknown line at line 5962
Unknown line at line 5963
Unknown line at line 5964
Unknown line at line 5965
Unknown line at line 5966
Unknown line at line 5967
Unknown line at line 5968
Unknown line at line 5969
Unknown line at line 5970
-----------------------------------------
 Loading module(s) for your misdn-cards:
-----------------------------------------
/sbin/modprobe --ignore-install hfcmulti type=0x4 protocol=0x2,0x2,0x2,0x2 layermask=0xf,0xf,0xf,0xf poll=128 debug=0
/sbin/modprobe mISDN_dsp debug=0x0 options=0 poll=128 dtmfthreshold=100

don't know why, I just did it...
mISDN scan

I wonder what's the difference between misdn-init, mISDN and even misdn... (seem that the case has his importance)
mISDN config


mISDN start

test

Port  1: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> childcnt: 2
--------
Port  2: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> childcnt: 2
--------
Port  3: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> childcnt: 2
--------
Port  4: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> childcnt: 2
--------
mISDN_close: fid(3) isize(131072) inbuf(0x8ad9060) irp(0x8ad9060) iend(0x8ad9060)
go to the asterisk console
asterisk -r

load the driver in Asterisk ?
load chan_misdn.so
Exit the asterisk console
"ctrl+X"





Say to misdn to start on reboot
chkconfig --add misdn-init
Reboot your server
reboot

test (as readed elsewhere, the error ports not usable is a good thing, this means that Asterisk is using the  ports)
misdnportinfo Port  1: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> Layer 4 protocol 0x04000001 is detected, but not allowed for TE lib.
 -> childcnt: 2
 * Port NOT useable for PBX (maybe there is already a PBX running?)
--------
Port  2: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> Layer 4 protocol 0x04000001 is detected, but not allowed for TE lib.
 -> childcnt: 2
 * Port NOT useable for PBX (maybe there is already a PBX running?)
--------
Port  3: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> Layer 4 protocol 0x04000001 is detected, but not allowed for TE lib.
 -> childcnt: 2
 * Port NOT useable for PBX (maybe there is already a PBX running?)
--------
Port  4: TE-mode BRI S/T interface line (for phone lines)
 -> Protocol: DSS1 (Euro ISDN)
 -> Layer 4 protocol 0x04000001 is detected, but not allowed for TE lib.
 -> childcnt: 2
 * Port NOT useable for PBX (maybe there is already a PBX running?)
--------
mISDN_close: fid(3) isize(131072) inbuf(0x8360060) irp(0x8360060) iend(0x8360060)
Go to FreePBX setting and create a new custom trunk


Under "Outgoing settings" fill-in the field "custom Dial String" with this
mISDN/g:belgacom/$OUTNUM$
Save and apply


You should be able to recieve call.
To make outgoing call, you need to setup a route and manage dial prefix






Replace sendmail with postfix (if anything could be so easy to install most of IT guys will be jobless)
Goal
Command

Result
Stop sendmail
service sendmail stop Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
Uninstall sendmail
rpm -e --nodeps sendmail
Install postfix
yum -y install postfix Installed: postfix.i386 2:2.2.10-1.1.el4
Complete!
Start postfix
service postfix start Starting postfix:                                          [  OK  ]
Edit the config file
nano /etc/postfix/main.cf
Modify the line relayhost
relayhost = your.isp.mailserver.goes.here

Exit and save
"ctrl-X" , Y , "ENTER"

Restart Postfix
service postfix reload
Reloading postfix:                                         [  OK  ]
Tests are ok