System information

When the event rolls around, Asterisk will generate a call to you and play back the
sound file this-is-yr-wakeup-call. The output on the console would look like this:
-- Dialing SIP/0000FFFF0001 for notification on calendar myGoogleCal
== Using SIP RTP CoS mark 5
-- Called 0000FFFF0001
-- SIP/0000FFFF0001-00000001 is ringing
-- SIP/0000FFFF0001-00000001 connected line has changed, passing it to
Calendar/myGoogleCal-5fd3c52
-- SIP/0000FFFF0001-00000001 answered Calendar/myGoogleCal-5fd3c52
-- <SIP/0000FFFF0001-00000001> Playing 'this-is-yr-wakeup-call.ulaw'
(language 'en')
If you modify the calendar event so it’s just a couple of minutes in the
future, you can trigger the events quickly by unloading and then loading
the res_calendar_caldav.so module from the Asterisk console. By doing
that, you’ll trigger Asterisk to generate the call immediately.
Remember that our refresh rate is set to 15 minutes and we’re gathering 60 minutes’
worth of events. You might have to adjust these numbers if you wish to test this out on
your development server.
Scheduling calls between two participants
In this example we’re going to show how you can use a combination of some simple
dialplan and the CALENDAR_EVENT() dialplan function to generate a call between two
participants based on the information in the location field. We’re going to fill in the
location field with 0000FFFF0002, which is the SIP device we wish to call after answering
our reminder.
We haven’t specified SIP/0000FFFF0002 directly in the calendar event
because we want to be a bit more secure with what we accept. Because
we’re going to filter out anything but alphanumeric characters, we won’t
be able to accept a forward slash as the separator between the technology
and the location (e.g., SIP/0000FFFF0001). We could certainly allow this,
but then we would run the risk of people making expensive outbound
calls, especially if a user opens his calendar publicly or is compromised.
With the method we’re going to employ, we simply limit our risk.
Add the following dialplan to your extensions.conf file:
[AutomatedMeetingSetup]
exten => start,1,Verbose(2,Triggering meeting setup for two participants)
same => n,Set(DeviceToDial=${FILTER(0-9A-Za-z,${CALENDAR_EVENT(location)})})
same => n,Dial(SIP/${DeviceToDial},30)
same => n,Hangup()
Calendar Integration | 403