Asterisk is a popular Open Source IP-PBX which until now has been available mainly on x86 platforms. Typically an Asterisk system consists of the Asterisk software plus some PCI line interface hardware.
In this two part series we describe the design an embedded Asterisk PBX using the Analog Devices Blackfin processor and Silicon Labs line interface hardware. This approach has many advantages over the PC & PCI card approach including small form factor, low power consumption, and very
low cost. However it also has some challenges, for example small memory and CPU resources, and a relatively complex development environment.
In this article we examine the hardware design of traditional x86 based IP-PBX systems and introduce the Blackfin processor. We then explore the design of an Embedded IP-PBX using the Blackfin, and
examine its pros and cons.
IP-PBX Architecture 101
To understand the challenges in building an embedded IP-PBX we first need
to take a look at a typical PC-based x86 Asterisk PBX.
Figure 1: Block diagram of a typical PC based Asterisk PBX.
In this case the PC has PCI line interface cards that provides analog line interfacing. There are two types of line interface shown:
FXO which provide a connection to telephone lines and the exchange.
FXS which provide a connection to analog telephone handsets.
If you have trouble remembering this jargon, here is a trick I use:
The O in FXO stands for Central Office (the exchange).
The S in FXS stands for Station (i.e. a telephone).
In practice of course you may have several FXO and FXS interfaces, one FXO port for each outgoing telephone line and one FXS port for each analog telephone in your office.
Lets see what happens when we make a phone call using the analog phone. The FXS line interface provides the electrical interface to the PCI card. DSP hardware and software is used to remove echo and
detect DTMF digits and tones. The speech signal then enters the Host PC via a PCI bridge and device driver software. The Asterisk application can then switch the call depending on the number we dial.
For a regular local call Asterisk may switch the call back out of the FXO Line interface, routing it to the public phone network. In this case the path of the signal flows back through the PCI card.
OK, so what about VOIP calls? Well lets say we use the same analog phone to make the call, but this time dial long distance. In this case Asterisk is programmed to route the call over the Internet. So the speech samples flow out of the Ethernet interface and from there
onto the public Internet. Notice how we can mix traditional telephony (e.g. the analog line interfaces) and IP-telephony.
It is also possible to make and receive calls from the IP handset either via the Internet or the analog line interfaces. An IP handset looks like a regular phone but has an RJ45 Ethernet interface rather
than an analog interface. It uses your LAN rather than analog lines to connect to the IP-PBX.
The PC based IP-PBX configuration works pretty well. The PC is a nice development platform, with a lot of storage and processing horsepower. However it does have some disadvantages:
PCs are large, noisy and power hungry. While a PC for a PBX might be OK if you are a medium size company, for a small company or SOHO do
you really want another PC humming away and chewing 200W night and day just to serve 1 or 2 phone lines?
Cost. A PC is a general purpose computing device: to turn it into a PBX means we need to add redundant hardware. For example we need a PCI bridge to interface with the CPU. It would be cheaper and
easier to simply put the line interface hardware on the motherboard - directly connected to the CPU. Pentiums are expensive and power hungry - for most PBX functionality (e.g. switching phone calls) a
micro controller would be fine.
Reliability. A PC has moving parts (several fans and a hard drive) and is therefore less reliable than a fully solid state device. The high power consumption means you need a UPS to maintain the PBX
during power outages.
Enter the Blackfin DSP/RISC Micro controller
There are two sorts of CPU operations in an IP-PBX. The first is relatively slow switching of calls. For example the logic required to look at the phone number you just dialled and route a call over a certain interface. This doesn't require much CPU power, as the events driving the switching are generated by humans (e.g. lift handset, dial 1, pause, dial 800, pause....).