Combine uClinux and Asterisk on a Card

This article describes how to build an embedded Asterisk IP-PBX with four analog (FXO or FXS) ports. Total
parts cost is about $500 US, which is competitive with PC/PCI-card based Asterisk solutions. Embedded solutions
have the advantage of small size, low power and no moving parts. Figure 1 is a photo of the PBX hardware in
action.

Figure 1. Digi-Key Blackfin STAMP Development Card

The PBX is built around a Blackfin STAMP development card, available off the shelf from Digi-Key for around
$225 US. The Blackfin is a powerful DSP chip that runs uClinux. Sitting on top of the Blackfin STAMP card is a
daughterboard, which contains interface hardware and the SD card socket. Into the daughterboard plugs FXO or FXS
modules, one for each port. In this example, there are two FXS modules on the left and two FXO modules on the
right. The color of each LED indicates the type of module inserted.

Here's a brief review of telephony jargon:

FXO ports connect to telephone lines and the exchange.

FXS ports connect to analog telephone handsets.

Figure 2 is a block diagram of the PBX hardware and software components. SIP phones or analog phones can be
used for handsets (extensions), which are connected via a LAN to the IP PBX. External calls can be routed over the
Internet or through the analog FXO ports. Internal calls between IP phones are routed over the LAN.

Figure 2. Sample PBX Configuration

The PBX supports most of the features of Asterisk running on an x86 PC. As there is no hard disk, an SD card
is used for voice-mail storage.

Why Port Asterisk to uClinux/Blackfin?

I have a history of developing computer telephony hardware and have always wanted to build a small embedded
box that combines a host processor, DSP, line interface hardware and software. It's an itch I've needed to
scratch!

There are some very cool things about the Blackfin processor chip:

The problem with most embedded processors is that they are not very powerful. The Blackfin is a powerful
host processor
and a DSP—that is, it can run uClinux, Asterisk and codecs like G729 on the same
processor at the same time. A standard 500MHz Blackfin runs at around 1,000 DSP-MIPs, which is plenty for
codecs, echo cancellation and so forth.

A lot of effort and hardware cost is usually required to interface telephony hardware to the host
processor (typically a PC), such as PCI bridge chips. The Blackfin makes it easy, as it has a lot of nice
interfaces built in, such as serial ports, SPI and DMA controllers, which are all tightly integrated with the
core processor.

The Blackfin chips are good value for the money, ranging from $4.95 US each (BF531 in 10k volume), which
makes low-cost embedded telephony hardware a real possibility. This makes it possible to build an IP PBX
including analog or E1/T1 line interfaces for far less than comparable PC-PCI card solutions.

Best of all there is an Open Source community that has developed GPL hardware (the family of STAMP
boards).

Open-Source Hardware

The hardware designs for this project are open—the schematics and PCB layouts are freely available for
anyone to download, copy and modify.

The hardware designs have been released under the GPL. Although there is some debate over how defensible the
GPL is when applied to hardware, the key ideas are similar to open-source software—the hardware designs are
free as in speech, and a community exists that is working together on extending and enhancing the designs.
Intellectual Property (IP) is shared for the mutual benefit of all.

The community is loosely organised under the Free Telephony Project, and it consists of private hackers,
researchers and several companies who are donating time and other resources to the project. A series of hardware
designs are being developed, for example, analog and ISDN interface hardware, and DSP motherboard designs.
Significant software development work is also occurring, for example, open echo cancellation software and drivers
for the hardware.

The outputs of the project are high-quality, professionally designed telephony hardware, freely available for
all. Hardware development is a little different from software—hardware design/test cycles are much longer
(for example, a bug might mean a new board needs to be manufactured), and of course, it costs money to make a
“copy” of a hardware design. However, the benefits of open hardware are similar to open
software:

Peer review is a wonderful way to trap bugs early, leading to big savings in development time.

Re-use of open designs enables innovative products to be developed quickly and with a very small number
of bugs.

Discussion and contributions from people all over the world lead to a much higher-quality product than a
product developed by one company in its own lab.

Using open hardware, an individual or small company can build sophisticated telephony products without
needing large company resources.

The part I like best—you get to work with a community of talented hardware and software people!
Some of the best and brightest minds out there seem to migrate naturally to open projects.

Business models are being developed that function within the open-hardware environment. For example, one
company sponsoring our efforts has a service model based around low-cost telephony hardware—maintaining
ownership of the hardware IP is not a critical part of its business plan.

Open hardware is also great for small, localised businesses and allows developing countries to build their
own products locally—overcoming tariff barriers and building a local high-technology industry.

Comment viewing options

I didn't think asterisk supported the dsp functions/instructions of blackfin. Which means using blackfin dsp does not help may infact be less efficent as most of the asterisk codec code is geared towards x86 systems.

I have been looking everywhere for information on putting together an embedded telephony card to use to build an adjunct telephone box. Although the Asterisk section is overkill for me, I need the FXS/FXO piece, and to be able to do pass-through.

I'll check into the resources you posted as well. Thanks for being so complete -