Home » Technology » The Incredible PBX: Adding Multiple Google Voice Trunks

The Most Versatile VoIP Provider: FREE PORTING

The Incredible PBX: Adding Multiple Google Voice Trunks

About the only drawback to Google Voice's free U.S. and Canada calling with the Incredible PBX has been the fact that you could only make one outbound call at a time... at least on Google's nickel. So today we'll fix that, and you can enjoy simultaneous outbound calls using as many Google Voice trunks as you have signed up for. If you're in the U.S., you're eligible and no invitation is required. Just head over to the Google Voice site to register.

Today's Incredible PBX enhancement also will permit you to set up multiple inbound DIDs for different area codes across the country which may save your out-of-town friends and relatives a little change when they want to contact you. And to think we had $200 a month phone bills in our college days just to call the hometown honey. The wonders of modern technology!

Prerequisites. Here's what you'll need to get started today. First, you need a functioning Incredible PBX. So start by installing Incredible PBX. Second, you'll need a second Google Voice account. And finally, you'll need an additional SIPgate One number.

Installation Assumptions. We'll walk you through the steps to get a second account activated with the Incredible PBX. If you need more than two, just repeat the steps below and substitute a new number for 2 in every step. As with baking cookies, if you skip a step, the cookies taste like crap. 🙂 For security reasons, we're using an additional SIPgate One account for the second setup. This avoids having to open up SIP access in your firewall which would require additional locking down of IPtables to specific SIP IP addresses.

Setting Up New SIPgate and Google Voice Accounts. As was true with the initial Incredible PBX setup, the first steps in activating a second line are to create and configure your SIPgate account and then tie that number into your new Google Voice account. For ease of reference, we've repeated below the pertinent portions of the original Nerd Vittles article.

Configuring SIPgate. If you live in the U.S. and have a cellphone, we'd recommend the SIPgate option since no adjustment of your hardware-based firewall is required. Otherwise, skip to the IPkall setup below. Step #1 is to request a SIPgate invite at this link. You'll need to enter your U.S. cellphone number to receive the SMS message with your invitation code. Don't worry. You can erase your cellphone number from your account once it is set up and working properly. Once you receive the invite code, enter it and choose the option to set up a residential account. Next, choose a phone number and write it down. The area code really doesn't matter because Google Voice is the only one that will be calling this number after we get things set up. For now, leave your cellphone number in place so that you can receive your confirmation call from Google Voice in the next step. After that, you'll want to revisit SIPgate and remove all parallel calling numbers. Finally, click on the Settings link and write down your SIP ID and SIP Password. You'll need these in a few minutes to complete the configuration of The Incredible PBX. Now place a call to your new SIPgate number and make certain that your cellphone rings before proceeding.

Configuring Google Voice. Once you've signed up for a new Google Voice account, choose a telephone number and plug in your new SIPgate number as the destination for your Google Voice calls and choose Office as the Phone Type.

Google Voice will place a test call to your number which SIPgate will forward to your cellphone. Enter the two-digit code that's displayed when you're prompted to do so.

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

  • Call Screening - OFF
  • Call Presentation - OFF
  • Caller ID (In) - Display Caller's Number
  • Caller ID (Out) - Don't Change Anything
  • Do Not Disturb - OFF

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.

Once you've confirmed your Google Voice number, revisit SIPgate and remove all parallel calling numbers including your cell number. Be sure you've written down your SIPid and SIPpassword while you're there!

FreePBX Overview. Don't be intimidated by the FreePBX setup instructions which follow. All we're really doing is cloning the original pieces of information that made Google Voice work in the initial Incredible PBX setup. For most of the items, we'll just tack a 2 onto the names previously used. Nothing prevents your adding 3, 4, and 5 accounts down the road if you have additional Google Voice and SIPgate accounts to support each iteration.

To begin, use a web browser to open FreePBX on your Incredible PBX. Using the actual private IP address of your server, go to the following link: http://192.168.0.33/admin.

Adding Parking Lot Slots. As originally configured, the Incredible PBX provides 5 parking lot slots for use on your PBX. These are numbers that let you temporarily "park" calls so that they can be picked up on another extension. One of those slots (75) is used by the Incredible PBX to place outbound Google Voice calls. If you want the ability to place simultaneous outbound Google Voice calls using multiple trunks, then we need additional parking lot slots for each simultaneous call. We recommend bumping up the number of parking lot slots from 5 to 9. Then you can use 75-79 for up to 5 simultaneous outbound calls with Google Voice. Here's how. In FreePBX, choose Setup, Parking Lot, Number of Slots: 9. Your entries should look like this screen shot:

When you've made the change, click Submit Changes, Apply Configuration Changes, Continue with Reload.

Creating Additional Custom Destinations. You'll recall that Google Voice actually places two calls when you make an outbound call. First, Google Voice calls you back. Then Google Voice places a call to your desired destination. The callback to you is handled transparently in Incredible PBX using pygooglevoice and Asterisk®'s parking lot feature. To handle multiple simultaneous calls, you'll need additional custom destinations. Here's how. In FreePBX, choose Tools, Custom Destinations, Add Custom Destination. Then make your new entries for custom-park2 look like this:

When you've made the entries and carefully checked them, click Submit Changes, Apply Configuration Changes, Continue with Reload.

Creating Additional Inbound Routes. Now we need an additional Inbound Route to handle the second incoming call generated by Google Voice. Here's how. In FreePBX, choose Setup, Inbound Routes, Add Incoming Route, gv-ringback2. Make the entries shown in the screenshot below substituting your 10-digit SIPgate/IPkall and Google Voice numbers in the appropriate fields. Be sure to choose Custom GV-Park2 as the Custom Destination for this Inbound Route. Check your entries carefully, a typo here will kill completion of the calls!

When you've made the entries and carefully checked them, click Submit, Apply Configuration Changes, Continue with Reload.

Creating Additional Custom Trunks. With every telephony provider, Asterisk needs a Trunk. In the case of Google Voice, we need a Custom Trunk for each Google Voice number to be used on your Incredible PBX. Think of a trunk as the bucket where Asterisk dumps an outbound call for processing. Two calls require two buckets. Three calls, three buckets. And so on. Well, that's almost true. Some providers can handle multiple calls, but Google Voice doesn't. So we need to make two changes in your trunk setup. First, we'll adjust the original Custom Trunk for Google Voice and limit it to one simultaneous call at a time. Then, we'll add a new Custom Trunk to support the second Google Voice account. Here's how.

In FreePBX, choose Setup, Trunks. In the right column, you'll see a list of all your existing trunks. Click on the second entry that looks like this: local/$OUTNUM$@ (custom). Be sure the Custom Dial String looks like what is shown below. If not, choose another trunk until you find the right one. Then make an entry of 1 in the Maximum Channels field:

When you've made the entry and carefully checked it, click Submit Changes, Apply Configuration Changes, Continue with Reload.

Now we're ready to Add the additional Custom Trunk. In FreePBX, choose Setup, Trunks, Add Custom Trunk. Make your entries look like what's shown below:

When you've made the Maximum Channels and Custom Dial String entries shown above and carefully checked them, click Submit Changes, Apply Configuration Changes, Continue with Reload.

Creating Additional Outbound Routes. FreePBX uses Outbound Routes to do just what the name implies: to route outbound calls to their destination. Outbound Routes are processed in the order in which they appear in the FreePBX Outbound Routes listing. We need to make three changes in the Outbound Routes processing to support a second Google Voice call path. First, we want to modify the existing Default Outbound Route to accommodate the second Google Voice account. Second, we want to add a new Outbound Route for the second Google Voice account so that calls can be placed directly with this route using a different dialing prefix. You'll recall that Google Voice calls in the Incredible PBX can optionally be dialed using the 48 prefix followed by a 10-digit number. The 48 spells GV on the phone key pad. So we'll add a new Outbound Route with a 482 (GV2) prefix which will tell Asterisk to route these calls out using the second Google Voice account. These prefixes can be anything you desire incidentally. Third, we'll need to move this new route UP the routes list so that it appears above and gets processed before the Default route. Here's how.

In FreePBX, choose Setup, Outbound Routes, Default. In the blank Trunk Sequence pulldown, choose the following entry: local/$OUTNUM#@custom-gv2. Now click the Add button. This should leave you with 3 outbound routes numbered 0, 1, and 2. Be sure your entries match the following:

When you've made the entry and carefully checked it, click Submit Changes, Apply Configuration Changes, Continue with Reload.

Now we're ready to add a new Outbound Route to support a custom dialing prefix for the second Google Voice account. In FreePBX, choose Setup, Outbound Routes. In the Add Route form, make the following entries:

When you've made the entries, click Submit Changes, Apply Configuration Changes, Continue with Reload.

Finally, look at the listing of Routes in the Right Margin. Using the arrow beside GoogleVoice2, move it up until it is just beneath the GoogleVoice entry. Then click Apply Config Changes, Continue with Reload.

Adding Additional SIPgate Trunks. If you set up your Incredible PBX originally using IPkall, then there already will be a sipgate trunk that can be used for this second line. Otherwise, you'll need to create a new sipgate2 trunk and clone the setup from the original sipgate trunk. Within FreePBX, goto Setup, Trunks and either Add a new SIP trunk or edit the existing sipgate trunk if it isn't already in use. If this is a newly added trunk, enter sipgate2 as the Trunk Name. The PEER Details under Outgoing Settings should be added so they look like this (substituting your actual SIPid and SIPpassword that were obtained from the SIPgate registration page:

type=peer
username=SIPid
fromuser=SIPid
secret=SIPpassword
context=from-trunk
host=sipgate.com
fromdomain=sipgate.com
insecure=very
caninvite=no
canreinvite=no
nat=yes
disallow=all
allow=ulaw&alaw

Blank out any data that's entered in the Incoming Settings section of the form. Then enter a Registration String with your actual SIPid, SIPpassword, and 10-digit SIPgate phone number:

SIPid:SIPpassword@sipgate.com/SIPphonenumber

Check your entries carefully for typos. Then click Submit Changes, Apply Configuration Changes, Continue with Reload.

Now is a good time to check and be sure the new SIPgate trunk registered with SIPgate. In FreePBX, choose Tools, Asterisk Info, SIP Info. Your newly created SIPgate trunk should display as Registered. If it says Request Sent, then you've got a typo in your credentials.

That takes care of all the FreePBX settings needed to support a second Google Voice number. Now we just need to add a chunk of dialplan code to Asterisk and restart Asterisk. Then you'll be ready to go. All of this is handled by a simple Nerd Vittles script so... not to worry! It's easy.

Adding Dialplan Code for Additional Trunks. Log into your server as root, and issue the following commands to download and run the dialplan configuration script. For future reference, be advised that there are configuration scripts for gv2, gv3, gv4, and gv5 with corresponding names.

cd /root
wget http://incrediblepbx.com/configure-gv2
chmod +x configure-gv2
./configure-gv2

When prompted, enter your 10-digit Google Voice phone number, your Google Voice email address, your Google Voice password, and your 10-digit SIPgate RingBack number. Check your work and then press the Enter key to adjust your dialplan and reload Asterisk. You now have a 2-line Incredible PBX. Enjoy!

The Incredible PBX: Basic Installation Guide

Adding Skype to The Incredible PBX

Adding Incredible Backup... and Restore to The Incredible PBX

Adding Remotes, Preserving Security with The Incredible PBX

Remote Phone Meets Travelin' Man with The Incredible PBX

Continue reading Basic Installation Guide, Part II.

Continue reading Basic Installation Guide, Part III.

Continue reading Basic Installation Guide, Part IV.

Support Issues. With any application as sophisticated as this one, you're bound to have questions. Blog comments are a terrible place to handle support issues although we welcome general comments about our articles and software. If you have particular support issues, we encourage you to get actively involved in the PBX in a Flash Forums. It's the best Asterisk tech support site in the business, and it's all free! We maintain a thread with the latest Patches and Bug Fixes for Incredible PBX. Please have a look. Unlike some forums, ours is extremely friendly and is supported by literally hundreds of Asterisk gurus and thousands of ordinary users just like you. So you won't have to wait long for an answer to your questions.



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.


 

Special Thanks to Our Generous Sponsors


FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.

BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.

The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.

VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
 

Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
 


Some Recent Nerd Vittles Articles of Interest...


12 Comments

  1. Is it possible to run multiple google trunks with the older Orgasmatron 5.2? If not can I backup all my current settings in Orgasmatron 5.2 and then restore them to Incredible PBX?

    Kind of a n00b to all of this but I understand it fully.

    [WM: Should be fine. Make a backup first. 🙂 ]

  2. Alright, I know I’ve asked this before, and it seems like a setup like this isn’t really what I’m looking for, but… is there any way to get this to work with Google Voice’s built-in voicemail system and not Asterisk’s? Or is that sort of thing just not possible with an Asterisk-GV setup?

    WM: As long as your Asterisk extensions don’t have voicemail activated, you could use GV’s voicemail with no problem.

  3. Love it. I have multiple lines added and running. I am very OCD and one thing that bothered me were all the additional lines were named with numbers, such as gv2, gv3, gv4, etc…. However, the first line was not gv1 but rather just gv.

    I went through and fixed it but I needed to modify some conf files and hop into mysql to change the custom destination of "Custom GV-Park" to "Custom GV-Park1″. For some reason, the custom destination field is not editable in freepbx.

    I wanted to leave a comment about this in case someone else wants to do the same and is trying to figure out how to change the custom destination field of "Custom GV-Park". it is in the table custom_destinations in the asterisk mysql db

  4. When I try to get a second SIPGate account, it tells me there was a technical error. Is anyone else having problems getting a second SIPGate number? Am I allowed to use the same cell phone that I used for the first one when requesting the second one?

    [WM: We’ve previously used the same cell phone number more than once, but that doesn’t mean they haven’t tightened things up.]

  5. @Jonathan Frederickson: I want the same thing, the only thing I will add to the great Nerd Vittle is that you also cannot have fax detect on the line. It seems that delay where it is looking for the fax makes Google think that you picked up.

  6. As of today, Google Voice is available for everyone without an invite (which is strange because I also just got 3 invites on one of my Google Voice numbers today as well, now that they are no longer needed).

  7. i am feeling pretty stupid here, so i did what is outlined above, and am failing to see how i use the other lines i have setup? or is it set to use first avaible then next out call uses first free line too ? please point me to post on forums if this has been covered, BTW usin pbiaf bronze, could not get the purple to dial out for me even after fix so i’m running on bronze

  8. A major SIP security vulnerability was discovered in all versions of Asterisk today. You can read all about it here.

    We have developed a script for Asterisk 1.8.x which will quickly patch your system and eliminate the problem. Log into your server as root and issue the following commands:

    cd /root
    wget http://incrediblepbx.com/sipfix
    chmod +x sipfix
    ./sipfix

    Please apply this patch immediately to protect your server!

  9. This article is no longer needed, since 1.8 native gv support. Now, there is support (built in) for simultaneous (channels) outgoing and incoming calls using the same gv trunk(google voice number). You can simultaneously make a call and receive a call on the same gv trunk (google voice number). Or, you can make two (or more calls) simultaneously! from the same gv trunk (google voice number, as long as it’s not the same number called). Hunt groups are a thing in the past … since simultaneous incoming calls (tested up to 5)to the same gv trunk (google voice number). This is amazing! Simple, and functional. The phone industry will never be the same again. If you are a business or a hotel that is paying for multiple lines, dump your phone company and make the switch to asterisk today!

Comments are closed.