Home » Technology » Home Automation » Never Miss a Meeting: Google Calendar Alerts for XiVO

The Most Versatile VoIP Provider: FREE PORTING

Never Miss a Meeting: Google Calendar Alerts for XiVO

Today we’re pleased to dust off an oldie but goodie and to introduce Google Calendar integration for XiVO and Asterisk® 13.1 This gets you a reminder call at any number you choose based upon the Notification time that is set whenever you schedule a meeting or appointment in your Google Calendar. Our special thanks to Terry Wilson for his pioneering work at Digium® on the calendaring API. Together with the flexibility that XiVO affords out of the box, it made this incredibly easy, and the new design makes it simple to support as many Google calendars as you would like.

Calendar Design Methodology. The design of contexts in XiVO makes it easy to keep separate development projects separate. In this way, adding and changing code is straight-forward without having to worry about breaking some other working application in Asterisk. In keeping with this design, Incredible PBX for XiVO separates out different applications into different configuration files in the /etc/asterisk/extensions_extra.d directory. For calendar reminders, we’ve created the calendars.conf template which tells Asterisk what to do when an appointment reminder is triggered for the default myGoogleCal calendar.

As you can see below, this is standard Asterisk dialplan code so you can make it as sophisticated as you like. And you can add separate extensions to manage different calendars and do different things. To get you started, here’s what gets generated when you run today’s setup script. It tells XiVO to place a call to the notification number you have chosen and play a message using the Festival TTS engine that announces the time and location of a scheduled event from your Google Calendar:


exten => 225,1,Answer
exten => 225,n,Wait(1)
exten => 225,n,Festival("Here is an appointment reminder from your Google calendar: ")
exten => 225,n,Festival("${CALENDAR_EVENT(summary)} at ${STRFTIME(${CALENDAR_EVENT(start)},,%l:%M %p: local time %A)} at ${CALENDAR_EVENT(location)} ${CALENDAR_EVENT(description)}. Have a nice day. Good bye.")
exten => 225,n,Hangup

The Asterisk design for calendar reminders is equally intuitive. For each calendar, you create a context in /etc/asterisk/calendar.conf to identify the calendar, your credentials, and the Asterisk context, the extension and notification phone number which will be triggered when a calendar reminder (known as a Notification) is triggered. In the initial setup today, we will generate the [myGoogleCal] context with all of the required pieces:2

Once the setup is finished, you can run the following command to tell you the status of your Google Calendar upcoming events for the next two hours. These events get refreshed by Asterisk every 10 minutes based upon the current entries in your calendar.

asterisk -rx "calendar show calendar myGoogleCal"

Once you integrate Google Calendar into Incredible PBX, you can use it to alert you to upcoming appointments. You can also schedule and activate conference calls, and even log the date, time, length, and recipient of all your outbound and/or incoming phone calls. For today, we’ll get the basic pieces installed and functioning. And we’ll set up a simple reminder system based upon appointment entries in your Google Calendar. We’ll also give you some good reference materials so that you can take it from there. This is one of Asterisk’s most powerful features and one where a little study will reward you handsomely. And, as we said, XiVO makes it easy!

Prerequisites. As mentioned, you’ll need a Gmail account to which your Google Calendar is attached. NOTE: Gmail accounts with 2-Step Verification cannot be accessed using your regular Gmail password, but there’s a simple work-around covered in this footnote.3 You also need to first install Incredible PBX for XiVO. By default, you’ll need at least one outbound trunk that supports calls in the same format that you plan to use with your calendar alerts. For NANPA trunks, it will be a 10-digit number, but any other dial string is supported so long as you have enabled AND tested it in XiVO. Then just follow along in today’s tutorial. The entire setup process only takes a couple minutes, and the setup script is licensed as GPL code so knock yourself out and make any changes desired to meet your own requirements.

Installation. Once you have Incredible PBX for XiVO up and running, make a test call from any extension to the phone number you plan to use for Google Calendar notifications. When you’re satisfied that you can reach that number from a XiVO extension, then it’s time to download the installer and run it. Log into your server as root and issue the following commands. Plug in your Gmail credentials and the 10-digit (or other format) notification number when prompted. If you decide to change your Google Calendar or notification number down the road, simply run the setup script again. Be advised that it will always overwrite all of the existing contents of /etc/asterisk/calendar.conf and /etc/asterisk/extensions_extra.d/calendars.conf.

cd /root
wget http://incrediblepbx.com/setup-xivo-cal.sh
chmod +x setup-xivo-cal.sh

Test Drive. The proof is in the pudding, as they say. So set up an appointment in your Google Calendar that’s about an hour in the future, and set the Notification time to 30 minutes. You should receive a call in about 30 minutes assuming your Google Calendar and XiVO server are in the same time zone. For additional tips and tricks, start here. Enjoy!

Originally published: Monday, September 19, 2016

Don’t forget to List Yourself in Directory Assistance so everyone can find you by dialing 411. And add your numbers to the Do Not Call Registry. Or just call 888-382-1222 from your new number. Last but not least, set up the FCC’s BlackList on your server and kiss the RoboCallers goodbye.


Need help with Asterisk? Come join the PBX in a Flash Forum.


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…

  1. We originally introduced this five years ago in the Asterisk 1.8 days. We’ve now upgraded everything to support Incredible PBX for XiVO with Asterisk 13. []
  2. Note that you can set an AutoReminder to schedule a call for every appointment at the same preconfigured interval. This will override all individual Notifications that are set on a per-appointment basis. []
  3. For Google accounts with 2-Step Verification, simply create an Application-Specific Password. Select the Application (Calendar), select your device (Other: XiVO), and click Generate. When setting up Google Calendar Alerts for XiVO, use your actual Gmail address and substitute the 16-character password that is generated for your standard Google password. []

1 Comment

  1. Howdy Nerd Uno – Ummm, have you looked at the new and improved website in Firefox? Either Linux or Windows? I’m guessing probably not. The once easy to navigate, easy to read, ultimately helpful and entertaining display has degenerated to a narrow column slightly left of the center of the page. Sometimes not wide enough to hold a whole long word, like Raspberry, for example. Some of us do not (or cannot) use Internet Exploder or whatever the new name is. Have pity on us poor Linux folks!

    [WM: We test with Firefox and Chrome on Windows machines and Macs. Main column is at least 600 pixels on all machines we have tested.]

Comments are closed.