|
|
The IP04 is a 4 port IP-PBX that runs Asterisk and uClinux on a
powerful embedded Blackfin processor. To build an Asterisk IP-PBX you
normally need a x86 PC plus a PCI card for the analog ports. With the
IP04 you get all of that functionality in a tiny, low cost, low power,
silent box. Assembled and tested IP04s are available for around $450
from the Free Telephony Project Store.
Unlike many other embedded processors, the Blackfin has enough DSP
horsepower to handle multiple channels of echo cancellation and speech
compression. This means that the IP04 is a complete IP-PBX with 4
analog ports. No PC required!
The 4 analog ports can be configured any way you like, using single
port FXS/FXO modules. The IP04 auto-detects the module type when it
powers up and helpful LEDs indicate what flavour (FXS or FXO) each
port is.
Using the IP04 is similar to any other Asterisk box. You can telnet
in, modify config files, or even use the new Asterisk GUI. Setting up
the IP04 is easier than a x86 PC based Asterisk system: you don't need
to install Asterisk, or even Linux. The IP04 comes pre-loaded with
Asterisk and uClinux. Plug it in and in a few seconds you can make
calls. With the IP04 you get dial tone out of the box!
The IP04 is derived from the 4fx and
BlackfinOne V2. You can
read all about the development of the IP04 on my Building an Embedded
Asterisk PBX series of blog posts. Part 3 and
Part 4 deal with the IP04. Part 1
and Part 2 discuss the development of FXS/FXO
hardware.
IP04 Versions
There are several versions of the IP04:
-
The Prototype IP04 (picture at top of page), which was the original
IP04 design. The design files for this version (PCB, schematic, CPLD
source etc) are available from the SVN repository below. This is an
IP04 that you can assemble yourself, some parts are available from the
Store.
-
The Atcom Production IP04, which has a different PCB layout (but
very similar schematic) to the prototype IP04. This is the IP04 that
Atcom and I are selling in fully assembled and tested form. The
schematic and CPLD (but not PCB) files are available from IP04 SVN.
You can buy an Atcom IP04 from the Free Telephony Project
Store.
-
Due to the wonders of open hardware the IP04 also has an ever
growing number of children.
Distribution
You can buy IP04s directly from the Free Telephony
Store. By purchasing from this store you directly support the Free
Telephony Project.
The production IP04s are being manufactured by the good people at
Atcom. If you would like to distribute the IP04
in your country, please contact Edwin Chen,
Technical Sales Manager at Atcom.
For Australian distribution and sales please contact
David Rowe.
Prototype IP04 Specifications
(Please note, specs for the production IP04 are a little different)
-
2 layer PCB measuring 200mm by 100mm
-
BF532 400MHz
-
64M SD-RAM running at 133MHz
-
256M NAND Flash for Asterisk Application, prompt and voicemail
storage
-
0-4 FXS/FXO modules (fxsmod and fxomod designs)
-
Optional stackable with 4fx cards to get 8 or even 12 analog ports
-
Optional MMC card for removable flash storage
-
High Performance echo cancellation using Oslec
(Open source line echo canceller)
-
Astfin Blackfin uClinux-Asterisk 1.4 software build
-
Current consumption (2 FXS 2 FXO configuration) around 300mA @
15VDC (4.5W).
Status
-
The production IP04 was released in Mid 2007. Since then thousands
of IP04s have been built and are in use all around the world. The
hardware is very stable.
-
The basic software load (uClinux, Asterisk & Zaptel) has proven to
be very stable. A stable GUI has been slow to emerge but the recently
released Asterisk Now 2.0 GUI is
getting good reports. Many software packages
have been ported to the IP04.
-
The IP04 has been carefully tested. A series of automated stability
and load tests have been performed, for example (i) 4 analog and 2 IAX
calls for 4 days, about 32,000 calls and (ii) maximum anticipated load
of 4 analog ports, 8 simultaneous calls (4 SIP-analog plus four
SIP-IAX2 VOIP, running 8 GSM codecs). For more information please see
the IP04 Test
Plan.
-
These tests are repeated with every new production batch to ensure
ongoing quality.
-
The IP08 has been released
however Atcom are still working on the dual FXS modules. The IP08 has
8 analog ports, dual Ethernet and USB, in the same form factor as the
IP04.
-
The IP01 has recently been
released. Cute but very powerful single port IP-PBX at a great price.
-
The production IP04 has been tested to meet the following
standards: FCC Part 68, FCC Part 15-B (USA); TBR-21, EN55022, EN60950
(Europe); S002, S003, CISPR 22, AS/NZS 60950.1:2003 (Australia).
Known Issues
-
MMC card support is still experimental and not enabled on the IP04s
shipped from the Free Telephony Project Store. However with 256 MByte
of internal flash this is not a practical problem for most applications.
See the getting started notes for more information.
-
On a small number of IP04s there have been reports of FXO ports
locking up after 1-14 days. In this state incoming calls and outgoing
calls are not possible, and the IP04 needs to be rebooted or the wcfxs
driver unloaded and loaded. We are investigating this bug. The work
around is a cron job to unload/load the wcfxs module every day (see
forum for scripts). The vast majority of IP04 installations do not
experience this problem, which seems to be site related, perhaps due
to noisey power or phone line noise.
-
There have been a few popped FXS modules reported. This seems to be
linked with ringing multiple FXS ports simultaneously, and/or
non-standard power supplies.
Capabilities
Many people have asked "how many calls can the IP04 handle and what
codecs does it support?". The answer is "it depends" - for example
the type of call (VOIP/analog), codec etc. Analog calls use the most
MIPs due to the CPU load of echo canceller. IAX calls tend to use
more CPU than SIP as there is more packing and unpacking of data.
A-law and mulaw calls use less MIPs that GSM/g729.
Calls that use the IP04 to terminate or transcode RTP media (like
playing an IVR or IAX2) use more MIPs than calls that just use the
IP04 to handling call switching (e.g. a SIP extension to SIP extension
call where RTP passes directly between the phones).
-
The IP04 comes with ulaw/alaw/gsm/Speex codecs. All the usual
Asterisk codecs are supported with the exception of iLibc which
requires floating point (the Blackfin has no FPU). An optimised g729
library is available free from Analog Devices SVN, however there is at
present no licensing scheme.
-
The standard IP04 load test is 4 analog calls and 8 SIP calls
(running GSM codecs). This simulates full load of the IP04 in a
typical office environment of 4 outside FXO lines and 8 SIP phones.
-
Kelvin Chua has tested up to 72 ulaw calls with an IP04 using SIPp.
The IP04 was terminating RTP with an IVR prompt.
-
With Asterisk running SIP calls (and no analog hardware), 34 ulaw,
16 g729, and 8 Speex (16 kbit/s mode) calls were possible at a 2.0
loadav. Care was taken to ensure that all calls were full duplex
(when terminating a call with an IVR prompt the RTP traffic is usually
one way).
Resources
-
If you have any questions, bug reports, or suggested improvements,
please post to the
Blackfin Asterisk forum or the Free Telephony Project Mailing List.
-
IP04 SVN for
schematics, PCB design, BOM spreadsheet, test plan, errata and more.
-
For IP04 congifuration tips see the IP04 Howto below.
-
BAPS is the build system for the IP04/IP08 based on
the package paradigm (like apt-get or rpms). BAPS is being used for
the production IP04s and IP08 prototype and allows users to easily
upgrade software from the command line, avoiding the need to compile
an entire uImage.
-
The previous build system was
Astfin. Here
are
steps
used to get a bootable uImage containing uClinux and Asterisk for the
Blackfin using Astfin.
-
NAND Flash and u-boot
-
For low level boot loader and firmware set up see the
IP04
Wiki. Please note that the Linux uImage discussed on the wiki is a
very early version - pls use later BAPS or Astfin Linux uImage. The
low level u-boot instructions are still relevant.
-
NAND
Flash and uClinux
-
There are now quite a few Asterisk "Appliance" type products that
have been announced. Here is a
survey of Asterisk Appliance
products.
Credits
I stand on the shoulders of giants. Thanks to all the people who have
contributed and whose work I have built on. In no particular order:
the Astfin & BlackfinOne teams, uClinux,
Analog Devices Blackfin team, the
Asterisk community, and the guys at Atcom. Sorry if I forgot anybody.
IP04 HOWTO
These notes apply to the Production (Atcom) IP04s from the Free
Telephony Project Store. If your IP04 came directly
from Atcom or another manufacturer the configuration may be slightly
different.
Blackfin Asterisk Package System (BAPS) Mini-How To
BAPS is a package based system for Blackfin Asterisk, like apt-get or
rpm. It makes installing, updating and contributing software easy.
Here is a list of BAPS packages.
When each package is installed, documentation for the package is
installed in /usr/doc on your IP04. You can also browse the
BAPS Package
Documentation online.
Essential BAPS commands are:
root~> ipkg update
root~> ipkg list
root~> ipkg list_installed
root~> ipkg install PackageName
root~> ipkg remove PackageName
Many BAPS packages install documentation on the IP04 in /usr/doc.
Please see the BAPS page for more information
Help and Support with your IP04
If you have any questions, bug reports, or suggested improvements,
please post to the
Blackfin
Asterisk forum or the Free Telephony Project Mailing List, so the IP04 community can share the answers.
IP04 How To Notes
-
uClinux and Asterisk are pre-installed. Just apply power and in
about 90 seconds the IP04 should be ready for use. If you have FXS
modules installed, try connecting an analog phone to the ports until
you hear dial tone. Try dialling 2008 to hear a prompt or 2020 to
record and playback your own voice.
-
On the IP04 the Tel1-Tel4 LEDs on the front panel indicate what sort
of modules (FXS or FXO) you have installed. Red = FXO, Green = FXS.
For example the IP04 below has Tel1 & Tel2 set up as FXS and Tel3 and
Tel4 as FXO.
Please note that the IP01 TEL LED does not change colour - it is
green for both FXO and FXS modules.
-
The Tel1-Tel4 ports are configured as extensions 6001, 6002, 6003, 6004.
For example if you have Tel3 & Tel4 configured as FXS, dialling
6004 on Tel-3 will make Tel-4 ring.
-
When you boot the IP04, the default IP will be 192.168.1.30. You
can telnet to the IP04:
[david@bunny ~]$ telnet 192.168.1.30
Trying 192.168.1.30...
Connected to 192.168.1.30.
Escape character is '^]'.
BusyBox v1.4.1 (2007-06-01 01:29:28 CST) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:~> asterisk -r
Asterisk 1.4.2, Copyright (C) 1999 - 2006 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.4.2 currently running on af1 (pid = 71)
No entry for terminal type "dumb";
using dumb terminal settings.
af1*CLI>
|
In the default configuration no username or password is required
for telnet. You can add a username/password prompt by installing the login
ipkg. The default username/password is root/uClinux. |
-
To enable static IP (the default as shipped):
root~> /etc/init.d/network disable
root~> /etc/init.d/network-static enable
root~> reboot
-
To change the static IP settings edit /etc/init.d/network-static
-
To enable dhcp:
root~> /etc/init.d/network-static disable
root~> /etc/init.d/network enable
root~> reboot
-
rcp is the easiest way to transfer files to and from the IP04:
[david@bunny ~]$ rcp root@192.168.1.30:/etc/asterisk/extensions.conf .
-
The IP04 also has a built in ftp server, the username/password is
root/uClinux.
-
wget also works well (run from the IP04 command line).
-
All the usual Asterisk config files are present in /etc/asterisk,
edit using vi.
-
There is plenty of NAND flash (256 MBytes) to store any custom
prompts, programs or voicemail. Any changes to files are persistent,
it appears that using the yaffs file system you don't even need to
"shutdown" or "halt" when powering down - the changes are written to
flash straight away.
-
There is a small reset button next to the power connector. This
is a hardware reset, it does not reset software defaults (see below
for software defaults).
-
To use the RS232 console remove the top cover from the IP04 and
install the small RS232 daughter board on J8 as below. If present,
remove the small shorting link first (shorting link not required on
current IP04s). Use 115,000 baud, 8 data bits, no parity. Use a
direct RS232 cable, as the IP04 swaps the RS232 tx/rx lines. A
null-modem cable is not required. For RS232 work I use minicom on a
Linux host machine, here is my minicom
configuration file. When you are finished with the console be sure
to replace the shorting link, otherwise the IP04 will not boot.
-
The GUI is not installed by default. See the
GUI Installation instructions.
-
The IP04's currently shipping from the Free Telephony Project Store
don't support the MMC card. MMC card support requires a firmware
(CPLD and uImage) upgrade which is still experimental. Alex Tao has
written
instructions
for IP04 MMC support.
-
To change the root password, on a x86 Linux box:
perl -e 'print "crypt("yourpassword", "yoursalt")","\n"'
to generate the password and copy/paste in /etc/passwd on your IP04.
Thanks to Li for suggesting this in the Blackfin Asterisk Forum.
-
To restore the default Asterisk configuration files on your IP04
root:~> ipkg update
root:~> ipkg remove asterisk
root:~> ipkg install asterisk
root:~> reboot
-
Caller ID: You need asterisk-spandsp to pick up caller id. You can
check if asterisk-spandsp is installed using:
To install asterisk-spandsp:
$ /etc/init.d/asterisk stop
$ ipkg remove asterisk
$ ipkg install asterisk-spandsp
$ reboot
-
Asterisk CDR Records: You need to have a CDR backend like cdr-csv.so.
cdr-csv.so is installed as part of the asterisk ipkg. Use vi to add the
following line to the end of /etc/asterisk/cdr.conf:
Then create the file
/var/log/asterisk/cdr-csv/Master.csv and restart Asterisk:
$ mkdir -p /var/log/asterisk/cdr-csv
$ touch /var/log/asterisk/cdr-csv/Master.csv
$ /etc/init.d/asterisk stop
$ /etc/init.d/asterisk start
Make a few calls and check Master.csv:
$ cat /var/log/asterisk/cdr-csv/Master.csv
-
Dropbear SSH. When you install dropbear a public key will be generated and
printed:
root:~> ipkg install dropbear
Paste the "Public key portion" into your ~/.ssh/authorized_keys2 file on your
host machine. You should now be able to log into your host from the IP04
without a password:
root:~> ssh -i /etc/dropbear/dropbear_rsa_host_key user@host
To create a ssh tunnel, for example to maintain an IP04 that is behind a NAT:
IP04 ---> Firewall/NAT -> Linux host
On the IP04:
root:/etc/dropbear> ssh -R 2048:localhost:22 user@host
You need to keep this ssh session running. Now to ssh into the IP04
behind the NAT type this on the host:
[host ]$ ssh root@localhost -p 2048
-
Country specific Zaptel settings can be set by modifying
/etc/init.d/zaptel:
For example to set opermode for Australia:
start) modprobe wcfxs opermode=AUSTRALIA;
-
Transfers between Analog phones. The settings in zapata.conf are
overridden by users.conf, so to enable analog transfers for say
extension 6004, go to the [6004] section in /etc/asterisk/users.conf
and set:
threewaycalling=yes
transfer=yes
-
Atcom AT530 IP phone configuration for Asterisk on the IP04:
-
Insert this at the end of /etc/asterisk/sip.conf:
[at530]
type=friend
context=default
host=dynamic
user=at530
secret=sipguest
canreinvite=no
callerid=at530
disallow=all
allow=ulaw
-
Connect the WAN port of the AT530 to your LAN, it will boot and
obtain an IP via dhcp.
-
Find the IP of the phone by pressing the
Sysinfo button a few times.
-
With your web browser login to this IP
using the username/password admin/admin.
-
Optional: set a static IP
using the WAN menu (I like static IPs for SIP phones).
-
On the SIP
Config menu set Register Username to at530, Register Password to
at530, and the Phone Number to at530.
-
Then hit apply.
-
To check if registration is successful on the IP04 CLI try:
ip04*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
at530/at530 192.168.1.179 D 5060 Unmonitored
-
Once you have dialled a number on the AT530 phone press Send to make
the call.
-
To change the LCD logo go to Account Manage, Lcd Logo field, then
reboot the phone.
-
VLAN: There is some experimental support for VLANs. If anyone is
interested is using VLANs in production systems please let me know and
I will create an ipkg.
-
Start your IP04 and connect to the console using the RS232 daughter board.
-
rcp 8021q.ko and vconfig to your IP04.
-
Make sure network-static is being used (not dhcp)
root:~> insmod 8021q.ko
root:~> ifconfig eth0 0.0.0.0
root:~> vconfig add eth0 2
root:~> ifconfig eth0.2 10.1.1.2
This sets up VLAN 2 with IP 10.1.1.2. I noticed that VLAN2 can't talk
to regular LAN, it's like a separate physical network. So I couldn't
talk to 10.1.1.0 network unless PC on other end was configured for
VLAN2.
Now configure a VLAN on your PC, On my Ubuntu PC "apt-get install vlan".
Then same as above for IP04:
# modprobe 8021q.ko
# ifconfig eth0 0.0.0.0
# vconfig add eth0 2
# ifconfig eth0.2 10.1.1.1
Then I can connect between PC and IP04 on 10.0.0.x VLAN2 network.
If you have any questions, bug reports, or suggested improvements,
please post to the
Blackfin
Asterisk forum or the Free Telephony Project Mailing List, so the IP04 community can share the answers.
Astfin and BAPs
Until April 2008, most IP04s ran Astfin firmware. From April 2008
IP04s shipped from the Free Telephony Project Store run
BAPS. Differences in configuring the Astfin firmware
are described below:
-
To change the default network parameters (plus a bunch of other
config options), edit the file /etc/asterisk/rc.conf then reboot. If
the network is not coming up you may need to use the RS232 console
(see below).
-
To switch on DHCP enable the DHCP variable in /etc/asterisk/rc.conf.
For reliable DHCP client operation I suggest the following code in /etc/rc:
<snip>
# Check DHCPD is enabled
if [ "$DHCPD" = "yes" ]
then
rm -f /var/run/dhcpcd*
dhcpcd &
sleep 5
else
<snip>
-
To set a static ip, use vi to change these two lines in /etc/asterisk/rc.conf:
DHCPD=no
IPADDRESS="192.168.1.31"
and this line in in /etc/rc:
# Check DHCPD is enabled
if [ "$DHCPD" = "yes" ]
-
To restore the default Asterisk configuration files on your IP04
root:~> rm -f /etc/asterisk/.unpacked
then reboot your IP04. Thanks Mark T for this one.
|