July 20 NEWS FLASH: This article has been superseded. Google now has discontinued support of their XMPP interface to Google Voice so the latest CentOS/SL versions of Incredible PBX 13-13 (including the Incredible PBX ISO) now incorporate NAF’s GVSIP interface to Google Voice. You can read all about it here. What has changed is you now add unlimited Google Voice trunks from the command line by running /root/gvsip-naf/install-gvsip. You can delete trunks by running /root/gvsip-naf/del-trunk. Once one or more trunks have been added, they are numbered GVSIP1 through GVSIPn. Using the GUI, you then add an Outbound Route and an Inbound Route for each trunk. You’ll need both your Google Voice 10-digit phone number and a Refresh Token to add a new trunk. All of the latest GVSIP enhancements now are documented in this new GVSIP tutorial.

Well, it’s been a wild couple of weeks trying to decipher the future of Google Voice without a shred of documentation from Google. But NAF has worked more than one miracle and has finally pulled it off with an implementation that is every bit as good as the original XMPP configuration. Thanks to a robust PJSIP platform in Asterisk® 13, the building blocks were already there minus a boatload of tweaking to support the new Google Voice platform. Until this weekend, the missing piece was support for multiple Google Voice trunks on a single Asterisk server. But the sky’s the limit now, and we’ve rolled out the first of several new releases for Incredible PBX® 13-13. We’ve started with our CentOS 6 platform and Raspberry Pi installer. Soon we will provide a complete tutorial for Incredible PBX for Ubuntu 18.04 which, by the way, already works with the RasPi installer.

We’ve added a number of new features with the multi-trunk rollout so let’s start there. Obviously, with more than one Google Voice trunk, you need a way to choose which trunk to use to place outbound calls, and you need a method to route inbound calls from the various trunks to different destinations. The new installers handle all of this for you with two trunks. For now, we’ll leave it as a homework assignment for you to figure out how to add more than two trunks if you need them. It’s easy. We also want to document how to better integrate the new GVSIP setup into FreePBX® so that the GUI can be used to define Inbound Routes for your various trunks. This will permit you to route calls to specific DIDs to different individuals or applications.

On the drawing board is a new methodology to transparently integrate Google Voice GVSIP directly into our platforms with a simple way to add and remove GVSIP trunks as the need arises. While GVSIP trunk additions probably will always be managed from the command line, we believe this can be further simplified in much the same way we developed a similar solution for the Wazo platform last year.

Managing Incoming GVSIP Calls in the FreePBX GUI

By default, incoming GVSIP calls are processed by the [from-external-custom] context in extensions_custom.conf. The good news is that this design is highly configurable if you know what you’re doing. The bad news is it’s difficult for new users that would prefer a point-and-click GUI to determine where to send incoming calls from various GVSIP trunks. With the multi-trunk rollout, we’ve modified the design to now assign actual DID numbers to all of your Google Voice trunks. With one simple tweak, you now can shift the destination of incoming GVSIP calls to the [from-trunk] context which in turn lets you utilize FreePBX to define Inbound Routes for each of your Google Voice lines. You also can easily enable or disable fax detection and CallerID Superfecta, all from the convenience of the GUI.


To activate FreePBX management of routing for your incoming GVSIP calls, issue the following commands:

sed -i 's|from-external-custom|from-trunk|' /etc/asterisk/pjsip_custom.conf
amportal restart

Once you’ve activated FreePBX management of the GVSIP inbound routes, log into the GUI using a browser with your admin password and choose Connectivity:Inbound Routes. For each GVSIP trunk, add a new Inbound Route specifying the 10-digit number of trunk for the DID Number. Provide a Description that will help you remember which trunk is which. Then choose a Destination for the incoming calls. To enable CallerID Superfecta, click on the Other tab. If you’ve installed the Incredible Fax add-on, you can enable Fax Detection under the Fax tab. Click the Submit button when finished and reload the FreePBX dialplan when prompted.

And what happens if you forget to set up an Inbound Route for one or more of your GVSIP DIDs? Not to worry. Incredible PBX comes preconfigured with a Default Inbound Route that will catch all of these calls and route them to Allison’s Demo IVR. That will be a big hint that you still have some work to do.

Managing Outgoing GVSIP Calls in the Linux CLI

Unfortunately, FreePBX does not yet have the smarts to handle GVSIP trunks. That means that not only must the trunks be added from the Linux CLI, but you also will need to define how outgoing GVSIP calls should be processed. When you run the GVSIP-NAF installer, you’ll be prompted for whether to install one or two GVSIP trunks. Once you enter your refresh_token and phone number for each of the trunks, the installer will do the heavy lifting for you. When the install finishes and you have rebooted your server, here’s the default setup for outbound calls assuming you chose to set up two GVSIP trunks. When you dial the GV prefix (*48) followed by a 10-digit number, the call will be placed using your first (primary) GVSIP trunk. When you dial the GV prefix (*48) followed by an 11-digit number beginning with 1, the call will be placed using your second GVSIP trunk.

You can edit the [from-internal-custom] context in extensions_custom.conf to eliminate the dialing prefix if you don’t have other trunks on your PBX that use 10-digit or 11-digit dialing. The lines to make this change already are provided in the config file. Simply comment out the *48 lines with semicolons and remove the semicolons in the next section. Then restart Asterisk. In the alternate setup, 10-digit calls will be routed out your primary GVSIP DID while 11-digit calls will be routed out your secondary DID.

Future Design for Outgoing GVSIP Calls

We’re in the early planning process for a future design that supports up to 9 GVSIP trunks on an individual PBX. Believe it or not, there are folks that actually will use most of those trunks. Our current plan is to change the *GV dialing prefixes to *G1 through *G9 (*41-*49). There’s obviously no way to support nine trunks without dialing prefixes, but there is certainly no reason you can’t also use the NXXNXXXXXX and 1NXXNXXXXXX syntax for two of your trunks assuming those dialing sequences aren’t used by other SIP trunks on your server.

Now that you understand the new GVSIP multi-trunk design, you’re ready to get started. Just hop over to the Incredible PBX 13-13 tutorial for CentOS 6 to get started. Enjoy!

Continue reading for the latest developments…

Originally published: Monday, July 9, 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 11 comments

  1. "Unfortunately, FreePBX does not yet have the smarts to handle GVSIP trunks. That means that not only must the trunks be added from the Linux CLI, but you also will need to define how outgoing GVSIP calls should be processed."

    Why? Just define in GUI a custom trunk with dial string "PJSIP/$OUTNUM$@gvsip1″ or "PJSIP/$OUTNUM$@gvsip2″ for the second trunk. This removes the needs for any shenanigans for the outgoing calls. It will just behave as any other trunk.

    [WM: I was referring to the lack of an ability to define the GVSIP trunks as PJSIP trunks in FreePBX. Yes, you can create custom trunks with matching outbound routes, but FreePBX still treats the actual PJSIP trunks as off line. Good idea though for those that are well versed in FreePBX trunking methodology. Thanks.]

  2. Thank you for your hard work on this, but PLEASE. The scenario you describe in this article feels obstinately unfinished, requiring needless tweaks. I think most people will agree that these recipes ought to produce a normal-behaving phone system.

    No funky dialing prefixes. No default pooling of the GV trunks. No arbitrary 9-trunk limits. Do build a simple web-form plugin to manage PJSIP that works just like good ole Motif. During configuration, simply bind a given GV trunk to a particular extension. Like custom contexts. Easy-peasey. All calls coming in on that trunk should ring that extension. All 10-digit calls dialed on that extension should go out that GV trunk.

    [WM: Everybody loves an ingrate. Hey, Phred. GVSIP has been under development for less than 3 weeks. If it’s so "easy-peasy," by all means share your contributions or STFU.]

  3. You can use single prefix with multiple trunks, I do this with 6 gv trunks and prefix “8”, just have it generate a random number between 1-9 and then goto the outbound trunk with that, few things with loosing control and no GUI integration, but you are able to use multiple some what load balanced trunks.

  4. How to get GVSIP in Wazo?

    [WM: It may not be in our lifetime. SOL for now.]

  5. Is there an easy solution to bypass any dial out prefix for a setup with just one google voice number, and no other trunks?

    [WM: In /etc/asterisk, edit extensions_custom.conf and comment out all of the top lines with *48. Then uncomment the next section which is the dialplan code for GV dialing with no dial out prefix. Save the file. Restart Asterisk: amportal restart]

  6. Phred…stop complaining. Ward, thank you for all your great work. I was surprised by your STFU comment. But it was warranted. I know this work isn’t "easy-peasy". I am grateful for all your diligent efforts. I have been running a PIAF Incredible PBX for many years. It has over 90 GV Trunks, and everything just worked (until recently..now there is a one-way audio issue). Sure, it had all those "dialing prefixes", but they worked flawlessly.

  7. Thanks Ward for the detailed write up on how to use NAF’s solution. I do have a question. If we set in FreePBX an outbound route to insert *48 when matching a string dialed, will that make it go through the GVSIP trunk irrespective of any other trunks set in that screen?

    For example, if I had an outbound route that defined that all 212NXXXXXX were to go through the old GV trunk (Motif), could I just change the dial plan to insert *48 on match and then select any random (possibly inactive) trunk at the end, avoiding this way to manual *48 code to my users?

    [WM: If you’re planning to use FreePBX for configuring GVSIP, please hold off for a few days. We have a new installer coming that is specifically targeted for FreePBX administration of GVSIP trunks.

    As for your specific questions, you can use FreePBX outbound routes for GVSIP only after building GVSIP custom trunks in FreePBX. All of this is automatic with the new installer. Once those custom trunks are in place, you can code the outbound routes as desired. FreePBX processes them in top down order and uses the route with the first matching dial string. To assure that a specific route is chosen, simply drag that outbound route up the sequence list.]

  8. Thanks Ward. Regarding the new installer, are those usually meant for fresh installs, or can you run those on a preconfigured PBX? What if I have made changes to extensions_custom.conf that I want preserved?

    [WM: Should work fine on any existing Incredible PBX platform. Always a good idea to make a backup first. We add two new contexts to extensions_custom.conf, but the install won’t disturb your existing settings there.]

  9. Ok, finally was able to get 2 lines working on clean CentOS6 install with the latest GV script. Going to try to add more lines… and will work even better where there are more then 2 PJSIP Lines.

    [WM: New installer for FreePBX-based management of unlimited GVSIP trunks is coming on Monday. 🙂 ]

  10. Does the Virtualbox Image "VitalPBX" (http://nerdvittles.com/?p=25575) contain this GVSIP feature?
    If not will it soon be added to the image?

    [WM: Once all the kinks are ironed out, we will roll out new Incredible PBX builds and images that include GVSIP. For now, you’ll have to build an Incredible PBX platform and then run the GVSIP installer. HINT: A new one is coming for FreePBX on Monday.]

  11. "The new installers handle all of this for you with two trunks. For now, we’ll leave it as a homework assignment for you to figure out how to add more than two trunks if you need them. It’s easy."

    Well that’s quite a homework assignment, i still cant get it. I modified the pjsip.custom.conf and extensions.custom.conf to add a new GV trunk using the same settings as the prior two (gvsip1 and gvsip2) to no avail. Can you give us a hint or more detailed explanation, greatly appreciated.

    [WM: Come join the pioneers and get unlimited GVSIP trunks. 🙂 ]

Leave a comment

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

*