The Amazing $35 Raspberry Pi: And Now It’s a Fax Machine

It was just a matter of time but David Cuthbert finally tamed HylaFax for the Raspberry Pi. So today we’re pleased to introduce Incredible PBX 3.7 incorporating his masterpiece, the born-again Incredible Fax. You still get all the terrific features of Incredible PBX 3.5 plus a whopper bonus, free faxing with any 512MB Raspberry Pi. Notice we said a 512MB Raspberry Pi. Unfortunately, the 256MB boards just don’t have the necessary memory to run Asterisk, Apache, MySQL, PHP, an SMTP mail server, and FreePBX plus IAXmodem, HylaFax, and all the image conversion utilities needed to support integrated faxing with document conversion to and from PDFs. Keep in mind we’re talking about doing this on a $35 computer without a hiccup with simultaneous voice and fax communications. Scary indeed!

SECURITY ALERT: Incredible PBX 3.7 addresses a serious security flaw in prior versions of Asterisk. With the exception of the new Asterisk release incorporated into this release, the functionality is identical to Incredible PBX 3.6.

For those with a 256MB Raspberry Pi, not to worry. Incredible PBX 3.7 installs just fine, and you get the full Incredible PBX 3.5 feature set minus faxing. With a 512MB Raspberry Pi, here are the 5 Simple Steps to activate Incredible Fax:

  1. Download and Install Incredible PBX 3.7 or 3.11
  2. Run the /root/fax-enable Script to Automatically Configure HylaFax
  3. Using FreePBX, Add a Dedicated DID and Inbound Route to Handle Incoming Faxes
  4. Install Any Desktop HylaFax Client to Send Faxes via Print-to-Fax using any PDF
  5. Reboot Your Server and Enjoy

The question we’ve heard a lot from our pioneers is whether to upgrade from Incredible PBX 3.5 and, if so, how? And the answer is that it depends. If you’re like us and only send a couple of faxes a week, then moving to 3.7 as an all-in-one platform makes perfect sense. If, on the other hand, you send dozens of faxes all day long or send lengthy fax documents which consume a lot of processing resources, then our best advice is buy another Pi and dedicate it to faxing. Be advised that the default setup (/etc/hylafax/config.ttyIAX0-ttyIAX3) sets MaxRecvPages to 25. You can change this to meet your own requirements.

1. Download and Install Incredible PBX 3.7 or 3.11

What to Buy. Here’s everything you need to get started.1 The case is optional. Yes, you can run the Raspberry Pi sitting on your desk with no case. It’s only 5 volts. WiFi is also optional. There’s a 10/100 port on the Raspberry Pi that gives you all the networking you need. Here are the links to buy the pieces. You also need a CAT5 cable and either a spare PC or Mac with Putty or SSH and a pair of earbuds or an HDMI cable to connect to a TV or monitor and a USB keyboard.

Setting Up Google Voice. If you want free calling in the U.S. and Canada, then you’ll need a Google Voice account, and you’ll need one dedicated to Incredible Pi, or it won’t work. Log out after setting up the new Google Voice account!

  • Register for Google Voice account (no funky characters in your password!)
  • Enable Google Chat as Phone Destination
  • Configure Google Voice Calls Settings:
    • Call ScreeningOFF
    • Call PresentationOFF
    • Caller ID (In)Display Caller’s Number
    • Caller ID (Out)Don’t Change Anything
    • Do Not DisturbOFF
    • Call Options (Enable Recording)OFF
    • Global Spam FilteringON

  • Place test call in and out using GMail Call Phone

Baking Your Incredible Pi. The disk drive for the Raspberry Pi is an SD card. So what you need to do is download Incredible Pi and copy the image onto an SDHC card. Mac and Linux installers are included. For Windows, just use Win32 Disk Imager. Here are the steps:

  1. Download the Incredible Pi package
  2. Decompress the tarball: tar zxvf incrediblepi-version.tar.gz
  3. Copy .img file to SDHC using image utility or script
  4. Insert SDHC card into Raspberry Pi
  5. Boot the Raspberry Pi from Incredible Pi SDHC card

Your First Bite of Incredible Pi. If you’re not using a monitor and keyboard, you can use SSH to gain root access to Incredible Pi. And you can use any web browser on your private network to access your server. There are a couple of hurdles. First, you need the network address of your new server. And, second you need an SSH client. With Incredible PBX 3.3 and beyond, you needn’t worry about the IP address. You now can access your server via SSH by logging in like this: root@incrediblepbx.local. And browser access to your server is available at the following address: http://incrediblepbx.local. You still can plug in some earbuds when the bootup process begins and listen for the Incredible Pi to tell you its IP address when the boot procedure completes (about 90 seconds). Then you can use that IP address instead of incrediblepbx.local. Version 3.3 and beyond also include a Java-based SSH client in the FreePBX web GUI: Admin -> Java SSH.

Here’s everything you need to know about security for Incredible Pi:

1. ALWAYS RUN INCREDIBLE PI BEHIND A SECURE HARDWARE-BASED FIREWALL/ROUTER
2. NEVER EXPOSE ANY INCREDIBLE PI PORTS DIRECTLY TO THE INTERNET
3. NEVER MAP INBOUND INTERNET PORTS FROM YOUR FIREWALL TO INCREDIBLE PI

Initial Setup. There also are a few setup steps to complete once your Incredible Pi finishes the bootup process. When you first login (username: root  password: raspberry), you’ll be prompted to change your root password and to set your default time zone. If you’re using either a wired network or an open WiFi network, then everything just works. If you’re using secured WiFi, then you’ll need to plug in your credentials in /etc/wpa.conf and reboot. The wired network always takes precedence so unplug the cable if you want WiFi to be your primary network. Next, run /root/update-my-pi to bring your server up to current specs. Finally, now’s the time to repartition your SD card if you’re using a card larger than 4GB. With the addition of faxing, a 4GB card is 80% full before your first call. While you’re at it, bump up the performance of your Raspberry Pi by 50% by setting the overclocking to turbo mode. It works great for us. YMMV! The key is a rock-solid power adapter such as the one we’ve recommended. Just run raspi-config and follow your nose.

Accessing Incredible Pi By GUI. You don’t have to be a Linux guru to use Incredible Pi. In fact, we’re just about finished with the Linux command prompt, but stay logged in until we finish the steps below. Most of your configuration of the PBX will be performed using the FreePBX® Web GUI. You also can access SSH through the FreePBX interface.

If you’re new to Asterisk® and FreePBX, here’s the one paragraph primer on what needs to happen before you can make free calls with Google Voice. You’ll obviously need a free Google Voice account. This gets you a phone number for people to call you and a vehicle to place calls to plain old telephones throughout the U.S. and Canada at no cost. You’ll also need a softphone or SIP phone to actually place and receive calls. YATE makes a free softphone for PCs, Macs, and Linux machines so download your favorite and install it on your desktop. Phones connect to extensions in FreePBX to work with Incredible Pi. Extensions talk to trunks (like Google Voice) to make and receive calls. FreePBX uses outbound routes to direct outgoing calls from extensions to trunks, and FreePBX uses inbound routes to route incoming calls from trunks to extensions to make your phones ring. In a nutshell, that’s how a PBX works. There are lots of bells and whistles that you can explore down the road.

Let’s get started. Using a browser, enter the IP address of your server or just use incrediblepbx.local as the address. Choose FreePBX Administration. When prompted for a username and password, use admin for both. Here are the six steps you need to complete before making your first free call:

  1. Change FreePBX admin Password and Default Email
  2. Add Google Voice Account credentials
  3. Set Destination for Incoming Calls
  4. Change Extension 701 Passwords
  5. Eliminate Audio and DTMF Problems
  6. Install and Register a Softphone to Extension 701

1. Changing FreePBX admin Password and Default Email. From the main FreePBX GUI, click Admin => Administrators. Click on admin user in the far-right column. Enter a new Password and click Submit Changes button. Then click the Apply Config button. Next, set your default email address at the bottom of Settings -> General Settings. Repeat the procedure above to save your entry.

2. Activating a Google Voice Trunk. To create a Trunk in FreePBX to handle calls to and from Google Voice, you’ll need three pieces of information from the Google Voice account you set up above: the 10-digit Google Voice phone number, your Google Voice account name, and your Google Voice password. Choose Other -> Google Voice from the FreePBX GUI. The following blank form will appear:

Fill in the blanks with your information and check all 3 boxes. If your Google Voice account name ends in @gmail.com, you can leave that out. Otherwise, include the full email address. Then click Submit Changes and Apply Config.

There’s one more step or your Google Voice account won’t work reliably with Incredible Pi! From the Linux command prompt while logged into your server as root, restart Asterisk: amportal restart

3. Setting a Destination for Incoming Calls. Now that you’ve created your Google Voice Trunk, we need to tell FreePBX how to process inbound calls when someone dials your Google Voice number. There are any number of choices. You could simply ring an extension. Or you could ring multiple extensions by first creating a Ring Group which is just a list of extension numbers. Or you could direct incoming calls to an Interactive Voice Response (IVR) system (we’ve actually set one up for you to play with).

By default, Incredible Pi is configured to route all incoming calls to a demo IVR that shows off some of the applications that come with Incredible Pi. You can change whenever you like by choosing Connectivity -> Inbound Routes -> Default. In the Set Destination section of the form, change the target to Extensions and then select 701 from the list. Then click Submit and Apply Config.

4. Changing Extension Passwords. From the main FreePBX GUI, choose Applications -> Extensions. Then click on 701 in the Extension List on the right side of your display. You’ll see a form that looks like this:

For now, we only need to make a few changes. First, you need a very secure password for both the extension itself and your voicemail account for this extension. The extension secret needs to be a combination of letters and numbers. The Voicemail Password needs to be all numbers, preferably six or more. Replace the existing 1234secret and 1234 with your own (very secure) entries. You also need to lock down this extension so that it is only accessible from devices on your private LAN. You do that with the deny and permit entries which currently are filled with zeroes. Leave the deny entry the way it is which tells Incredible Pi to block everybody except those allowed in the permit entry below. For the permit, we need the first three octets of your private LAN address, e.g. if your LAN is 192.168.0.something then the permit entry will be 192.168.0.0/255.255.255.0.

Finally, you need to plug in your actual email address in the Voicemail section so that voicemails can be delivered to you when someone leaves a message. You can also include a pager email address if you want a text message alert with incoming voicemails. If you want the voicemails to automatically be deleted from the server after they are emailed to you (a good idea considering the disk storage limitations of an SDHC card), change the Delete Voicemail option from No to Yes. That’s it. Now save your settings by clicking the Submit button. Then reload the dialplan by clicking on the red prompt when it appears.

In case you’re curious, unless you’ve chosen to automatically delete voicemails after emailing them, you can retrieve your voicemails by dialing *98701 from any extension on your phone system. You’ll be prompted to enter the voicemail password you set up. In addition to managing your voicemails, you’ll also be given the opportunity to either return the call to the number of the person that called or to transfer the voicemail to another extension’s voicemail box. And you can always leave a voicemail for someone by dialing their extension number preceded by an asterisk, e.g. *701 would let someone leave you a voicemail without actually calling you.

5. Eliminating Audio and DTMF Problems. You can avoid one-way audio on calls and touchtones that don’t work with these simple settings in FreePBX: Settings -> Asterisk SIP Settings. Just plug in your public IP address and your private IP subnet. Then set ULAW as the only Audio Codec.

6. Setting Up a Desktop Softphone. Incredible Pi supports all kinds of telephones, but we’ll start with the easy (free) one today. You can move on to “real phones” once you’re smitten with the VoIP bug. For today, you’ll need to download a softphone to your desktop PC or Mac.

As we mentioned, the easiest way to get started with Incredible Pi is to set up a YATE softphone on your Desktop computer. Versions are available at no cost for Macs, PCs, and Linux machines. Just download the appropriate one and install it from this link. Once installed, it’s a simple matter to plug in your extension 701 credentials and start making calls. Run the application and choose Settings -> Accounts and click the New button. Fill in the blanks using the IP address of Incredible Pi, 701 for your account name, and whatever password you created for the extension. Click OK.

Once you are registered to extension 701, close the Account window. Then click on YATE’s Telephony Tab and place your first call. It’s that easy!

Monitoring Call Progress with Asterisk. That about covers the basics. We’ll leave you with a tip on how to monitor what’s happening with your PBX. There are several good tools within the FreePBX GUI. You’ll find them under the Reports tab. In addition, Asterisk has its own Command Line Interface (CLI) that is accessible from the Linux command prompt. Just execute the following command while logged in as root: asterisk -rvvvvvvvvvv.

Activating SAMBA for Windows Networking. SAMBA is included for transparent access using the Windows Networking Protocol from PCs, Macs, and other Linux machines. As delivered, SAMBA is deactivated. For obvious reasons, we recommend you never activate root login access to SAMBA without a very secure password. If you wish to enable SAMBA on your server, here are the steps while logged in as root:

  • 1. Set SAMBA password for user root: smbpasswd -a root
  • 2. Change Windows workgroup from WORKGROUP, if needed: nano -w /etc/samba/smb.conf
  • 3. Manually start SAMBA from command prompt: service samba start
  • 4. If desired, set SAMBA to start on boot: rcconf and activate SAMBA option

If you’d like to update your status application to display SAMBA status instead of WLan1, here are the steps:
cd /usr/local/sbin
wget http://incrediblepbx.com/sambastatus.tgz
tar zxvf sambastatus.tgz
rm sambastatus.tgz

Activating the PPTP VPN Client. If you’ve followed the Nerd Vittles tutorial and previously set up a PPTP VPN Server for your devices, then it’s pretty simple to add Incredible Pi to the mix by activating its PPTP VPN client. You’ll need the FQDN or public IP address of your VPN server as well as a username and password for VPN access to your VPN server. Once you have those in hand, log into Incredible Pi as root.

Lest we forget to mention, you cannot log into your PPTP server from an IP address on the same private LAN so you’d only use the PPTP VPN when your Incredible Pi is at a remote location.

Edit the connection template: nano -w /etc/ppp/peers/my-pptp-server. Insert the following text and replace myfqdn.org with the FQDN of your PPTP server, replace myname with your PPTP username, and replace mypassword with your PPTP password. Then save the file: Ctrl-X, Y, then Enter.

To test it, issue the following command: /etc/init.d/pptp start. When you run ifconfig, you should now see a ppp0 entry:

ppp0 Link encap:Point-to-Point Protocol
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Remember, it won’t show an IP address if the Raspberry Pi and your PPTP VPN Server are on the same subnet (like ours). Once you install your Raspberry Pi in a remote location, you now can access it at the first IP address in your reserved PPTP IP address pool.

To permanently activate the PPTP VPN client on your Incredible Pi server, run rcconf. Scroll to the bottom of the list and highlight pptp. Press the space bar to select it for automatic startup when you boot your server. Then tab to OK and press Enter.

Shutting Down Your Server. Last but not least, never just pull the plug when you want to shut down your server, or you may end up with corrupted MySQL databases. Then nothing will run. Instead, log into your server as root, and issue the following command: shutdown -h now.

2. Run fax-enable Script to Configure HylaFax

To automatically configure Incredible Fax with HylaFax, log into your server as root with the root password you initially set up for your server. Before running the fax-enable script in the /root folder, make sure you have the following pieces of information:

  • DID Number to Receive Inbound Fax Calls (HINT: Google Voice works great!)
  • Your Country Code (Default is 1 for U.S.)
  • Your Local Area Code (Default is 843, our area code)
  • Long Distance Dial Prefix (Default is 1)
  • International Prefix (Default is 011)
  • Email Address to Receive Incoming Faxes in PDF Format
  • Fax Identifier to Attach to Outbound Faxes (Default is IncredibleFax)

Now run the script: /root/fax-enable. Fill in the blanks. And, this is important. Double-check your entries very carefully to make sure there are no typos. Once you press Enter to activate HylaFax, you’ll have to manually edit the files in /etc/hylafax to make corrections. With the exception of your incoming fax email address, the rest of the settings are stored in config.ttyIAX0, config.ttyIAX1, config.ttyIAX2, and config.ttyIAX3. Email address is stored in FaxDispatch.

3. Configuring FreePBX for Incredible Fax

Adding a Dedicated Google Voice Trunk for Incoming Faxes. As noted, you need a dedicated DID to support incoming fax calls since the system has no way to detect a fax. The easiest solution is to add an additional Google Voice trunk to your server and dedicate it to handling incoming faxes. You can also use a DID from a SIP provider of your choice; however, some support analog faxing better than others. And some don’t support fax transmissions at all. To add an additional Google Voice trunk, open FreePBX with your browser and choose Other -> Google Voice. Fill in the blanks with your Google Voice number and account credentials. Check off the three checkboxes, and save your settings. Click the Red reload button when prompted.

Adding an Inbound Route for Incoming Faxes. We don’t want Incredible Fax to use your default inbound route for incoming faxes, or it would simply ring a telephone or IVR. Instead, we want to create a new route just for incoming faxes. While still in FreePBX, choose Connectivity -> Inbound Routes -> Add Incoming Route. Fill in the blanks as shown below using the 10-digit DID of your dedicated fax number. Click Submit and Reload when prompted.

4. Installing a Desktop HylaFax Client to Send Faxes

You can skip this step if you only want to receive faxes at the email address you set up with fax-enable. If you want to be able to send faxes as well, then you’ll need to install a free or commercially available HylaFax client on your desktop machine. Here’s the complete list of HylaFax clients. Regardless of the client you choose, you’ll need to enter the credentials for your HylaFax server. This includes the IP address of Incredible PBX on your private LAN, your username (root), and your root password. For a free Windows client, we recommend WinPrint. For Mac machines, use Fax90. Both of these clients are so-called Print-to-Fax applications. This means you first must convert whatever document you wish to send into a PDF document. Then call it up on your screen and “print” the file to the Fax Device that was installed as part of the HylaFax client setup. It sounds harder than it really is. Free PDF conversion tools are available for Windows machines, and Macs include a PDF export utility as part of the operating system itself. HylaFax clients also are available for Linux machines and Android devices, but not the iJunk. Google is your friend. :-)

5. Reboot and Enjoy!

Last, but not least, you’ll need to reboot your server before any of this will work. If you have a keyboard plugged into your Raspberry Pi, then press Ctrl-Alt-Del to restart your server. If not, log in as root and type: reboot. Happy Faxing!

Originally published: Monday, December 3, 2012




Need help with Asterisk? Visit the PBX in a Flash Forum.


 
New Vitelity Special. Vitelity has generously offered a new discount for PBX in a Flash users. You now can get an almost half-price DID from our special Vitelity sign-up link. If you’re seeking the best flexibility in choosing an area code and phone number plus the lowest entry level pricing plus high quality calls, then Vitelity is the hands-down winner. Vitelity provides Tier A DID inbound service in over 3,000 rate centers throughout the US and Canada. And, when you use our special link to sign up, the Nerd Vittles and PBX in a Flash projects get a few shekels down the road while you get an incredible signup deal as well. The going rate for Vitelity’s DID service is $7.95 a month which includes up to 4,000 incoming minutes on two simultaneous channels with terminations priced at 1.45¢ per minute. Not any more! For PBX in a Flash users, here’s a deal you can’t (and shouldn’t) refuse! Sign up now, and you can purchase a Tier A DID with unlimited incoming calls for just $3.99 a month. To check availability of local numbers and tiers of service from Vitelity, click here. Do not use this link to order your DIDs, or you won’t get the special pricing! Vitelity’s rate is just 1.44¢ per minute for outbound calls in the U.S. There is a $35 prepay when you sign up. This covers future usage and any balance is fully refundable if you decide to discontinue service with Vitelity.
 


Some Recent Nerd Vittles Articles of Interest…

Be Sociable, Share!

  1. Many of our purchase links refer users to Amazon when we find their prices are competitive for the recommended products. Nerd Vittles receives a small referral fee from Amazon to help cover the costs of our blog. We never recommend particular products solely to generate Amazon commissions. However, when pricing is comparable or availability is favorable, we support Amazon because Amazon supports us. []

6 Responses to “The Amazing $35 Raspberry Pi: And Now It’s a Fax Machine”

  1. pickgrand says:

    We I don’t see here is. how to create multiple fax number going to different email address’s. It would be nice if there was a fax add script like the fax setup to be able to add multiple users.

  2. turqan says:

    Hi Mr. Vittles,
    Thanks for software side of the incrediblePBX.. But, How to connect my Raspberry Pi box with PSTN plug???? I couldn’t find any info about this..

  3. ward says:

    Easiest way is an OBi100 (for phones) or OBi110 (for phone company PSTN lines).

  4. Cameron says:

    Hi Ward,

    Love the Incredible PBX on Raspberry Pi. Weird thing. I recently attempted to install a plugin (Paging and Intercom) and ever since, the Asterisk server would crash about 5 minutes into reload. Attempting to do an “amportal restart” would never yield in a graceful restart, always with a count down to 0. I am going to reimage the SDcard inthe hopes that a fresh install will resolve issues, but going forward, do you have any tips on where I would begin looking for the possible cause? Running asterisk -rvvvvvvv yielded no log to the console window.

  5. Steven says:

    How do I input my login info into:
    /etc/wpa.conf

    I don’t see that config in my sd. Am I supposed to do this through the command line?

    [WM: Log into your server as root through the console or SSH. Then edit the file with the nano file editor: nano -w /etc/wpa.conf. Save the file when you’re finished: Ctl-X, Y, then Enter.

  6. Adel says:

    Sounds fantastic. I need to keep my analog fax line (same number for 20 years). If I get OBi110 and connect the fax line to it, will the PBX (HylaFax) still see the incoming faxes and forward to email as attachment? Thanks for all the work.

    [WM: Shouldn’t be a problem with the usual warnings about fax reliability over VoIP.

Ringbinder theme by Themocracy