Just a follow-up on my previous posts with results, as promised.
Well, the Asterisk box is installed and running - and it does indeed patch through and record calls coming and going on the ISDN lines.
I will describe my setup and what configs and hardware I’ve used, in case it might come in handy to someone else one day - as I personally couldn’t find much information on the Internet regarding this particular use of Asterisk.
Just to recap, the goal was to place an Asterisk box between the ISDN trunks and the Nortel BCM-50 PABX - in order to monitor/record calls and call detail information - without disturbing in anyway the current setup/config of the Nortel box. Yes, Asterisk can provide everything that the Nortel box does and more - but the current pbx was already installed by somebody else and does everything that the users want - so just didn’t want to take something perfectly functional out and have to re-do all the voice prompts etc. in Asterisk.
We use BRI ISDN - which is sold here in UK by BT as ISDN2e (don’t know if this is the only flavour of BRI ISDN available here though).
I’ve used Asterisk 1.4.20.1 and mISDN 1.7.7.2 - in case anybody wants to know. There has been quite a lot of trouble because the motherboard used (Intel DQ35JO) has the Intel PCI Express 1000mbs network card - which is only supported starting with kernel 2.6.24 - while mISDN 1.7.7.2 will only compile against kernel 2.6.23 the latest. So it was a choice between using ISDN or my network card. In the end, after plenty of research and futile attempts, I’ve managed to find a patch which would provide the e1000e driver (intel nic pci-e 1000mbs) on the 2.6.23 kernel.
On the hardware front, I’ve used the Openvox B400P PCI BRI ISDN card from voipon.co.uk. In case anybody might want to know - the guys at voipon.co.uk seem to have a well organised site - and their phone support was quite good. I also had to contact the people from OpenVox - and although they seem to just recommend using CentOS or Fedore Core as answer to any of my problems
(I use Slackware) - at least they seemed to be prompt in answering the emails. The card seems to work fine so far - but it has just been installed - so I couldn’t provide an estimate of long term reliability.
As to mISDN configuration, I’ve used TE and PTMP for the lines coming from the trunk, and NT and PTMP for lines going from Asterisk to the PABX (Nortel). I could actually use PTP with one main difference - in the dialplan I would have had to use dialing by line number, not by group for ISDN, like so:
exten => _X.,n,Dial(misdn/1/1345)
I could dial by ISDN group, like this:
exten => _X.,n,Dial(misdn/g:from-trunk/1234)
only when using ptmp. Aside from this, it would have worked in both modes.
Another problem that I’ve had and took quite long to solve was recording with MixMonitor. MixMonitor would end up creating recordings at a higher than normal speed and high pitch (like people would have been on Helium), plus a constant electronic type background noise/interference. I just could not get to the bottom of what was causing it. This would happen when using both wav and gsm formats. In the end I’ve resorted to the old Monitor command, with the ‘m’ switch, with wonderful results. I guess Monitor uses actually different routines/code for recording. You will notice in the config files below that I’ve added some code for organising recording files automatically by date and in separate ‘incoming’ and ‘outgoing’ folders.
Here is my extensions.conf file:
[general]
static=yes
writeprotect=yes
autofallthrough=yes
[globals]
[from-pstn]
exten => _X.,1,Set(REC_DIR_IN=/shares/phone_calls/${STRFTIME(${EPOCH},%Y-%m-%d)}/incoming)
exten => _X.,n,Set(REC_FILE_IN=${STRFTIME(${EPOCH}, ,%Y-%m-%d %H %M %S)} - ${EXTEN})
exten => _X.,n,System(mkdir -p ${REC_DIR_IN})
exten => _X.,n,Monitor(gsm,${REC_DIR_IN}/${REC_FILE_IN},mb)
exten => _X.,n,Dial(mISDN/g:pabx/${EXTEN},30)
exten => _X.,n,HangUp()
[from-nortel]
exten => _X.,1,Set(REC_DIR_OUT=/shares/phone_calls/${STRFTIME(${EPOCH},%Y-%m-%d)}/outgoing)
exten => _X.,n,Set(REC_FILE_OUT=${STRFTIME(${EPOCH}, ,%Y-%m-%d %H %M %S)} - ${EXTEN})
exten => _X.,n,System(mkdir -p ${REC_DIR_OUT})
exten => _X.,n,Monitor(gsm,${REC_DIR_OUT}/${REC_FILE_OUT},mb)
exten => _X.,n,Dial(misdn/g:trunks/${EXTEN},30)
exten => _X.,n,HangUp()
And this is the mISDN.conf contents (the one which goes in /etc):
<?xml version="1.0"?>
hfcmulti
mISDN_dsp
mISDN
1
2
3
4
I won’t include the misdn.conf which goes into /etc/asterisk as I’ve only followed the stepts included here: trixbox.org/forums/trixbox-forums/help/b410p and setup two different groups at the bottom for port 1,2 and 3,4.
All in all - I’m very pleased with the final result - and I’m pleased that Asterisk can serve as a patch-through box. When an external call comes through - Asterisk forwards it to the Nortel box without answering it, and starts recording as soon as the call is bridged. Similarly, when extensions want to dial out, they get imediately a dial-tone - and nobody is really aware that Asterisk sits in between and does its job.
Thanks to all who contributed with pointers and suggestions to my initial question.