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 for Incredible PBX users. More available options here. The other advantage is you can create a secure HiFormance platform 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
wget http://incrediblepbx.com/gvsip-naf-gui.tar.gz
tar zxvf gvsip-naf-gui.tar.gz
rm -f gvsip-naf-gui.tar.gz
cd gvsip-naf
./install-gvsip

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 10.0.0.3 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 10.0.0.3 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 10.0.0.3 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


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, 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 their 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.

Awesome Vitelity Special. Vitelity has generously offered a terrific discount for Nerd Vittles readers. 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. When you use our special link to sign up, Nerd Vittles gets a few shekels down the road to support our open source development efforts 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 our 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 and four simultaneous channels for just $3.99 a month. To check availability of local numbers and tiers of service from Vitelity, click here. NOTE: You can only use the Nerd Vittles sign-up 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. Any balance is refundable if you decide to discontinue service with Vitelity.


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 www.RentPBX.com 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 4 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?

    [WM: Head to the PIAF Forum for assistance.]

Leave a comment

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

*