Asterisk - The Open Source Telephony Project
18.5.0
|
Resource for handling CalDAV calendars. More...
#include "asterisk.h"
#include <libical/ical.h>
#include <ne_session.h>
#include <ne_uri.h>
#include <ne_request.h>
#include <ne_auth.h>
#include <ne_redirect.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/calendar.h"
#include "asterisk/lock.h"
#include "asterisk/config.h"
#include "asterisk/astobj2.h"
Go to the source code of this file.
Data Structures | |
struct | caldav_pvt |
struct | xmlstate |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | auth_credentials (void *userdata, const char *realm, int attempts, char *username, char *secret) |
static void | caldav_add_event (icalcomponent *comp, struct icaltime_span *span, void *data) |
static void | caldav_destructor (void *obj) |
static struct ast_str * | caldav_get_events_between (struct caldav_pvt *pvt, time_t start_time, time_t end_time) |
static void * | caldav_load_calendar (void *data) |
static struct ast_str * | caldav_request (struct caldav_pvt *pvt, const char *method, struct ast_str *req_body, struct ast_str *subdir, const char *content_type) |
static int | caldav_write_event (struct ast_calendar_event *event) |
static int | debug_response_handler (void *userdata, ne_request *req, const ne_status *st) |
static int | fetch_response_reader (void *data, const char *block, size_t len) |
static void | handle_characters (void *data, const xmlChar *ch, int len) |
static void | handle_end_element (void *data, const xmlChar *localname, const xmlChar *prefix, const xmlChar *uri) |
static void | handle_start_element (void *data, const xmlChar *localname, const xmlChar *prefix, const xmlChar *uri, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes) |
static time_t | icalfloat_to_timet (icaltimetype time) |
static int | load_module (void) |
static int | unload_module (void) |
static void * | unref_caldav (void *obj) |
static int | update_caldav (struct caldav_pvt *pvt) |
static int | verify_cert (void *userdata, int failures, const ne_ssl_certificate *cert) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Asterisk CalDAV Calendar Integration" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEVSTATE_PLUGIN, .requires = "res_calendar", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const xmlChar * | caldav_node_localname = BAD_CAST "calendar-data" |
static const xmlChar * | caldav_node_nsuri = BAD_CAST "urn:ietf:params:xml:ns:caldav" |
static struct ast_calendar_tech | caldav_tech |
Resource for handling CalDAV calendars.
Definition in file res_calendar_caldav.c.
|
static |
Definition at line 757 of file res_calendar_caldav.c.
|
static |
Definition at line 757 of file res_calendar_caldav.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 757 of file res_calendar_caldav.c.
|
static |
Definition at line 114 of file res_calendar_caldav.c.
References ast_log, LOG_WARNING, ast_calendar::name, caldav_pvt::owner, caldav_pvt::secret, and caldav_pvt::user.
Referenced by caldav_load_calendar().
|
static |
Definition at line 349 of file res_calendar_caldav.c.
References ao2_link, AST_CALENDAR_BS_BUSY, AST_CALENDAR_BS_FREE, ast_calendar_event_alloc(), ast_calendar_unref_event(), ast_calloc, ast_free, AST_LIST_INSERT_TAIL, ast_log, ast_strdup, ast_string_field_set, ast_strlen_zero, ast_calendar_event::attendees, categories, ast_calendar_attendee::data, end, caldav_pvt::events, icalfloat_to_timet(), LOG_ERROR, LOG_WARNING, ast_calendar_attendee::next, caldav_pvt::owner, ast_calendar_event::start, ast_calendar_event::summary, and tmp().
Referenced by handle_end_element().
|
static |
Definition at line 74 of file res_calendar_caldav.c.
References ao2_callback, ao2_ref, ast_debug, ast_string_field_free_memory, caldav_pvt::events, ast_calendar::name, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, caldav_pvt::owner, caldav_pvt::session, and caldav_pvt::uri.
Referenced by caldav_load_calendar().
|
static |
Definition at line 276 of file res_calendar_caldav.c.
References ast_free, ast_log, ast_str_append(), ast_str_create, ast_str_strlen(), caldav_request(), end, LOG_ERROR, and NULL.
Referenced by update_caldav().
|
static |
Definition at line 607 of file res_calendar_caldav.c.
References ao2_alloc, ao2_trylock, ao2_unlock, ast_calendar_config_acquire(), ast_calendar_config_release(), ast_calendar_event_container_alloc(), ast_cond_timedwait, ast_debug, ast_log, ast_mutex_init, ast_mutex_lock, ast_mutex_unlock, ast_string_field_init, ast_string_field_set, ast_strlen_zero, ast_tvnow(), ast_variable_browse(), auth_credentials(), caldav_destructor(), caldav_pvt::events, LOG_ERROR, LOG_WARNING, ast_variable::name, ast_calendar::name, ast_variable::next, NULL, caldav_pvt::owner, ast_calendar::refresh, refreshlock, caldav_pvt::secret, caldav_pvt::session, ast_calendar::tech_pvt, ast_calendar::unload, ast_calendar::unloading, unref_caldav(), update_caldav(), caldav_pvt::uri, caldav_pvt::url, ast_variable::value, and verify_cert().
|
static |
Definition at line 138 of file res_calendar_caldav.c.
References ast_free, ast_log, ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_strlen_zero, buf, debug_response_handler(), fetch_response_reader(), LOG_ERROR, LOG_WARNING, ast_calendar::name, NULL, caldav_pvt::owner, caldav_pvt::session, and caldav_pvt::uri.
Referenced by caldav_get_events_between(), and caldav_write_event().
|
static |
Definition at line 175 of file res_calendar_caldav.c.
References AST_CALENDAR_BS_BUSY, AST_CALENDAR_BS_BUSY_TENTATIVE, ast_free, ast_log, ast_random(), ast_str_append(), ast_str_create, ast_str_set(), ast_string_field_build, ast_strlen_zero, ast_calendar_event::busy_state, caldav_request(), ast_calendar_event::categories, ast_calendar_event::description, ast_calendar_event::end, ast_calendar_event::location, LOG_ERROR, LOG_WARNING, NULL, ast_calendar_event::organizer, caldav_pvt::owner, ast_calendar_event::priority, ast_calendar_event::start, ast_calendar_event::summary, ast_calendar::tech_pvt, ast_calendar_event::uid, and caldav_pvt::url.
|
static |
Definition at line 129 of file res_calendar_caldav.c.
References ast_debug.
Referenced by caldav_request().
|
static |
Definition at line 98 of file res_calendar_caldav.c.
References ast_free, ast_malloc, ast_str_append(), len(), and tmp().
Referenced by caldav_request().
|
static |
Definition at line 533 of file res_calendar_caldav.c.
References ast_str_append(), xmlstate::cdata, xmlstate::in_caldata, and tmp().
Referenced by update_caldav().
|
static |
Definition at line 500 of file res_calendar_caldav.c.
References ast_str_buffer(), ast_str_strlen(), caldav_add_event(), caldav_node_localname, caldav_node_nsuri, xmlstate::cdata, xmlstate::end, xmlstate::in_caldata, xmlstate::pvt, and xmlstate::start.
Referenced by update_caldav().
|
static |
Definition at line 485 of file res_calendar_caldav.c.
References ast_str_reset(), caldav_node_localname, caldav_node_nsuri, xmlstate::cdata, and xmlstate::in_caldata.
Referenced by update_caldav().
|
static |
Definition at line 324 of file res_calendar_caldav.c.
References ast_mktime(), NULL, ast_tm::tm_hour, ast_tm::tm_isdst, ast_tm::tm_mday, ast_tm::tm_min, ast_tm::tm_mon, ast_tm::tm_sec, and ast_tm::tm_year.
Referenced by caldav_add_event().
|
static |
Definition at line 733 of file res_calendar_caldav.c.
References ast_calendar_register(), AST_MODULE_LOAD_DECLINE, and AST_MODULE_LOAD_SUCCESS.
Referenced by unload_module().
|
static |
Definition at line 744 of file res_calendar_caldav.c.
References ast_calendar_unregister(), AST_MODFLAG_LOAD_ORDER, AST_MODPRI_DEVSTATE_PLUGIN, AST_MODULE_INFO(), AST_MODULE_SUPPORT_EXTENDED, ASTERISK_GPL_KEY, and load_module().
|
static |
Definition at line 90 of file res_calendar_caldav.c.
Referenced by caldav_load_calendar().
|
static |
Definition at line 547 of file res_calendar_caldav.c.
References ast_calendar_merge_events(), ast_free, ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_tvnow(), caldav_get_events_between(), xmlstate::cdata, end, xmlstate::end, caldav_pvt::events, handle_characters(), handle_end_element(), handle_start_element(), xmlstate::in_caldata, caldav_pvt::owner, xmlstate::start, and ast_calendar::timeframe.
Referenced by caldav_load_calendar().
|
static |
Definition at line 601 of file res_calendar_caldav.c.
Referenced by caldav_load_calendar().
|
static |
Definition at line 757 of file res_calendar_caldav.c.
|
static |
Definition at line 757 of file res_calendar_caldav.c.
|
static |
Definition at line 482 of file res_calendar_caldav.c.
Referenced by handle_end_element(), and handle_start_element().
|
static |
Definition at line 483 of file res_calendar_caldav.c.
Referenced by handle_end_element(), and handle_start_element().
|
static |
Definition at line 53 of file res_calendar_caldav.c.