Browse Category

Industry Insights

Raspberry Pi and Asterisk

Asterisk running on Raspberry Pi

I’ve been playing around with a Raspberry Pi for a few weeks now and thought I’d see how well Asterisk Open Source PBX works on it.

<%ThickBox(http://blog.provu.co.uk/media/4/20120618-raspi.jpg|Raspberry Pi)%>Raspberry Pi running on my desk

I’ve tried a couple of different versions of Debian on this device and have settled with Raspbian since this makes use of the floating point co-processor that is emulated in the normal Debian Armel packages. It’s early days for Raspbian yet and all the Debian packages have to be re-compiled but most stuff seems to be done and it works very well. Raspbian should perform better for tasks relying on the not-very-powerful ARM11 CPU on the Raspberry Pi.

As for Asterisk, proper Debian packages already exist for the Armel compiled operating system and it is simply a case of running “apt-get install asterisk” on the Raspberry Pi and it installs and works.

At the moment there is no package for Raspbian and also, I wanted to try out Asterisk 10. So I compiled from source.

The steps I took were:

  • Download the source from the Asterisk website, extract the tar archive
  • I started from the “hexxeh” Raspbian image which can be found on the Raspbian website. This already comes with most tools needed to build software, if you have installed from somewhere else just make sure you have got the build-essential Debian package
  • You will also need to install these packages: libncurses5-dev, libsqlite3-dev, libssl-dev (or chan_sip will be automatically unselected, this isn’t needed if you don’t want SIP)
  • Possibly more packages if using a different image of Raspbian or you’ve built your own.
  • Now back in the Asterisk 10 source folder you just extracted, issue the command “./configure –disable-xmldoc”. The option is to allow it to continue without installing the libxml2 development package
  • Now before running the build, it’s a good idea to check the modules you need will actually be built, the command: “make menuselect” will bring up a text menu that allows you to check the modules. In particular make sure chan_sip in the channels section is selected!
  • After that simply run: “make”. This will now compile Asterisk and all the modules you’ve selected. This will take around an hour on the Raspberry Pi native hardware! Note: you can use a cross compiler on more powerful hardware to build packages much quicker.
  • Now run: “make install” which will install the compiled software
    • <%ThickBox(http://blog.provu.co.uk/media/4/20120618-raspbian_asterisk.png|Asterisk 10 running)%>Asterisk 10 running

      Now you have installed Asterisk, you can run “make samples” to generate sample Asterisk config or write your own.

      So how well does it work?
      Surprisingly well I thought for a CPU that is generally thought to be approximately equivalent to a Pentium II 300 MHz. I have not done serious load testing but I set up a conference bridge (using the new confbridge feature in Asterisk 10) and it very easily handled 4 local SIP extensions in a conference at once. It’ll be interesting to see how much transcoding it can handle.

      This doesn’t mean that we’re going to start selling IP-PBX based on the Raspberry Pi. The hardware is still a bit too new and untested for the time being and the software is still very much in development. The main reason though is that for low-end hardware to run a PBX off, things like Sheevaplug make more sense. This has a more powerful CPU, more memory and by the time you factor in storage, power & casing for the Raspberry Pi, a Sheevaplug isn’t much more expensive.

      The Raspberry Pi’s CPU is a couple of generations out of date ARM11 core with ARMv6 instruction set. Where the devices shines is the GPU attached to it. This is a Broadcom VideoCore GPU and is pretty impressive indeed. It’s intense graphical processing that the Pi does best, that fact it can decode 1080p30 h264 “HD” video is very impressive (and I have tested this too).

      So while it runs Asterisk quite nicely for just a few phones not doing very much, it seems a bit of a waste to use the Pi for this since it’s not using it’s powerful graphics engine at all. I need to think of some graphical uses for it! Perhaps a fancy OpenGL-ES based call centre wall board system.

6am start for Raspberry Pi

So, 6am this morning. The ProVu techies were up trying to get their hand’s on a RasperryPI.

This is a new mini computer which runs Linux. They are cheap at $35. We all really excited about the launch. We all have ideas of things we want to build with the device. The educational aspect that kids can have a computer cheap enough to just play with is fantastic.

This morning, the announcement was that they had decide to use RS and Farnell for distribution. These are both huge companies. Farnell’s turnover is £990 million.

We have an account with Farnell, so thought buying would be easy.

Unfortunately, I slept in until 6.03 by which time the websites of the both distributors had gone offline. Only now at 11:59 has the Farnell website been up enough to place a pre-order for the next batch.

It is all good.

ipv6

IPv6 Certification Badge for timprovu

IPv6 is becoming a big topic at the moment.

We expect IPv4 addresses to run out this year. This isn’t so bad as we expect ISPs will start selling addresses to each other which will even out supplies for a few years.

But the future is IPv6. At ProVu we have had our network IPv6 activated for about 5 years. This has given us lots of experience.

We are also pushing all of our suppliers to update us on their IPv6 status. Ideally, all phones would support IPv4 and IPv6 dual stacked at same time.

We’ll update you as time goes on.

In the meantime, you could test your IPv6 connectivity using http://test-ipv6.com/

SIP Security Alert

Just recently we’ve learnt of several automated attacks on IP based phone systems.

This is the rough sequence of events when an attack occurs:

  • The robot sends a sip invite to the target IP address on the standard SIP port 5060 UDP (I don’t know how it decides which addresses to attack in the first place).
  • If it receives a SIP error response then it knows that it is dealing with a SIP agent. Beginning at 200 it repeatedly sends in SIP register invites using the extension number as the password. The two that I’ve seen tried all extensions between 200 and 9999.
  • If there are any extensions with SIP passwords the same as the extension number then the robot will register with the PBX and make a very short call (just a couple of seconds) to test connectivity.
  • If the call is successful the robot disconnects.
  • It returns and re-registers on Friday evening at about 18:00 local time and then it starts as many calls as your PBX will allow, all to the same premium rate number. The two we’ve seen called numbers in Sierra Leon.
  • The scam is that the owners of the robot also own the premium rate line so they are effectively siphoning money from you to them.

    The two cases that we’ve actually investigated both burnt about £4500 in the course of about 24 hours of constant calling. In both cases the user/owner of the PBX was running one or more extensions with passwords set to the same value as the extension number.

    This is a pretty serious problem but it’s very easy to guard against provided you use passwords which are different to the extension number. Releases of SARK starting from V2.1.14 generate strong passwords for your extensions when you create them. You will also be OK if you use some secret password that isn’t the same as the extension number.

    If you do have extensions with passwords the same as the extension then we would strongly recommend that you change them as soon as possible in order to survive any attacks you may receive.