Building a PBX setup around the Raspberry Pi

We’re not sure why this use didn’t immediately come to mind when we got our hands on a Raspberry Pi board, but the hardware is almost perfect as a PBX system. PBX, or Private Branch Exchange, is basically an in-house phone system. This guide which [Ward] put together shows you how to do some interesting things with it.

When talking about PBX setups the most common software package is Asterisk. That’s what’s at work here, rolled up with a bunch of other helpful software in an RPi targeted distro called Incredible PBX. All it takes to get up and running is to partition and burn the image to an SD like any other RPi distro. The configuration ends up being most of the work, starting with changing the default password, and moving on to customizing the environment to match your phone numbers and your needs. As with PBX setups on other embedded Linux devices, Google Voice is your best friend. The service will set you up with a free phone number.

This guide doesn’t delve into hardware connected hand sets. You’ll need to use a SIP phone. But that’s easy enough as there are free apps for most smart phones that will do the trick.

[Thanks Jamie]

43 thoughts on “Building a PBX setup around the Raspberry Pi

  1. Am I the only one who would love to have DECT phones used with Asterisk with cheap hardware that is not 5+ years old? I could never (in the forseeable future) convince my Girlfriend to use a smartphone and given the standby and talk time I can understand her.
    Is there cheap analog phone hardware so I could just wire up a DECT basestation?

    1. You can pick up an “ATA” (Analogue Terminal Adaptor) for about 30 quid which will allow you to do just that. The Linksys ones (eg PAP2T) are relatively inoffensive.

    2. I would recommend the Linksys SPA-1001. You can get them for around 20€ on Ebay from china, and they work relatevely well. I have been using them exclusively to speak with my family after moving from Canada to Europe, and they have worked flawlessly. This was the perfect soltuion for my mom who is an absolute technophobe.

      Basically you configure them via a web interface, then plug any normal analog phone into it (be it a cordless phone, or a normal corded phone)

      In the 2 years that they have been running, I have had to have one reset by unplugging and plugging back in, but other than that it has been flawless operation.

      I am using voip.ms as a provider, but they also work with Asterisk.

    3. Gigaset (used to be Siemens) have a few DECT stations which do analogue PSTN and VoIP and I’ve found them to work well. I swapped my mother’s old DECT (also Gigaset, but not VoIP) base station with a Gigaset N300A and it works pretty well. My only gripe is the inability to define more complicated dial plans, but that’s what the RPi could be for (I use an old fanless HP thin client atm).

    4. Can’t you use any of those wifi SIP phones with the asterisk server configured as the SIP gateway?

      There’s tons at a reasonable price on ebay and elsewhere. Sent one to my parents preconfigured for callcentric recently s they just plugged it in and started using it as a normal phone. Didn’t have to explain anything.

    5. If you like DECT phones then check out the Panasonic KX-TGP500. You can have quite a few handsets and up to three calls up at once. It also passes WAF pretty good. (Wife Acceptance Factor)

  2. You’re right :) Raspberry Pi is ideal for small Asterisk PBX.
    Actually it can be expandable for some analog phones also if used with a switch in the box with PAPs.

  3. If anyone has any suggestions for some FXO/FXS hardware (either USB or GPIO?) which can be made to work with a raspberry pi I would be interested to hear about it!

    I’d love to be able to replace my home asterisk server with a pi, but I need 2 FXO and 2 FXS ports to connect it to my 1957 strowger exchange, and currently the most cost effective way to provide those is with a PCI card.

    I did find a sangoma USB FXS/FXO adapter which works with linux, but it costs more than I spent building my existing solution… and has half as many ports.

    Homebrew suggestions welcome!

    1. I know you said USB/GPIO, but is an ethernet solution so bad? It’d allow you to place the ATA near the actual handset.
      If eth is ok then I’d recommend Cisco/Linksys/Sipura SPA-3102 (1FXO,1FXS) and/or PAP-2T (2FXS). many options, and difficult to configure sometimes but it’s all time well spent and they’re solid.

    2. How about an Ethernet FXS adapter like this one for example? I guess no reason they wouldn’t talk to a local Asterix server.

      sipgate.com is a good alternative to Google voice and provide free numbers too.

      1. @nes – I’ve looked into using ATAs and they solve part of the problem. They would allow me to make a call from my strowger exchange to my asterisk server (or any other voip provider) using their FXS port.

        An FXS port wouldn’t allow calls to go the other way and be routed through my strowger exchange. To do that, I need an FXO port.

        A lot of ATAs claim to have FXO ports, but what they really mean is that they have a passthrough port that allows the phone connected to the FXS port to call out through the FXO port. They won’t pass a call from the voip interface out through the that port and into my strowger.

        Otherwise, yes. I’d totally be doing that ;-)

    3. I have run a Fritzbox as ISDN Gateway. The Fritzbox runs as SIP Client und * has a SIP trunc between the Fritzbox. It works well. Google * and Fritzbox.

  4. @lpbk

    Ah, I see. How does the signalling for incoming calls to the exchange work? Is it still pulse dialling? If so, I am wondering if hooking a relay up to a GPIO on the R-Pi and writing a script to tap out the internal number might work, in conjunction with one of these boxes.

    As an aside, are you UK based? I have a big box of ex-GPO relays, maybe 50 or so, all different. Most have oddball coils with multiple windings for doing relay logic I guess. They’re not much use to me so if you’re interested, feel free to PM me on the hackaday forum.

    1. @nes – yea, it’s all pulse dialing all over the place (although I have some boxes which which can do dtmf->pulse translation if necessary)

      I wonder if I could use a usb soundcard (and some line isolation transformers so the soundcard doesn’t unexpectely get 50V up it) in combination with some relays etc hanging off the GPIO port for doing the signalling. Hmm. A bit hairy but it might get me somewhere.

      I am in the UK, and I may very well be interested in a big box of relays! Especially any with multiple windings. I’ll have a crack at getting in touch with you (never used the forum before ;-)

      1. I use Gigaset N300IP which has normal landline plus 6 VoIP accounts on it. The landline goes to my old Strowger exchange whilst the VoIP lines are on various providers such as SIPgate.co.uk. My old Strowger exchanges – I have a number of former public exchanges are linked by VoIP to others around the UK and the World on our own network – is your Strowger connected to the network?

  5. @lpbk: Visit the PBX in a Flash Forum and post this issue there. We have folks that use ATA’s with true FXO ports all the time. The best of these is the Obi110 which you can find on Amazon for under $50.

  6. One of the companies I work for, and 2 of the companies I own use asterisk for the phone systems.

    One of the big issues with non x86 based asterisk units is: No Digium fax. They also lack the power to transcode more than 1 or 2 channels at a time.

    That said, while the raspi is a neato little board, my Ubiquity Routerstation Pro running OpenWRT has been my home asterisk server for YEARS. 800MHz CPU, plenty of ram, USB for voicemail storage, and designed to be on 24/7.

  7. roberto: There certainly have been other Asterisk ports. But you won’t find anything comparable to this build: text-to-speech, speech-to-text, IVRs, SMS messaging and message blasting, free Google Voice service, email delivery of voicemails, directory lookups and dialing by just saying the name of anybody in your phonebook, CallerID name lookups for your incoming calls, inbound call alerts on your desktop, XBMC, wired or wireless operation, and the list goes on and on. We love FreeSwitch, too, so stay tuned. In the meantime, take Incredible Pi for a spin. You won’t be disappointed.

  8. Is there a way to make this call one number from many g-voice accounts and connnect the first one that makes it through? would be great for “be the 10th caller” type stuff. you could win all the local radio station contest :)

    Guess i need to see if the phones at work are IP based? and if i can connect to my raspberry pi.

  9. @profit: Takes about 5 seconds to set up each GVoice trunk. Then another 5 seconds to set up an Inbound Route for each one and point all of them to the same extension. Pick up the 10th call. Done. Or you could write a little script to do the counting for you. Simple stuff with the Asterisk dialplan which is a complete programming language.

  10. Hi. I recently ordered a Raspi and am so glad the conversation here is happening. Heres what I want to accomplish maybe someone here can help.

    I want to be able to install the DAHDI drivers onto raspberry pi
    I want the Pi to then be able to accept calls via a normal in-home telephone line.

    No voip needed, no outbound calls needed.

    Is this possible? Right now I accomplish this using dahdi on ubuntu 12.10 with a Digium PCI card.

    Thanks, this is fun stuff!

  11. Curious the size of SD card recommended if you want to utilize voice mail on the Raspi? Can you select the folders where the voice mail is stored and put that on a external USB drive?

    1. There are a few of us using RPis as part of our own network linking ‘heritage’ telephone exchanges – one of mine served a village in the North of England from 1929 until 1950. Currently we use Linksys ATAs with FXS & FXO ports to interconnect – I’m sure we would be interested. Only problem is that we still use pulse dialling with converters between the FXS/FXO and the ‘heritage’ systems. See http://www.ckts.info/192/uk for some of the numbers in the UK with links to other countries around the World!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s