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.

Post navigation

46 thoughts on “Building a PBX setup around the Raspberry Pi”

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?

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.

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).

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.

Mathias: Grandstream has a SIP based DECT phone – “DECT base station registers up to 5 DECT handsets and talks to up to 4 handsets concurrently” They run about $80 for the base station handset and $45 for each additional one.

What you need is an analog converter. It’s basically a SIP phone in a box that then passes the analog signal on to a phone port. Something like this: http://www.voipon.co.uk/atcom-ag198-p-3765.html (no affiliation except that we buy these at work).

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.

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.

@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.

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.

@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 ;-)

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?

@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.

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.

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.

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.

@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.

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!