Asterisk for call recording and/or forwarding

We have a Nortel BCM50b pbx with two ISDN BRI (ISDN2) trunks and 5 voip phones. We would like to record all calls made on the system. One option seems to be to use a sniffing type device, like an Eyesdn S0 usb card tapping directly on the trunks, and record all calls there onto a Windows pc.

Is there anyway that an Asterisk box with an ISDN BRI interface card could either:

  1. Plug Asterisk into the terminator on the wall coming from the telco (before the Nortel box) into the mirrored ISDN port and listen and record all calls going on the line - passively? (preferred) or …

  2. Have the ISDN lines going into the Asterisk box, record them with MixMonitor (or ZapBarge) and forward them (as transparently as possible) in the same time back through (different ports on) the BRI card to the Nortel PBX?

  3. Am I better off attempting to place the Asterisk box between the pbx and the handsets, and forward/record all calls there?

Whichever method used, it is necessary that it be capable of splitting recordings into distinct conversations/calls, and some form of automatic naming of files based on time of call and either external dialled/calling numbers, or internal extension numbers initiating/receiving the calls (depending on where in the system it will sit and what information it will have available).

I am rather new to Asterisk so I appologise if by chance this has been dealt with before or somehow I’m misssing something and it is a plain dumb question. I’ve been searching high and low for few days now on Google, and although I’ve gleaned some promising bits of information, nothing seems to be coming together. Any input is appreciated.

I know the Nortel box could be replaced with an Asterisk box altogether, but at this moment in time I would prefer the least intrusive method for recording the calls - with the least amount of changes to the current system.

Many thanks,


Any ideas on this one? Otherwise, is this the wrong place to post the question?

You can put Asterisk in the middle and just pass calls through it but record the channel, I think the default does name them by date and time…I am not sure though I would get this book,
and check
it seems that there is a bunch of good info there…

Thanks riddlebox. I’ve seen both links.

The question is - can Asterisk just ‘listen in’ on the mirror port of the ISDN terminator and record calls, without sitting in between the trunks and the PBX, or does it have to sit in between and do call forwarding in order to monitor/record calls?

Also, if it has to sit in between - I assume there is a way of configuring a BRI card with 4 channels so that two of them are incoming (from the trunks) and 2 of them are outgoing - to the PBX - all of them using ISDN signalling?

I don’t think you’ve sufficiently explained the way calls are routed in your particular environment.

It sounds like you want an “appliance” that “just does recording”. Perhaps whoever sold your handsets, aka the vendor of your phones already provides such a thing.

Call recording is very trivial if you’re already using asterisk as your PBX, but it sounds like that’s not your situation.

Call recording in asterisk can be done at a few different levels:

  • per zaptel channel
  • if using MeetMe() for conferencing, you can record the whole room
  • using MixMonitor() on extensions

I’m not sure you’re going to have much luck with Asterisk until you try running some calls through, give things a try, and then you’ll be able to better understand the different ways you might achieve your goal.

Your general question seems to be “can I use Asterisk to just tap all the calls, but not actually use Asterisk like a PBX?”. The answer is Asterisk wasn’t built that way, but you might be able to hack it like that.


You seem to have gotten spot on what I want out of it. Yes, Asterisk for call recording, but not for PBX (for the moment being).

In the meanwhile I discovered that the internal phones are on analog actually. So Nortel BCM50 PBX on two BRI/ISDN2 trunk lines - and 5 internal analog extensions. So it looks like I can only tap on the ISDN trunks.

BT (British Telecom - our telco supplier) does offer those Eyesdn usb cards - which efectively plug into the mirror ports on the ISDN terminals and tap/record all calls into a Windows PC.

I was just exploring to see if I could do the tapping/recording of calls using Asterisk - so that maybe I could migrate the whole PBX functionality onto Asterisk in the future.

At this moment in time my main question lies with the ability to route BRI calls through Asterisk - namely if one of those BRI hardware cards with 4 channels could receive 2 ISDN lines on two channels, and forward them (after some processing/recording/forwarding in Asterisk) to the Nortel box using the remaining two ports on the card?

It’s just that I don’t mind experimenting with an Asterisk machine, but I would rather like to know if such a hardware setup is feasible, before investing in a somewhat costly (if it ends up used for experimentation only) BRI card.

I think I understand what you’re trying to do now. For the parts of your system that run through BRIs, I assume those are similar to what the Americans call PRIs, where something like a Digium 4-port T card could handle the physical connection.

We do call recording on Digium 4-port T cards, but it’s very easy to identify exactly when a call begins, on which circuit, starting when, with which employee, because we’re using all the nifty PBX features. This lets us set and use Asterisk system variables, making descriptive file and path names, aka:


We’re using MixMonitor() directly on the Zaptel channel of the connected caller to do our recording. I really don’t think the approach we use for our call recording could work with your system without dramatic changes to the Asterisk code. Sorry for the bad news :smile:

While a 4-port digium card costs about $1200 US (depending on where you shop), that might be dramatically cheaper than whatever the other system costs; I have no idea of what expensive means to your budget. Our long distance is about $0.017 US per minute and we run a call center, so the card costs nothing relative to the volume of calls we run through our system. The card is also cheap compared to what our proprietary cards cost for our Intertel phone system (which we’re weaning ourselves off slowly). The best I can think up is you would dedicate two digium (or other brand) BRI ports to each physical line you wanted to tap, and you would set up pass-through circuits for each line you wanted to tap.

This is just an opinion, because I’m not certain I understand how your calls route, etc.

Regarding the pass-through style circuits, we do something like that, but again, we’re more at the level of a PBX, so we listen for a dial on one card, and connect that to the other side of the call, which does happen to be on a different card (or port if that is easier to think about).

Yes, not only can you can configure ports to have different behaviours, but you can address each individual circuit on a BRI. American PRIs sometimes have 23 or 24 channels. I can set each one individually to map to various inbound / outbound tasks, and address the circuits by a sensible name, like Zap/port-circuit number.

My system doesn’t do quite what you’re asking. While thinking about your question of “whether this is the right place to ask your question”, I would confine your question to just the part about how to set up the BRIs to pass-through, and try asking about that on the asterisk-users mailing list.

Thanks again for your helpful hints.

BRI (or ISDN 2 as it is sometimes called in Europe, I believe) is another type of ISDN like PRI is - only it has two channels instead of 30 - as PRI I believe has. Also it seems to be handled by different libraries in Asterisk - so although there should be some similarities - I expect there might be some differences in functionality as well.

And yes - the BRI Digium (or compatible) cards do come in 4 port flavours - apparently similar to PRI cards to a certain point.

As to costs: the EyeSDN system (2 channel per card) - full name EyeSDN USB-S0 - apparently manufactured by a company in Germany ( was quoted at close to £1400 (which would equate roughly to $2800) for two cards by BT (our telco). I have found OpenVox BRI 4 channel cards for close to £300 (about $600). Both solutions require a spare PC (either with Windows or Linux for Asterisk) - so not much cost difference in that respect.

Thus the Asterisk solution would prove more cost effective - but that is not my main reason for preferring it - is more like the USB EyeSDN seems quite a specialised application - while I can think of a 101 possible future configurations and uses for a PC with Linux, Asterisk and a BRI card.

As regarding my previous mention of costs - what I actually meant to say is that I am reluctant to invest in a BRI card before I know fairly sure that it can do what I want it to do one way or another. If it will not end up being used - then I might find it a bit of an expensive option. That is why I am trying to gather sufficient information in order to decide if this is a feasible option at all - then I can buy it and test things until I get them working.

The way I was thinking for working things out is: detect incoming call on ISDN trunk (BRI line coming from Telco to Asterisk box), start recording and then bridge it (without answering, if it is possible) to BRI line coming out of Asterisk box and going to the Nortel PBX. Which will then take care of forwarding it to extensions etc. I would need to know if there is software support for such functionality in Asterisk. I have read again and again the docs - I am just not sure that things work the way I would need them to work. Possibly using Bridge() and MixMonitor() functions. Or maybe Dial() with the M() option to execute a macro (which starts MixMonitor) when the call is answered.

I am not sure if I understand the docs correctly.

Assuming that Zap/line1 is my incoming BRI channel from telco into Asterisk box, and Zap/line2 is my channel connecting the Asterisk box to the Nortel BCM50, and that [incoming] is my default context for Zap/line1 - will:

exten => s,1,Dial(Zap/line2,60,M(start_recording))

exten = s,1,MixMonitor(|b)

ring the Nortel PBX as soon as I have an incoming call on Zap/line1, and bridge the incoming call when the Nortel box is answering and start recording of channel, all without Asterisk answering itself? - so it handles the call almost transparently - without the calling party realising that Asterisk sits between the telco and Nortel box, and has detected and processed the call? Is my understanding correct?

It looks like somebody wanted to do something that aligns with your needs, and they did actually modify the Asterisk source code to accomplish their goals. Check out:

Upfront it mentions that it’s based on something they called a manager bridge. I’m not familiar with what that is.

This seems to be the closest I’ve found to what you’re looking for. Best wishes, and post what you end up doing if you go the asterisk route.

Thanks dbackeberg. I have looked at the thread about manager bridge and I’m trying to understand as much as I can of the whole thing :smile: It seems like developer talk during the early stages of implementing of the bridge feature - so couldn’t make out quite everything of what was going on :smile:

As a side note - in the Asterisk Wiki there is one app called Bridge(), but I noticed it doesn’t have any help/text attached. Maybe it is the same feature?

After a bit of searching I stumbled over this page explaining what the Asterisk Manager Interface (AMI) is about:

It seems to be an interface whereby Asterisk can be sent command remotely from various applications written in PHP or other programming languages. Thus the manager bridge app starts to make sense - send a command to asterisk from a third party software to bridge two channels. Probably not directly connected with what I’m trying to do.

It is interesting that there isn’t much interest in this thread. Maybe I am trying to do something which is not usually used or needed in telephony setups.

Anyway, I have setup an Asterisk box with zap and sip channels for the moment being and I will try several ideas to see if I can find something that looks hopeful. Will let you know where it all goes. Thanks again for your input.

Just an update. I have finally found a post from somebody who seems to be trying to achieve exactly the same thing as me (only that they are using PRI instead of BRI ISDN - but I don’t think that makes enough of a difference). Basically, the suggested solution is (quoted from post):

"I’m assuming the call comes in through one PRI line (Zap group 1), and then goes out again via another PRI line (Zap group 2) into some other device.

exten => _X.,1,MixMonitor(${UNIQUEID}.gsm))
exten => _X.,2,Dial(Zap/g2/${EXTEN})

exten => _X.,1,MixMonitor(${UNIQUEID}.gsm)
exten => _X.,2,Dial(Zap/g1/${EXTEN})

make sure to set Zap group 1 to the “incoming” context and set zap group 2 to the “outgoing” context


And here is the link where I found it: … 21215.html

I’ve chosen to copy the relevant text here - just in case the link becomes unavailable at some point in time in the future.

So it looks like it is possible to just “patch through” the ISDN calls through Asterisk, and use MixMonitor and Dial withouth actually answering the call. I am most encouraged now. It is true that the original poster doesn’t seem to report if it worked for him/her, but it looks right to me. I am going to proceed with tests now.

First thing that comes to mind is that I will have to play with the ‘b’ option for MixMonitor - to see if I can get it to start and stop recording (to different files) everytime a new call passes through. I don’t know if it is possible to use the ‘b’ switch when MixMonitor is invoked before the call is actually answered. Will find out.

Hope this might help somebody one day. Will try and post results.

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 and mISDN - 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 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 In case anybody might want to know - the guys at 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 :smile: (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:



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()

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: 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.