Homelab Faxing - NixOS Asterisk Setup
Background
About a month or two ago I fell down the analogue telephone rabbit hole. A friend had gifted me a Grandstream ATA and it felt rude to not use it. This spiraled into me setting up an asterisk server, and buying an additional ATA, two phone numbers from Telnyx for inbound/outbound access, and two older phones off of eBay. I got the config ironed out and had the phones set up as a neat display piece for when friends came to visit. I thought this was where my little foray into telephony would end however, the same friend who had gifted me the original ATA sent me a link to the Brother FAX-575.
This small, desktop fax machine can be found very cheap on ebay and I’d be lying if I said the idea of being able to tell people to fax me documents didn’t appeal to me. One quick ebay purchase later I found my self one layer deeper into home telephony.
Required Parts
If for some reason you find yourself wanting to replicate this setup you’ll need the below parts list.
- Brother 575-FAX or some other fax machine
- Grandstream HT801 or some other ATA supporting t.38
- A server running Asterisk PBX with SpanDSP included
- I’ll be covering setting this up via nixos later in this post
Putting It All Together
When it came to getting this all running my first step was getting the Asterisk server running. As with all new services in my homelab I’ll be setting this up with nixos. The core config files I’m managing should be the same regardless of how you choose to install asterisk but obviosuly your mileage may vary following this on a non nixos install.
I began by creating a new asterisk.nix file to contain all the configs related to this service. Because this will be used for t.38 faxing I can’t just use the services.asterisk module for configuring the service and instead will need to pass an override to make sure that SpanDSP is included during compile. This gives us the below starting file.
{ pkgs, lib, config, ... }:
{
systemd.tmpfiles.rules = [
"d /var/spool/asterisk/fax 0750 asterisk asterisk -"
];
services.asterisk = {
package = (pkgs.asterisk.override {
withOpus = true;
}).overrideAttrs (old: {
buildInputs = old.buildInputs ++ [ pkgs.spandsp ];
});
enable = true;
confFiles = {
"pjsip_wizard.conf" = ''
'';
"pjsip.conf" = ''
'';
"extensions.conf" = ''
'';
"rtp.conf" = ''
[general]
rtpstart=10000
rtpend=10100
'';
"logger.conf" = ''
[general]
dateformat=%F %T
[logfiles]
console => notice,warning,error
/var/log/asterisk/messages => notice,warning,error,verbose
'';
"manager.conf" = ''
'';
};
extraConfig = ''
noload => chan_sip.so
'';
};
}This file should then be modified to include your SIP trunk information, extension configs, and call routing as needed for your environment. When filled out and associated to your host you should be able to execute a nixos-rebuild switch and run sudo asterisk -rx "fax show capabilities" to confirm that asterisk is properly installed with SpanDSP.
With that all set up, the only remaining part is to connect the ATA to the asterisk server, connect the fax machine to the ATA and test out a fax.
If for some reason you’ve made it this far and also set this up send me an email kassie@kittycat.moe and I’ll fax you something.