PIAF 101: Taking Asterisk 10 for a Spin

There’s been some interest in a quick-and-dirty guide to get PBX in a Flash up and running without much in the way of bells and whistles. So here you go. This step-by-step will get PIAF-Red with Asterisk® 10 or PIAF-Purple with Asterisk 1.8.5.0 or 1.8.6.01 humming away. If you’re going to do things this way, then make sure your PIAF server or virtual host with PIAF is sitting behind a secure, hardware-based firewall (such as dLink’s Gaming Router) with NO INTERNET PORT EXPOSURE to your PIAF box!

UPDATE: Digium has dropped support for Google Voice in Asterisk 10 so we no longer recommend Asterisk 10 for production use. You can read all about it here.

Atom-based PC Platform. For the least expensive hardware alternative, pick up an Atom-based PC, preferably not an EEE PC because of the network driver incompatibility with CentOS. The refurbished Revos work fine. Someone has actually tested them! And they can easily support a small business with dozens of phones.

PIAF ISO Setup. Once you have your hardware connected to a reliable Internet source, you’ll need to choose the appropriate ISO for your hardware. If you have a CD-ROM or DVD drive on your server, we’d recommend the 32-bit PIAF 1.7.5.6.3 ISO. Just download it from SourceForge or one of the PIAF mirror sites, burn it to a CD, and then boot your server from the CD. If your server lacks a CD-ROM and DVD drive, then download the brand new 32-bit PIAF 1.7.5.6.3 Flash-Only ISO from SourceForge and copy it to a 1GB or larger thumb drive following the instructions in this Nerd Vittles tutorial. Then boot your server from the thumb drive. You’ll find OpenVZ and VMware templates on our download mirrors as well.

PIAF Installation. Once you’ve booted the PIAF installer, you’ll be prompted to choose an installation method. For most users, simply pressing the Enter key will get things started. Choose a keyboard and time zone when prompted and then enter a very secure root password for your new server. The installer then will load CentOS 5.6 onto your server. When complete, your server will reboot. Remove the CD or Flash Drive at this point, and you’ll be prompted to choose the version of Asterisk to install. Just for fun, choose PIAF-Red which loads the latest Asterisk 10 beta. It works just fine!

During the final phase of the install, you will be prompted to choose a master password for FreePBX® and the other VoIP web utilities. Once your server reboots, log into the Linux CLI using your root password and write down the IP address of your server from the status display.

FreePBX Setup. Most of your life with PBX in a Flash will be spent using the FreePBX web GUI and your favorite browser. Just click on the image below to enlarge. To access the FreePBX GUI, point your browser at the IP address you wrote down. Read the RSS Feed in the PIAF GUI for late-breaking security alerts. Then click on the Users button which will toggle to the Admin menu. Click the FreePBX icon. When prompted for your username and password, the username is maint. The password will be the FreePBX master password you chose in completing the PIAF install.

To get a minimal system functioning, here’s the 5-minute drill. You’ll need to set up at least one extension with voicemail, configure a free Google Voice account for free calls in the U.S. and Canada, configure inbound and outbound routes to manage incoming and outgoing calls, and plug your maint password into CallerID Superfecta so that names arrive with your incoming calls. Once you add a phone with your extension credentials, you’re done.

Extension Setup. Now let’s set up an extension to get you started. A good rule of thumb for systems with less than 50 extensions is to reserve the IP addresses from 192.x.x.201 to 192.x.x.250 for your phones. Then you can create extension numbers in FreePBX to match those IP addresses. This makes it easy to identify which phone on your system goes with which IP address and makes it easy for end-users to access the phone’s GUI to add bells and whistles. To create extension 201 (don’t start with 200), click Setup, Extensions, Generic SIP Device, Submit. Then fill in the following blanks USING VERY SECURE PASSWORDS and leaving the defaults in the other fields for the time being.

User Extension … 201
Display Name … Home
Outbound CID … [your 10-digit phone number if you have one; otherwise, leave blank]
Emergency CID … [your 10-digit phone number for 911 ID if you have one; otherwise, leave blank]

Device Options
secret … 1299864Xyz [make this unique AND secure!]
dtmfmode … rfc2833
Voicemail & Directory … Enabled
voicemail password … 14332 [make this unique AND secure!]
email address … yourname@yourdomain.com [if you want voicemail messages emailed to you]
pager email address … yourname@yourdomain.com [if you want to be paged when voicemail messages arrive]
email attachment … yes [if you want the voicemail message included in the email message]
play CID … yes [if you want the CallerID played when you retrieve a message]
play envelope … yes [if you want the date/time of the message played before the message is read to you]
delete Vmail … yes [if you want the voicemail message deleted after it's emailed to you]
vm options … callback=from-internal [to enable automatic callbacks by pressing 3,2 after playing a voicemail message]
vm context … default

Write down the passwords. You’ll need them to configure your SIP phone.

Extension Security. We cannot overstress the need to make your extension passwords secure. All the firewalls in the world won’t protect you from malicious phone calls on your nickel if you use your extension number or something like 1234 for your extension password if your SIP or IAX ports happen to be exposed to the Internet. Incredible PBX automatically randomizes all of the extension passwords for you.

In addition to making up secure passwords, the latest versions of FreePBX also let you define the IP address or subnet that can access each of your extensions. Use it!!! Once the extensions are created, edit each one and modify the permit field to specify the actual IP address or subnet of each phone on your system. A specific IP address entry should look like this: 192.168.1.142/255.255.255.255. If most of your phones are on a private LAN, you may prefer to use a subnet entry in the permit field like this: 192.168.1.0/255.255.255.0 using your actual subnet.

Courtesy of wordle.net

Adding a Google Voice Trunk. There are lots of trunk providers, and one of the real beauties of having your own PBX is that you don’t have to put all of your eggs in the same basket… unlike the AT&T days. We would encourage you to take advantage of this flexibility. With most providers, you don’t pay anything except when you actually use their service so you have nothing to lose.

For today, we’re going to take advantage of Google’s current offer of free calling in the U.S. and Canada through the end of this year. You also get a free phone number in your choice of area codes. PBX in a Flash now installs a Google Voice module for FreePBX that lets you set up your Google Voice account with PBX in a Flash in just a few seconds once you have your credentials.

Signing Up for Google Voice. You’ll need a dedicated Google Voice account to support PBX in a Flash. The more obscure the username (with some embedded numbers), the better off you will be. This will keep folks from bombarding you with unsolicited Gtalk chat messages, and who knows what nefarious scheme will be discovered using Google messaging six months from now. So keep this account a secret!

We’ve tested this extensively using an existing Gmail account rather than creating a separate account. Take our word for it. Inbound calling is just not reliable. The reason seems to be that Google always chooses Gmail chat as the inbound call destination if there are multiple registrations from the same IP address. So… set up a dedicated Gmail and Google Voice account, and use it exclusively with PBX in a Flash. Google Voice no longer is by invitation only. If you’re in the U.S. or have a friend that is, head over to the Google Voice site and register. If you’re living on another continent, see MisterQ’s posting for some tips on getting set up.

You must choose a telephone number (aka DID) for your new account, or Google Voice calling will not work… in either direction. You also have to tie your Google Voice account to at least one working phone number as part of the initial setup process. Your cellphone number will work just fine. Don’t skip this step either. Just enter the provided confirmation code when you tell Google to place the test call to the phone number you entered. Once the number is registered, you can disable it if you’d like in Settings, Voice Setting, Phones. But…

IMPORTANT: Be sure to enable the Google Chat option as one of your phone destinations in Settings, Voice Setting, Phones. That’s the destination we need for PBX in a Flash to function with Google Voice! Otherwise, inbound and/or outbound calls will fail. If you don’t see this option, you may need to call up Gmail and enable Google Chat there first. Then go back to the Google Voice Settings and enable it. Be sure to try one call each way from Google Chat in Gmail. Then disable Google Chat in GMail for this account. Otherwise, it won’t work with PIAF.

While you’re still in Google Voice Settings, click on the Calls tab. Make sure your settings match these:

  • 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

Click Save Changes once you adjust your settings. Under the Voicemail tab, plug in your email address so you get notified of new voicemails. Down the road, receipt of a Google Voice voicemail will be a big hint that something has come unglued on your PBX.

Configuring Google Voice Trunk in FreePBX. All trunk configurations now are managed within FreePBX, including Google Voice. This makes it easy to customize PBX in a Flash to meet your specific needs. Click the Setup tab and choose Google Voice in the Third Party Addons. To Add a new Google Voice account, just fill out the form:

Phone number is your 10-digit Google Voice number. Username is your Google Voice account name without @gmail.com. NOTE: You must use a Gmail.com address in the current version of this module! Password is your Google Voice password. NOTE: Don’t use 2-stage password protection in this Google Voice account! Be sure to check all three boxes: Add trunk, Add routes, and Agree to TOS. Then click Submit Changes and reload FreePBX. Down the road, you can add additional Google Voice numbers by clicking Add GoogleVoice Account option in the right margin and repeating the drill. For Google Apps support, see this post on the PIAF Forum.

Outbound Routes. The idea behind multiple outbound routes is to save money. Some providers are cheaper to some places than others. It also provides redundancy which costs you nothing if you don’t use the backup providers. The Google Voice module actually configures an Outbound Route for 10-digit Google Voice calling as part of the automatic setup. If this meets your requirements, then you can skip this step for today.

Inbound Routes. An Inbound Route tells PBX in a Flash how to route incoming calls. The idea here is that you can have multiple DIDs (phone numbers) that get routed to different extensions or ring groups or departments. For today, we’ll build a simple route that directs your Google Voice calls to extension 201. Choose Inbound Routes, leave all of the settings at their default values except enter your 10-digit Google Voice number in the DID Number field. Enable CallerID lookups by choosing CallerID Superfecta in the CID Lookup Source pulldown. Then move to the Set Destination section and choose Extensions in the left pull-down and 201 in the extension pull-down. Now click Submit and save your changes. That will assure that incoming Google Voice calls are routed to extension 201.

IMPORTANT: Before Google Voice calling will actually work, you must restart Asterisk from the Linux command line interface. Log into your server as root and issue this command: amportal restart.

CallerID Superfecta Setup. CallerID Superfecta needs to know your maint password in order to access the necessary modules to retrieve CallerID information for inbound calls. Just click Setup, CID Superfecta, and click on Default in the Scheme listings in the right column. Scroll down to the General Options section and insert your maint password in the Password field. You may also want to enable some of the other providers and adjust the order of the lookups to meet your local needs. Click Agree and Save once you have the settings adjusted.

General Settings. Last, but not least, we need to enter an email address for you so that you are notified when new FreePBX updates are released. Scroll to the bottom of the General Settings screen after selecting it from the left panel. Plug in your email address, click Submit, and save your changes. Done!

Adding Plain Old Phones. Before your new PBX will be of much use, you’re going to need something to make and receive calls, i.e. a telephone. For today, you’ve got several choices: a POTS phone, a softphone, or a SIP phone. Option #1 and the best home solution is to use a Plain Old Telephone or your favorite cordless phone set (with 8-10 extensions) if you purchase a little device known as a Sipura SPA-3102. It’s under $70. Be sure you specify that you want an unlocked device, meaning it doesn’t force you to use a particular service provider. This device also supports connection of your PBX to a standard office or home phone line as well as a telephone.

Configuring a SIP Phone. There are hundreds of terrific SIP telephones and softphones for Asterisk-based systems. Once you get things humming along, you’ll want a real SIP telephone such as the $50 Nortel color videophone we’ve recommended previously. You’ll also find lots of additional recommendations on Nerd Vittles and in the PBX in a Flash Forum. If you’re like us, we want to make damn sure this stuff works before you shell out any money. So, for today, let’s download a terrific (free) softphone to get you started. We recommend X-Lite because there are versions for Windows, Mac, and Linux. So download your favorite from this link. Install and run X-Lite on your Desktop. At the top of the phone, click on the Down Arrow and choose SIP Account Settings, Add. Enter the following information using 201 for your extension and your actual password for extension 201. Then plug in the actual IP address of your PBX in a Flash server instead of 192.168.0.251. Click OK when finished. Your softphone should now show: Available.

Enabling Google Voicemail. Some have requested a way to retain Google’s voicemail system for unanswered calls in lieu of using Asterisk voicemail. The advantage is that Google offers a free transcription service for voicemail messages. To activate this, you’ll need to edit the [googlein] context in extensions_custom.conf in /etc/asterisk. Just modify the last four lines in the context so that they look like this and then restart Asterisk: amportal restart

;exten => s,n(regcall),Answer
;exten => s,n,SendDTMF(1)
exten => s,n(regcall),Set(DIAL_OPTIONS=${DIAL_OPTIONS}aD(:1))
exten => s,n,Goto(from-trunk,gv-incoming,1)

But I Don’t Want to Use Google Voice. If you’d prefer not to use Google Voice at all with PBX in a Flash, that’s okay, too. Here’s how to disable it and avoid the chatter in the Asterisk CLI. Log into your server as root and edit /etc/asterisk/modules.conf. Change the first three lines in the [modules] context so that they look like this. Then restart Asterisk: amportal restart.

autoload=yes
noload => res_jabber.so
noload => chan_gtalk.so

Where To Go From Here. We’ve barely scratched the surface of what you can do with your new PBX in a Flash system. If you’re new to all of this, then your next step probably should be last week’s Incredible PBX 2.0 tutorial. It’s a 5-minute addition that installs nearly 50 Asterisk applications that will keep you entertained for the rest of the year. If you’d prefer to do it yourself, then… enjoy!

Originally published: Monday, August 29, 2011




Need help with Asterisk? Visit the PBX in a Flash Forum.
Or Try the New, Free PBX in a Flash Conference Bridge.


whos.amung.us If you’re wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what’s happening. It’s a terrific resource both for us and for you.


 
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 and 60 free minutes 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 and you get a free hour of outbound calling to test out their call quality. 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! After the free hour of outbound calling, 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. See this Nerd Vittles article for Asterisk 1.8.6.0 install instructions. []

8 Responses to “PIAF 101: Taking Asterisk 10 for a Spin”

  1. Dan says:

    I installed this over the weekend, as a Virtualbox VM, and have been searching the web for solutions to the problems I’ve had. It’s an amazing package of features, but honestly, it’s way way too much for us. I’m not running a small sales force, I’m just trying to bridge the household’s private Google Voice DIDs, to individual physical phones, using SIP ATAs. It sort of works, but there are features I need to squelch so that the phones behave like conventional phones. I’m not finding the experience to be plug and play, and PBXiaF does not really make it easy enough for this mere mortal.

    I need PBXiaF to NOT immediately answer incoming calls and play it’s fake ring to callers. It should ring its associated extension and grab the call only if the extension is picked up. Currently, folks get charged for their call whether we’re answering or not. It also prevents our other GV-associated phones from ringing, since PBXiaF answers the line so fast. Furthermore, we’d rather use GV Vmail and transcription. It’s better, and easier to access.

    Another problem is in setting up GV trunks. IPBX sets up a bunch of extensions for us to pick from; thanks for that. But when setting up a GV trunk, the GV module should also create an inbound route to an extension of our choice. The last thing I want is to have every caller put on hold while every PBXiaF extension rings at the same time.

    Another problem is that no matter which GV extension a call is initiated from, PBXiaF always uses the same GV account to make that call. Each GV extension seems to have it’s own outgoing GV trunk selected. It just ignores the setting. That’s not going to be okay, since we don’t want to share our phone lines with each other, or send any CID other than our own to our callees.

    Dialing other GV extensions doesn’t work. Part of this may be due to an invalid dial plan installed on our Innomedia MTA6328-2Re ATAs (which worked beautifully with GV+Gizmo5 until recently) (Any idea why Gizmo5 is still a choice in GV’s config?). Sometimes we get a fast busy, sometimes we hear PBXiaF telling us the extension is busy. It works only if we dial the whole 10-digit DID.

    Finally, it looks like the modules for every kind of SIP host are turned on by default, endlessly trying to log into the remote servers using invalid credentials. The log, it grows and grows and grows. It’s not really polite to harass those hosts with all that zombie traffic. These modules should be mute until someone sets up valid credentials.

    Am I really the only one who wants to use PBXiaF to bridge GV the way Gizmo5 used to do? I can’t find any discussions or tutorials that resolve this issue.

    [WM: You mistakenly posted this under the wrong article, I think. It appears you are using Incredible PBX 2.0 rather than just PBX in a Flash. We obviously have to make certain assumptions in setting up a default system for end-users. The beauty of PBX in a Flash and Incredible PBX is that you can adjust things in any way you like with just a few keystrokes. From some of your comments, it sounds like you're just getting started with this so head over to the forums and post some of your questions individually. Everything you want to do is simple. You just don't quite have your arms around all of it yet... which is expected.

    It's easy to remove trunks you don't need. Just delete them. We send these providers lots of customers. They're not complaining about zombie traffic. It's easy to alter the dial strings to accomodate any dialing preference your users might have in Outbound Routes. It's easy to route outbound calls from a particular extension to a particular Google Voice trunk. Just use Custom Contexts. It's easy to route incoming Google Voice calls directly to particular extensions. Just alter the Inbound Route for each DID. The fake ring you hear supports a feature called the Stealth AutoAttendant. It allows you or someone that knows the codes to access particular PBX features before a call is actually passed to a ring group. Google it! And good luck.]

  2. What most people don’t realize is that a PBX is designed to be used by a business. Sure, you can use one at your home, but the features available are going to be overwhelming in the face of a simple answering machine, which is all a home really needs. Having a PBX in a home is like having an enterprise-level server in a home: way too much power for what’s required.

    Not that I’m complaining. I love the idea of having the stealth auto-attendant and being able to get DID access to my home phone lines, but with cell phone carriers going more and more to unlimited time plans, the point of IP telephony is kind of moot.

  3. Also, to Dan: you might want to look into an Obihai device. Do a google search for it. It’s a SIP ATA that natively supports Google Voice. Also, if you have several on your network, you can use a special number (included with each device) to call any other Obihai device directly. No (other) equipment needed.

  4. Dan says:

    Thanks Ward and Trousle for your comments. Did I comment to the wrong blog post? My understanding is that Incredible PBX 2.0 is the prerequisite add-on for PBX in a Flash, to use GV as a trunk. It’s on the feature list at http://nerdvittles.com/?p=764 All I know is that the GV tab on PBXiaF was just a placeholder before I added IPBX. This blog post discusses using GV as well, so It seemed reasonable to conclude that it’s talking about PBXiaF/Red+IPBX2 and is on-topic for my concerns about streamlining GV behavior.

    The snippet above about enabling GV Voicemail is about as close to any of my to-do items as I’ve been able to find in any forums or blog posts. That’s why I commented here as a starting point. BTW, would you mind explaining how it changes PBXiaF’s behavior? I’m now wary of words like “enables” “works” and “easy to” without further qualification. :P

    I’m grateful that PBXiaF provides a web GUI through which I can make changes instead of editing config files directly. IMHO, like webmin/usermin/ctlpanel and other web GUIs, it still doesn’t organize things intuitively, or describe them such that a newbie recognizes what much of it is used for. I’m not asking for setup wizards (but wouldn’t complain if they materialized), but, for instance, there’s no clue as to which settings are simply optional.

    I have a background in network installation and ISP support. I worked in a NOC with Nagios, Solar Winds, and plenty of other web-based tools. I’m comfortable with enterprise-level servers. It seems fairer to me to say that PBXiaF is a time saver for folks who already learned how to do everything from the command line. If there are “just a few clicks” to do “anything I want” then heaven help me: What Are Those Clicks? The pop-up descriptions usually just echo the title of the item, “Blivit Threshold – This facilitates adjustment of the threshold of the blivit”, thanks a bunch.

    “Just delete them” Uh, no. If I don’t take screen shots I’ll probably have to reinstall the server to get those configurations back later, when i’m ready to play with them. How about “Just add a prominent [x]Enable checkbox and have it off by default? I don’t like to crush and burn that which I can just unplug and save for later.

    “PBX is… for businesses”. Ok, then consider that it violates GV TOS to use it for business. With that in mind, should GV trunks really be installed in a corporate call-center sort of configuration by default? Anyway, I’m not overwhelmed or frightened by PBX’s dangerous, raw power. It plays nice enough with my other VMs. But as long as the “stealth auto-attendant” does not play nice with GV, it has to go. Oh look, someone thought it was so useful that they didn’t provide an off button for it.

    Custom Contexts: for each extension, mine says “Allow All” and offers no other choices. And this is really in reference to the ATA device. The Outbound Routes for each GV trunk already has a single “Trunk Sequence for Matched Routes” entry that lists the specific GV account which also rings in to that extension. Yet, PBX still treats all of the GV trunks like a pool, and calls made from anybody’s extensions still dial out on one particular person’s private number, complete with his CID.

    The Obihai device is certainly very cool, but I’m not going to replace all my perfectly good SIP ATAs with still-expensive proprietary devices. SIP isn’t obsolete yet. We just need a simple GV-to-SIP bridge just like Gizmo5 provided, so we can continue to use GV services. PBXiaF+IPBX does exactly that. Except that it does additional undesired things to my GV calls *by design* and not by accident. My obstacle isn’t IPBX’s lack of ability, it’s the lack of OFF button for some unwanted features.

    [WM: Just to be clear, we write our columns and our apps for hobbyists, not businesses! Hate to say it, but you're like a lot of us. You prefer to explore rather than read. If you had read the article above, you would know that Google Voice is an integral part of PBX in a Flash as well as Incredible PBX. Menu items in FreePBX aren't placeholders. They're all "LIVE." As for an OFF button, that's a great idea. It's now been implemented together with support for 12 ITHPs. For existing installs, if you click on each of your offending Trunks, you'll find a Disable Trunk checkbox. Finally, as I recommended previously, come join the PIAF Forum. You'll learn a lot, and some of your suggestions are worth further exploration. Most of the Dev Teams don't read blog comments regularly. They do read the forums. :HINT: ]

  5. dan says:

    amazing free product, this is the best and most user friendly open source product I’ve ever used. I just wanted to point out 1 thing: I’ve set up my box just like in the instructions above nothing fancy, just 1 google voice trunk and 1 extension and I noticed a quirk: using X-Lite free, if you “decline” an incoming call it will not send it to the PIAF voicemail. It will send it to GV voicemail. If you let the call ring and ring and go to voicemail, then the PIAF voicemail will get it. I’m not sure if everyone is having this issue or just me. It’d be nice if it went to PIAF voicemail.

  6. dishjuarez says:

    A question for all, I have piaf using for years, but I’m trying switchbox and is excellent, has the problem that is too expensive, is as good as the piaf in a production environment with 200 extensions to the local government?

  7. dan says:

    As a follow up to my post above, the free and open source jitsi sip phone seems to work better than x-lite free. when you decline a call it goes to the incrediblepbx voicemail, not the gmail.

  8. Pedrop says:

    As detailed and well explained as this article is, it’s missing the basics. What to do when the SF-downloaded CentOS ISO does not start the PIAF menu, at all, ever?

    [WM: CentOS is what CentOS is. We boot from the same kernel as the original CentOS ISO. If it won't boot, then you either have a damaged download (checksums match?) or your (ancient) hardware is no longer supported by CentOS.]

Ringbinder theme by Themocracy