Hi, 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.: <?xml version="1.0" encoding="utf-8"?> <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/"><d:response><d:href>/remote.php/caldav/calendars/9e681f76-d67d-102d-9eb3-333258c8c572/defaultcalendar/owncloud-47307eef251636b6b3c7d8119a4bdf01.ics</d:href><d:propstat><d:prop><cal:calendar-data>BEGIN:VCALENDAR VERSION:2.0 PRODID:ownCloud Calendar BEGIN:VEVENT CREATED;VALUE=DATE-TIME:20130820T200233Z UID:87e47fc65a LAST-MODIFIED;VALUE=DATE-TIME:20130820T200233Z DTSTAMP;VALUE=DATE-TIME:20130820T200233Z SUMMARY:SACKHUEPFEN DTSTART;VALUE=DATE:20130820 DTEND;VALUE=DATE:20130826 CLASS:PUBLIC END:VEVENT END:VCALENDAR </cal:calendar-data></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response> <d:href>/remote.php/caldav/calendars/9e681f76-d67d-102d-9eb3-333258c8c572/defaultcalendar/owncloud-31493c29c5a5e517d0b63b126fd2b222.ics</d:href><d:propstat><d:prop><cal:calendar-data>BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN BEGIN:VEVENT CREATED:20130820T192909Z LAST-MODIFIED:20130820T203525Z DTSTAMP:20130820T203525Z UID:07e053cb23 SUMMARY:HAMBURG STATUS:CONFIRMED DTSTART:20130820T200000Z DTEND:20130820T220000Z CLASS:PUBLIC TRANSP:OPAQUE SEQUENCE:1 X-MOZ-GENERATION:1 END:VEVENT END:VCALENDAR </cal:calendar-data></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus> Is there anything wrong with that? How can I debug that? I use Asterisk 1.8.23. Regards, Matthias [1] http://owncloud.org/
On Tue, 20 Aug 2013, Matthias Rieber wrote:> Hi, > > 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.: > > .... > > Is there anything wrong with that? How can I debug that? I use Asterisk > 1.8.23. > > Regards, > Matthias > > > [1] http://owncloud.org/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")) {