For those using PBX in a Flash or The Incredible PBX with at least one Google Voice trunk configured, there’s a simple way to send Jabber alerts to your Gmail desktop and SMS alerts to your cellphone to notify you of incoming calls to your Asterisk® server. Meet GV Call Notifier. The setup only takes a couple of minutes, and it provides instantaneous Asterisk call notification when new calls arrive on your system.
Prerequisites. You’ll need a PIAF2 server with or without Incredible PBX to use today’s GV Call Notifier. Set up at least one dedicated Google Voice account in PIAF2 using FreePBX. Remember that Google Voice requires that one outbound call be made with your new account using a browser before it will work interactively with PBX in a Flash.
Because we will be using Google’s Chat facility to send alerts, you also will need to interactively enable chat communications between your Google Voice account (used in PIAF2) and whatever Gmail destination(s) you plan to use as the recipient of the Jabber alerts. The easy way to do this is to open two different browsers. Sign in to Gmail on one with your primary Gmail account, and sign into Gmail on the other one with your PIAF2 Google Voice account credentials. Now use the Chat option in Gmail to send a message in both directions between the two accounts. Don’t forget to sign out of the Google Voice account, or it will no longer work to receive incoming calls in PIAF2.
Configuration Steps. To make this work, we need to adjust the context configuration for the trunks you wish to monitor. You may recall that, when you set up a new trunk, one of the entries looked like this: context=from-trunk. That’s the default incoming trunk context for FreePBX® trunks. What we need to do is replace the existing context entry with a custom context. Let’s call it incoming-alert. Here’s what a typical setup looks like. Click here to download a copy to your Desktop for editing because you need to add your own credentials.
[incoming-alert]
exten => 8431234567,1,Goto(s,1)
exten => s,1,Set(GVACCT=acctname) ; your Google Voice account name without @gmail.com
exten => s,2,Set(GVPASS=password) ; your Google Voice account password
exten => s,3,Set(EMAIL_NOTIFY=yourname@gmail.com) ; Gmail address to receive Jabber alerts
exten => s,4,Set(SMS_NOTIFY=6782223344) ; your cellphone number to receive SMS alters
exten => s,n,Playtones(ring)
exten => s,n,JABBERSend(${GVACCT},${EMAIL_NOTIFY},"Incoming call: ${CALLERID(all)}")
exten => s,n,System(gvoice -e ${GVACCT}@gmail.com -p ${GVPASS} send_sms ${SMS_NOTIFY} "Incoming call: ${CALLERID(all)}")
exten => s,n,Goto(from-trunk,${CALLERID(dnid)},1)
exten => s,n,Hangup
You only have to worry about the first five lines in the context. The first one designates the Trunk DID you want to manage. Just enter the 10-digit or 11-digit DID of the trunk you want to monitor. Whether to use a 10-digit or 11-digit DID depends upon how your trunk provider delivers the incoming calls to your PBX. If you want to manage more than one DID, just clone the first line changing the entry for each DID and then insert the new line below [incoming-alert].
Remember we said you must set up at least one Google Voice account in FreePBX for this to work. The reason is we’re going to use Google Voice to deliver the Jabber and SMS messages. Be sure you’ve interactively completed the Google Chat setup steps above before you continue. Otherwise, your alerts will never be delivered.
In [incoming-alert], modify line s,1 by replacing acctname with your actual Google Voice account name minus @gmail.com. In line s,2 replace password with your Google Voice account password. In line s,3 replace yourname with the Gmail address where you want the Jabber alerts delivered. This typically would be your primary Gmail account, not the account you set up for Google Voice in Asterisk. In line s,4 replace 6782223344 with the 10-digit cellphone number to which you want incoming call SMS alerts delivered. As we said, nothing else needs to be changed. Now cut-and-paste the custom [incoming-alert] context to the end of /etc/asterisk/extensions_custom.conf. Then reload your Asterisk dialplan: asterisk -rx "dialplan reload"
Now we’re ready to make the Trunk adjustments in FreePBX. Using your browser, open up FreePBX by pointing your browser to the IP address of your server with /admin as the destination. Edit the Trunk or Trunks that you configured in the [incoming-alert] context. Find the line that begins with "context" and change it to context=incoming-alert.
NOTE: If the existing entry you’re replacing wasn’t context=from-trunk, then be sure to write down what the context actually was. Then replace the from-trunk entry in the next to last line of [incoming-alert] with whatever context you wrote down.
Save your Trunk change and reload FreePBX when prompted. Then try a test call to this DID to make sure you receive the two alerts.
Install Growl. The other piece you’ll probably want is Growl, a pop-up notification system for Mac OS X or Windows. With Growl in place, you’ll see alerts like the one above whenever a new call arrives.
CallerID Superfecta Notifications. If you didn’t already know, there are seven additional call notifier options which are available as part of CallerID Superfecta. Every Data Source that begins with Send To is actually a call notifier. Take advantage of them. They’re all free! CallerID Superfecta is included in every PIAF2 installation and can be accessed through the FreePBX GUI. It is brought to you by the fine folks at POSSA. Enjoy!
Update: For an alternate approach that we actually like better, see the Comments.
Originally published: Thursday, July 26, 2012
Astricon 2012. Astricon 2012 will be in Atlanta at the Sheraton beginning October 23 through October 25. We hope to see many of you there. We called Atlanta home for over 25 years so we’d love to show you around. Be sure to tug on my sleeve and mention you’d like a free PIAF Thumb Drive. We’ll have a bunch of them to pass out to our loyal supporters. Nerd Vittles readers also can save 20% on your registration by using coupon code: AC12VIT.
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…
After we wrote this article, we were pointed to another approach that we actually like better. Using this new method, you create a "dummy extension" that handles the notifications. And then you add that extension to a Ring Group handling your inbound calls. The advantage of the new approach is that it also works with Google Voice trunks which currently do not expose the context field for adjustment. Here’s a link to the new code and step-by-step instructions. Special thanks to Bill Simon for finding this new method. Brilliant!
This is cool & the gang, but what about us folks who have moved on to much more stability for GV by moving GV handling to YATE?