res_calendar / ownCloud

Home » Asterisk Users » res_calendar / ownCloud
Asterisk Users 1 Comment


I try to use res_calendar with ownCloud. While it works with google/ics, I’ve some difficulties with caldav and ownCloud[1]. According to the logs and tcpdump the calendar entries have been fetched but they are not available in Asterisk. ‘calendar show calendars’ doesn’t show the status busy, ‘calendar show calendar owncloud’ doesn’t show the current events. I also don’t get any result with CALENDAR_QUERY/CALENDAR_QUERY_RESULT. I haven’t seen any special error message (core set verbose 10) while reloading the config and fetching the calendar entries.

On the wire I see the following answer from the ownlcloud server.:

PRODID:ownCloud Calendar

One thought on - res_calendar / ownCloud

  • This is a TOTAL hack which I’m sure breaks Google/ics compatibility. But here’s what we had to do to get asterisk and owncloud to work together. We’re still using owncloud 4.5.13 although I suspect the hack will work with owncloud 5.x. Also we’re using asterisk 11.5.0 however I’m quite sure this worked with 1.8.xx releases.

    You will need to make three changes to res/res_calendar_caldav.c

    I don’t have the exact line numbers from the original source as we made a few other minor mods, and there are some other changes from 1.8.x to
    11.5.0, but these line numbers should enable you to find the correct locations in res/res_calendar_caldav.c.

    Around line 160:
    Add this line:
    ne_add_request_header(req, “Depth”, “1”);
    After this line:
    ne_add_request_header(req, “Content-type”, ast_strlen_zero(content_type) ? “text/xml” : content_type);

    Around line 482:
    change this line:
    if (!xmlStrcasecmp(fullname, BAD_CAST “C:calendar-data”)) {
    To this:
    if (!xmlStrcasecmp(fullname, BAD_CAST “cal:calendar-data”)) {

    Around line 497:
    Change this line:
    if (xmlStrcasecmp(name, BAD_CAST “C:calendar-data”)) {
    To this:
    if (xmlStrcasecmp(name, BAD_CAST “cal:calendar-data”)) {