Three years ago, I wrote about making Trixbox work in the UK with TDM400P analogue line cards in a PC to connect to the PSTN and normal telephone extensions. That setup served me well for ages, but I began to have difficulties with the Digium TDM400P cards when driving the lines to the exchange. One of the channels started to play up, and as the DAHDI drivers are not really user-friendly either, I migrated to a pair of Linksys SPA3102 boxes. These are sweet devices which have a lot more functionality in them than I use in my setup. The SPA3102 provides an exchange line (PSTN) interface socket and also a traditional analogue phone interface socket, as well as two Ethernet interfaces, one intended to connect to the Internet (or in this case, to my Asterisk server) and one which I do not use, intended to serve a PC or home/office network.
Things in the Asterisk world have moved on in three years, and one change is that Trixbox is no longer supported. Feeling that the time was right for an upgrade, I looked around the web and concluded that the front runner these days is PBX in a Flash. This is very similar in scope to Trixbox, being a complete distribution presented as a bootable DVD which takes over and overwrites the entire machine it is booted on. Beware! For my upgrade, I disconnected the existing disk drive and used a different one for the new installation. In typical calavier fashion, I didn’t write much down about my existing configuration and just went ahead and installed the new one. I used PBX-in-a-Flash (PIAF) v184.108.40.206.4 which includes CentOS 6.2, and I used the 64-bit version. PIAF requires the user to make quite a lot of choices during installation, and I chose FreePBX 2.9 and Asterisk 1.8, these being the most recent stable versions.
Installation takes forever, belying its name. The massive distribution doesn’t even include half the stuff you need, instead relying on the Internet to download and automatically install additional components. There are several guides to installation on the Web, so I shan’t attempt one here. What I do want to cover though is the mysteries of getting the TDM400P cards to be recognised.
The best guide to this which I found is Configuring and Testing Dahdi Hardware. This covered the basics for me, though I had to recompile and reinstall the DAHDI drivers first:
# cd /usr/src/dahdi/
# make all
# make install
# make config
# cd tools
# make distclean
# make install
Then reboot the machine.
The undocumented magic for me was:
# cd /etc/asterisk
Edit chan_dahdi.conf and add this line near the end, before chan_dahdi_additional.conf:
After that, it’s time to reboot again and confirm that the channels exist:
# dahdi_cfg -vv
This should list lots of channels on the cards you are configuring. They should also be visible in the Asterisk command-line interface (this output is specific to my setup):
piaf*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
1 from-internal default In Service
2 from-internal default In Service
3 from-pstn default In Service
4 from-pstn default In Service
5 from-internal default In Service
6 from-internal default In Service
7 from-internal default In Service
8 from-internal default In Service
One more magic step: use a browser to access the FreePBX administration interface on your server, and go to the Setup->DAHDi screen. Under Analogue Hardware, find a line entitled “FXS Ports” and hit the “Edit” link. If the Group entries are blank for your channels, enter “1” in each group field, then save and apply the settings. At that point you should be able to create DAHDI extensions. Hoorah!
The UK-specific changes I documented in my first article on this subject probably still apply, but I haven’t tried them as I no longer use the FXO ports.