Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hello, Dave. It’s your calendar calling. Terry Wilson, Digium Senior Developer.

Similar presentations

Presentation on theme: "Hello, Dave. It’s your calendar calling. Terry Wilson, Digium Senior Developer."— Presentation transcript:

1 Hello, Dave. It’s your calendar calling. Terry Wilson, Digium Senior Developer

2 Why Asterisk Calendaring?

3 Asterisk needs to know where you are Your availability is best stored in your calendar People already know how to use their calendars Existing calendar notification options are limited Calendar GUIs are good at displaying temporal events--like calls

4 Major features Querying availability status Querying calendar events Writing calendar events Calendar event notification Device state provider

5 res_calendar - Implements the API res_calendar_icalendar -.ics file support res_calendar_caldav - CalDAV calendar support Google calendar, Zimbra, Apple Calendar Server res_calendar_exchange - Exchange 2003 support The components

6 Requirements res_calendar_icalendar libneon, libical res_calendar_caldav libneon, libical, libxml2 res_calendar_exchange libneon, libical, libiksemel

7 Limitations iCalendar by its very nature is read only Exchange support only tested (and probably only works) on Exchange 2003 No support for Exchange “forms-based authentication”

8 The config file [calendar_name] type=caldav ; or ical or exchange timeframe=1440 refresh=15 autoreminder=15 channel=SIP/6001 ; notification options context=calendar_notification extension=s ;or app=Playback appdata=tt-monkeys ; tech-specific options url= secret=mysecret

9 Calendar Asterisk Dialplan calendar I/O functions CALENDAR_BUSY CALENDAR_QUERY CALENDAR_QUERY_RESULT CALENDAR_WRITE Dialplan notification CALENDAR_EVENT Dialplan hints

10 CALENDAR_BUSY Used to query availability status of a particular calendar. It returns ‘0’ for not busy, and ‘1’ for busy. For example, if you have a calendar defined in calendar.conf named ‘mycalendar’, then the following would branch the dialplan based on the result of CALENDAR_BUSY. exten => 123,1,GotoIf(${CALENDAR_BUSY(mycalendar)},busy,available) exten => 123,n(available),Macro(dial-exten,${EXTEN}) exten => 123,n,Hangup exten => 123,n(busy),Voicemail(${EXTEN}@default,u)

11 CALENDAR_QUERY Used to query a specific timeframe for calendar events. Returns an ID to pass to the CALENDAR_QUERY_RESULT function which iterates over the matching events. exten => s,1,Set(id=${CALENDAR_QUERY(mycal,${EPOCH},${EPOCH})}) exten => s,n,NoOp(Summary: ${CALENDAR_QUERY_RESULT(${id},summary)}) exten => s,n,NoOp(Description: ${CALENDAR_QUERY_RESULT($ {id}, description)}) exten => s,n,NoOp(Location: ${CALENDAR_QUERY_RESULT(${id},location)})

12 Calendar Devicestate Monitor the availability status of a calendar with dialplan hints exten => 123,hint,Calendar:mycalendar exten => 123,1,Dial(SIP/mysipdevice)

13 Examples Office hours Call to get a summary of your day A conference call that no one should miss A calendar call record

14 Office hours No need to access the dialplan to make office hour changes Define your business day as a repeating event Holidays can be exceptions


16 [inbound] exten => _X.,1,GotoIf(${CALENDAR_BUSY(office_hours)}?attendant,s,1) exten => _X.,n,Set(id=${CALENDAR_QUERY(office_hours,${EPOCH},${EPOCH})}) exten => _X.,n,Set(sndfile=${CALENDAR_QUERY_RESULT(${id},description)}) exten => _X.,n,Playback(${IF($["${sndfile}"=""]?default-closed:${sndfile})}) exten => _X.,n,Hangup

17 Daily Schedule Call in to get a summary of your schedule for the day Uses res_cepstral to speak the summary of each event in a 24-hour period

18 [internal] exten => 1337,1,Answer exten => 1337,n,Set(id=${CALENDAR_QUERY(mycal,${EPOCH},$[${EPOCH}+24*60*60])}) exten => 1337,n,Set(num=${CALENDAR_QUERY_RESULT(${id},getnum)}) exten => 1337,n,Set(i=1) exten => 1337,n,SayText(Your schedule for the next 24 hours is as follows) exten => 1337,n,While($[${i} <= ${num}]) exten => 1337,n,Playback(from) exten => 1337,n,SayUnixTime(${CALENDAR_QUERY_RESULT(${id},start,${i})},,Q 'digits/at' IMp) exten => 1337,n,SayText(until) exten => 1337,n,SayUnixTime(${CALENDAR_QUERY_RESULT(${id},end,${i})},,IMp) ;exten => 1337,n,SayText(${CALENDAR_QUERY_RESULT(${id},summary,${i})}) exten => 1337,n,Set(i=$[${i} + 1]) exten => 1337,n,EndWhile

19 The Unmissable Conference Call Store a list of mappings from email address to context/extension for contacting Upon notification of an event, call all attendees and drop them in a conference Originate is currently blocking, but it would be very simple to write a non- blocking version

20 calendar.conf [mycal] type=caldav url= secret=mysecret refresh=15 timeframe=1440 channel=Local/calevent@calendar app=NoOp extensions.conf [calendar] exten => calevent,1,Set(attendees=${CALENDAR_EVENT(attendees)}) exten => calevent,n,While($["${SET(var=${SHIFT(attendees)})}" != ""]) exten => calevent,n,Set(xtn=${DB(lookup/${var:7})}) ;lookup email w/o mailto: exten => calevent,n,Originate(Local/${xtn},app,ConfBridge,1234) exten => calevent,n,EndWhile

21 The Calendar CDR Get a graphical representation of the time you spend on the phone Use CALENDAR_WRITE to create calendar events

22 [internal] exten => _6XXX,1,Set(start=${EPOCH}) exten => _6XXX,n,Dial(SIP/${EXTEN}) exten => h,1,Set(end=${EPOCH}) exten => h,n,Set(CALENDAR_WRITE(mycal,summary,start,end)= \ Call from ${CALLERID(all)},${start},${end})

23 Developers Wanted! Areas for Improvement

24 Support for Exchange 2007 Support for Exchange forms-based authentication Attendee support for Exchange res_calendar_activesync would solve the above and be useful for Exchange, Zimbra, Google, Apple, calendar servers (and others) Write support for attendees

25 Questions?


Download ppt "Hello, Dave. It’s your calendar calling. Terry Wilson, Digium Senior Developer."

Similar presentations

Ads by Google