Today we’re again showcasing our article from earlier this summer that shows you how to create a Google Voice hosting platform in the cloud. You have your choice of three hosting platforms priced at $10 to $13 a year. And, if you pay in advance for 3 years, you can double your platform’s RAM or storage space. There now is also a (one-time fee) $15 GVSIP solution for the platforms that don’t include a way to recompile Asterisk. Follow this link for tutorial.

Google Voice has some similarities with opioid addiction. Once you get hooked on free calling in the U.S. and Canada, it’s hard to give it up. When Google torpedoed Google Chat and XMPP connectivity to Google Voice, they left millions of users in the lurch. All of those using packaged versions of Asterisk® including VitalPBX, Elastix, Issabel, Wazo, AsteriskNOW®, and FreePBX® Distro woke up to crickets from their Google Voice trunks. The fallback to the Simonics GV-SIP Gateway also failed. And, for those using ObiHai 100 series devices, they, too, were dead in the water. The easy fix was to install Incredible PBX® with native GVSIP support, but we appreciate that some may prefer other platforms. So today we’ll show you how to build an Asterisk/FreePBX platform in the cloud with virtually identical functionality to the old Simonics gateway except you’ll own it AND it supports GVSIP connectivity to Google Voice using garden-variety SIP trunks from anywhere in the world. Local SIP trunks tied to your cloud-based GVSIP host platform can be set up quickly on any flavor of PBX including 3CX as well as any SIP telephone just as if you had signed up for SIP service with a U.S.-based VoIP provider. And, presto, transparent Google Voice (free) calling returns that’s better and more flexible than ever. Now it works from any SIP platform anywhere.


The way this works goes like this. We’ll show you how to create your own dedicated server in the cloud to host GVSIP trunks for you, your friends, and business acquaintances. You can use any cloud platform you like, but you’ll be hard-pressed to beat the $13 a year deal we’ve struck with HiFormance with Buffalo and Los Angeles locations for Incredible PBX users. There also is an $11.99 per year offering and a $10.00/year offering, both of which are even more appealing for our east and west coast friends. The other advantage is you can create any of these HiFormance platforms with GVSIP in less than 30 minutes. Pay for 3 years up front and you can double your RAM to 4GB just by opening a ticket. We don’t make a dime.


Setting up the GVSIP hosting platform at HiFormance currently is a two-step process. After you sign up for service, choose the Incredible PBX 13-13 option to create your VPS. When the one-minute setup is complete, download and run the GVSIP-NAF installer to add the GVSIP components to your VPS:

cd /root
tar zxvf gvsip-naf-gui.tar.gz
rm -f gvsip-naf-gui.tar.gz
cd gvsip-naf

Once your GVSIP hosting platform in the sky is up and running, here’s the drill. You’ll be operating just like any other VoIP hosting provider. You’ll set up as many Google Voice GVSIP trunks as you like. Be advised that it’s a violation of Google’s terms of service to sell Google Voice services or to create more than one Google Voice account per user. Once your Google Voice trunks are in place, we’ll create a SIP trunk for every VoIP client that needs a dedicated Google Voice line. Then we’ll create routes so that incoming Google Voice calls are redirected to the appropriate client PBX. You can also create extensions for individual phones that need a dedicated Google Voice connection.

On the client side, we’ll walk you through setting up a standard SIP trunk to connect to your dedicated Google Voice line on the cloud-based host. In addition, you’ll need an Inbound Route to tell your PBX where to send incoming calls. And you’ll need an Outbound Route to tell your PBX which calls should be sent out through your hosted Google Voice trunk. For individual SIP phones, the setup process is exactly the same as what you’ve always used for Asterisk or 3CX connectivity except your extension will be hosted on the cloud server rather than on your local PBX.

A word about security. We strongly recommend using a virtual private network for all connections between your GVSIP host server and individual PBXs and SIP phones. The NeoRouter VPN is free, and the client comes preinstalled on every Incredible PBX platform. Simply set up a NeoRouter v2 Free Host on the server of your choice and then register each of your PBXs to obtain a private IP address. This eliminates NAT issues while enhancing the security of all your calls. If you elect to not use a VPN, then whitelist the IP address of every client PBX and SIP phone on the host PBX using the add-ip and add-fqdn utilities in /root.

For purposes of our tutorial today, we’re making several assumptions that you should know about. First, we’re assuming that everyone’s GVSIP trunks being hosted on your cloud-based server are friends. We mean that literally, not in Asterisk-speak. By design, user connections to the host server have not been hardened to insulate one GVSIP client from another so, theoretically, another person with a trunk on the host server could spoof your Google Voice number to place outbound calls using your DID. Stated another way, remote trunks are treated just as if they were local extensions on the host server, and security mechanisms have not been implemented to isolate each user from everyone else. In FreePBX lingo, your remote PBX is connecting to the host server using a from-internal context, i.e. the connection is identical to that of a local user/extension on the host PBX. So choose your friends wisely!

We will be creating a dedicated GVSIP trunk and client SIP trunk on GVSIP-Host in the Cloud with a one-to-one correlation meaning every client SIP trunk will have a dedicated GVSIP trunk on the host server. On the client server, we’ll create a SIP trunk to interconnect with the corresponding client SIP trunk that was set up on GVSIP-Host. Then we’ll set up inbound and outbound routes on GVSIP-Host and the client PBX to get GVSIP calls to and from the client PBX to their desired destinations.

Here’s the actual call flow for GVSIP calls. Incoming GVSIP calls will be answered by the GVSIP trunk on GVSIP-Host. Calls then will be routed to the client’s SIP trunk, then to the interconnected SIP trunk on the local PBX, and then to the desired destination. Outgoing GVSIP calls on the client PBX using a default dial string of NXXNXXXXXX and a hidden prefix of * + 10-digit Google Voice number will be routed through the client SIP trunk to the interconnected SIP trunk on the GVSIP-Host server, then to the GVSIP trunk assigned to the user, and then to the called destination number dialed using Google Voice. To the end user, outgoing calls will be processed just as if one had installed a Google Voice trunk locally and used the NXXNXXXXXX dial string to place outbound calls. Incoming GVSIP calls through GVSIP-Host will be routed to the client PBX and then on to an extension, ring group, or IVR just as if the Google Voice trunk was physically connected to the client PBX. All we’re really adding is a SIP trunk on the host and client PBXs to shuttle the Google Voice calls back and forth where GVSIP functionality is not yet available on the local PBX platform.

We’re assuming you already have built your Incredible PBX GVSIP-Host server in the cloud and added the GVSIP component if it was not already part of the install. For basic setup instructions of the Incredible PBX cloud platform, go here. For instructions on adding the GVSIP-NAF component, go here. Once your GVSIP-Host cloud platform is up and running, here are the steps to interconnect trunks from the GVSIP-Host to Client PBX platforms:

  1. Create Google Voice GVSIP Trunk on GVSIP-Host
  2. Create Client SIP Trunk on GVSIP-Host
  3. Route Incoming GVSIP Calls to Client SIP Trunk on GVSIP-Host
  4. Route Outgoing Calls from Client SIP Trunk to GVSIP Trunk
  5. Create GVSIP-Host SIP Trunk on Client PBX
  6. Route Outgoing Calls to Host SIP Trunk from Client PBX
  7. Route Incoming Host SIP Trunk Calls to Destination on Client PBX

1. Creating a Google Voice GVSIP Trunk on GVSIP-Host

Obtain a Google Voice refresh token and phone number for your GVSIP trunk. Details here.

Then login to GVSIP-Host Linux CLI as root using SSH or Putty. Run the following script to add the GVSIP trunk: /root/gvsip-naf/install-gvsip

Verify that your GVSIP trunk successfully registered with Google Voice using the following command: asterisk -rx "pjsip show registrations"

2. Creating a Client SIP Trunk on GVSIP-Host

Using a web browser, login to the FreePBX GUI on GVSIP-Host as admin. Create a new SIP trunk by navigating to Connectivity:Trunks:Add Trunk:Add chan_sip Trunk. In the General tab, assign a Trunk Name that is descriptive of the client PBX either by location or type of server platform. In the SIP Settings tab, enter the Trunk Name again and then add the following PEER Details. Be sure to make up a very secure password for your secret. We’ll use the same secret when we create the corresponding trunk on the client PBX in step #5 below. Then click Submit button and reload your dialplan.

3. Creating GVSIP Inbound Route on GVSIP-Host

The Inbound Route we’ll be creating on GVSIP-Host tells FreePBX where to route incoming Google Voice GVSIP calls for a particular DID Number so you’ll need your 10-digit Google Voice phone number to create the new inbound route. We also recommend using the Google Voice account name as your Inbound Route Description just to make it easier to decipher which DIDs belong to which Google Voice accounts. Create a new Inbound Route in the FreePBX GUI by choosing Connectivity:Inbound Routes:Add Inbound Route. In the General tab, fill in the form like this example and select the SIP trunk created in Step #2 above as your Set Destination Trunks:

If you wish to enable CallerID Superfecta for CNAM lookups, you can do so in the Other tab before saving your settings and reloading your dialplan.

4. Creating GVSIP Outbound Route on GVSIP-Host

The last piece to put in place on GVSIP-Host is the Outbound Route which tells FreePBX where to send Google Voice calls for this particular DID. It’s important to get this right, or all of your outbound Google Voice calls will fail. Create a new Outbound Route in the FreePBX GUI by choosing Connectivity:Outbound Routes:Add Outbound Route. We’ll be working with the first two tabs in the dialog: Route Settings and Dial Patterns.

In the Route Settings tab, keep in mind that your GVSIP trunks are named GVSIP1 to GVSIPn and corresponding Custom Trunks were created when you initially set up your GVSIP trunk in Step #1, above. You’ll need the GVSIP trunk number in order to choose the correct Trunk Sequence in the template. And you’ll need your 10-digit DID for the Route CID field. You can use any scheme desired for the Route Name although we recommend using either Out-GVSIPn to identify the GVSIP trunk number or Out-GVname specifying your Google Voice account name. Here’s a sample Route Settings template:

Once you have completed the entries, click on the Dial Patterns tab to continue.

In the Dial Patterns tab, we want to add a single dial pattern. In the prepend field, insert the number 1. In the prefix field, insert * followed by the 10-digit GVSIP DID number. In the match pattern field, insert NXXNXXXXXX. Then click Submit button and reload dialplan.

Now we’re ready to set up the SIP Trunk and routes on your client PBX to interconnect it with the GVSIP-Host platform. This setup varies a bit depending upon the type of client PBX you’re actually using. The following describes the setup on FreePBX-based client PBXs. That encompasses any PBX that utilizes the FreePBX GUI including AsteriskNOW, Elastix, Issabel, FreePBX Distro, and RASPBX among others. We’ll cover the outliers separately as time permits. For today, the VitalPBX, PIAF5, and 3CX trunk setups are documented as well.


5. Creating GVSIP-Host SIP Trunk on Client PBX

Using a web browser, login to the FreePBX GUI on your client PBX as admin. Create a new SIP trunk by navigating to Connectivity:Trunks:Add Trunk:Add chan_sip Trunk. We’re going to make entries in both the General tab and the SIP Settings tab.

In the General tab, assign a Trunk Name of GVSIP-Host. In the Outbound CallerID field, insert your 10-digit GVSIP DID number. In the Maximum Channels field, insert 3.

In the SIP Settings Outgoing tab, enter the Trunk Name of GVSIP-Host again and then add the following PEER Details. Be sure to match the very secure secret you used when creating the client PBX SIP trunk on the host machine in step #2 above. Replace in the example with the IP address of your GVSIP-Host machine. Again, using a private VPN address is preferable because it won’t require you to whitelist the IP address of your client PBX in the GVSIP-Host firewall using add-ip. NOTE: If your client PBX is behind a NAT-based firewall, you will need to add nat=yes to your PEER Details as well.

The Registration String shown in the example actually goes in the SIP Settings Incoming tab, not in PEER Details. Clean out the existing entries in the Incoming tab and insert in the Registration String the entries shown in the sample using the Trunk Name assigned in Step #2 above, your secret from step #2 above, the IP address of GVSIP-Host, and the actual 10-digit GVSIP DID number. Then click Submit button and reload your dialplan.

If your client PBX happens to be a VitalPBX server, the Trunk setup is slightly different even though the Outbound and Inbound routes are nearly identical. Here’s a Trunk template for you to follow. Replace in the example with the IP address of your GVSIP-Host.

If your client PBX is a PIAF5 or 3CX server, the Trunk setup would look similar to the following. The Outbound and Inbound routes are virtually identical to the FreePBX setup. Replace in the Server IP field with the IP address of your GVSIP-Host. Insert your 10-digit GVSIP DID in the Main Trunk No field.

6. Creating Outbound GVSIP Call Route on Client PBX

Create a new Outbound Route in the FreePBX GUI of your client PBX by choosing Connectivity:Outbound Routes:Add Outbound Route. We’ll be working with the first two tabs in the dialog: Route Settings and Dial Patterns.

In the Route Settings tab, fill out the template as shown below inserting your actual 10-digit GVSIP DID for the Route CID:

In the Dial Patterns tab, we’ll be creating a single Dial Pattern. In the prepend field, insert * followed by your 10-digital GVSIP DID number. Leave the prefix field blank. In the match pattern field, insert NXXNXXXXXX. Click Submit when you’re finished and reload dialplan.

7. Creating Inbound GVSIP Call Route on Client PBX

For the Inbound Route on the client PBX, we’ll be defining where incoming GVSIP calls from GVSIP-Host should be routed. Create a new Inbound Route in the FreePBX GUI of the client PBX by choosing Connectivity:Inbound Routes:Add Inbound Route. In the General tab, fill in the form like this example using the actual DID Number of your GVSIP trunk. For the Destination, you can choose an Extension, Ring Group, IVR, or any of the other traditional destinations for incoming calls. You’ve already deciphered the CNAM information with CallerID Superfecta on GVSIP-Host, if desired, so there’s no need to repeat the drill on the client PBX. Click Submit and reload your dialplan when you’re finished.

Creating Extensions on GVSIP-Host for SIP Phones

We’ll finish up today with a homework assignment that shouldn’t be too hard for any of you that have previously used Asterisk and FreePBX with a SIP phone. We’ve made it easy to integrate extensions for SIP phones into the GVSIP-Host platform. Simply create an extension in FreePBX as you always have. Then create a Google Voice GVSIP trunk on GVSIP-Host to provide calling service to your extension. Add an Inbound Route to redirect calls from the new GVSIP trunk to your extension, and add an Outbound Route to send 10-digit calls dialed from the extension to a particular GVSIP trunk. On the SIP phone side, add the credentials for the extension you created and the IP address of GVSIP-Host, and you’re done. Enjoy!

UPDATE: Just a heads up not to become overly dependent on Google Voice. We discovered today that Google had quietly deleted their thread announcing the demise of Google Voice XMPP service. We alluded to the thread in our Open Letter to Google. Some enterprising folks on the DSLR Forum quickly discovered that cached copies of the thread still existed on Bing and Google. But it gets uglier from here. In Bing’s archive (which had the original content), the Google Community Manager by the name of Dave, states on April 30: "I’d like to hop in here and clarify: Now that the OBi devices have been updated with the new firmware, they are fully compatible. This means you can use both WiFi calling and and (sic) OBi devices. Additionally, at a higher level, the new Google Voice VoIP service is standards compliant and should work with many third party solutions. I hope this helps!" But then someone noticed that Google’s cache of the same thread (which has now been deleted) had the same content except Dave’s post had been edited to remove "[Google Voice] should work with many third party solutions." So much for Google searches being legitimate copies of content. One can’t help wondering, if Google would change something like this without telling anybody, what other content have they "improved?" This would have been a firing offense where I worked for many years. Bottom line: I think it’s reasonable to conclude that Google isn’t being candid about much of anything when it comes to Google Voice and their relationship with Obihai. There are lots of excellent VoIP providers. We’re not sure Google still belongs in that group.


Dale Carnegie Award: Polycom’s PR Man of the Year

Originally published: Monday, July 30, 2018  Updated: Tuesday, October 23, 2018

Support Issues. With any application as sophisticated as this one, you’re bound to have questions. Blog comments are a difficult place to address 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 Forum. It’s the best Asterisk tech support site in the business, and it’s all free! Please have a look and post your support questions there. Unlike some forums, the PIAF Forum is extremely friendly and is supported by literally hundreds of Asterisk gurus and thousands of users just like you. You won’t have to wait long for an answer to your question.

Need help with Asterisk? Join our new MeWe Support Site.


Special Thanks to Our Generous Sponsors

FULL DISCLOSURE: RentPBX, Amazon, Skyetel, Vitelity, DigitalOcean, Vultr, Digium, Sangoma, 3CX, TelecomsXchange and others have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. 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.

Skyetel $50 Free Trial: Enjoy state-of-the-art VoIP service with a $50 free trial and free number porting when you sign up for a Skyetel account. No restrictions on number of simultaneous calls, and triple data center redundancy assures that you never experience a failed call. Tutorial and sign up details available here.

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.

RentPBX, a long-time partner and supporter of PIAF project, is offering generous discounts for Nerd Vittles readers. For all of your Incredible PBX hosting needs, sign up at and use code NOGOTCHAS to get the special pricing. The code will lower the price to $14.99/month, originally $24.99/month. It’s less than 50¢/day.

Print Friendly, PDF & Email

Be Sociable, Share!

This article has 7 comments

  1. Would it be possible to get a "Print" button on the page that removes all the ads so I can print out the article and not waste paper on the ads? Alternately, can you create a .pdf version of the article, that also wouldn’t have the ads?

    I understand that this is a "feature request" that you would want payment for and I am willing to chip in for it. I can’t imagine I’m the only person who would appreciate having this functionality, though.

    [WM: Take a look at the new Print & PDF link at the bottom of each article. It will do almost everything you’re looking for.]

  2. As always, thank you for a GREAT tutorial. Does anybody know how to setup voicemail with this system for a GV number. I assume the regular voicemail setup isn’t available anymore because the "Google Chat" option is no longer available. I tried to create a voicemail for the extension but it’s not picking up, however I’m able to access my voicemail fine using *97 or *98. Anybody else experiencing this issue and know how to fix it?

    [WM: Adjust the ring time for the extension in the FreePBX GUI.]

  3. In Step 2, is there any reason it has to be a chan_sip trunk vs a chan_pjsip trunk?

    [WM: Only reason is because chan_sip trunks are easier to set up.]

  4. I have built the hiformance setup. I am trying to use an obi110 as an ata as ext 701. When I call an external number via the phone on the obi I am told that 701 is busy and leave a msg. Is there any documentation on ata/obi110 configuration? The OBi appears to not direct to the PBX outbound.
    Is there a forum best to ask these Incredible/obi questions?

  5. 10 HiFormance servers at $7.50 each. $75.00
    4 Google Voice Accounts per server. $0.00
    4 CallCentric Sip Trunks per server. $0.00
    All the information from Nerdvittles and Ward Mundy. Priceless

  6. Be advised that HiFormance blocks outbound email ports including port 587 by default. You’ll need to open a ticket with them to use email from your server. You can test whether the port is blocked with the following command:

    telnet 587

Leave a comment

Your email address will not be published. Required fields are marked *