| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
Resource for handling MS Exchange Web Service calendars. More...
#include "asterisk.h"#include <ne_request.h>#include <ne_session.h>#include <ne_uri.h>#include <ne_socket.h>#include <ne_auth.h>#include <ne_xml.h>#include <ne_xmlreq.h>#include <ne_utils.h>#include <ne_redirect.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 | calendar_id | 
| struct | ewscal_pvt | 
| struct | xml_context::ids | 
| struct | xml_context | 
| Enumerations | |
| enum | { XML_EVENT_CALENDAR_ITEM = 9 , XML_EVENT_NAME = 10 , XML_EVENT_DESCRIPTION , XML_EVENT_START , XML_EVENT_END , XML_EVENT_BUSY , XML_EVENT_ORGANIZER , XML_EVENT_LOCATION , XML_EVENT_ATTENDEE_LIST , XML_EVENT_ATTENDEE , XML_EVENT_MAILBOX , XML_EVENT_EMAIL_ADDRESS , XML_EVENT_CATEGORIES , XML_EVENT_CATEGORY , XML_EVENT_IMPORTANCE } | 
| enum | xml_op { XML_OP_FIND = 100 , XML_OP_GET , XML_OP_CREATE } | 
| 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 int | cdata (void *userdata, int state, const char *cdata, size_t len) | 
| static int | endelm (void *userdata, int state, const char *nspace, const char *name) | 
| static void | ewscal_destructor (void *obj) | 
| static void * | ewscal_load_calendar (void *data) | 
| static int | ewscal_write_event (struct ast_calendar_event *event) | 
| static struct calendar_id * | get_ewscal_ids_for (struct ewscal_pvt *pvt) | 
| static const char * | get_soap_action (enum xml_op op) | 
| static int | load_module (void) | 
| static const char * | msstatus (enum ast_calendar_busy_state state) | 
| static const char * | mstime (time_t t, char *buf, size_t buflen) | 
| static time_t | mstime_to_time_t (char *mstime) | 
| static int | parse_ewscal_id (struct ewscal_pvt *pvt, const char *id) | 
| static int | send_ews_request_and_parse (struct ast_str *request, struct xml_context *ctx) | 
| static int | ssl_verify (void *userdata, int failures, const ne_ssl_certificate *cert) | 
| static int | startelm (void *userdata, int parent, const char *nspace, const char *name, const char **atts) | 
| static int | unload_module (void) | 
| static void * | unref_ewscal (void *obj) | 
| static int | update_ewscal (struct ewscal_pvt *pvt) | 
| Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Asterisk MS Exchange Web Service Calendar Integration" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .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 struct ast_calendar_tech | ewscal_tech | 
Resource for handling MS Exchange Web Service calendars.
Definition in file res_calendar_ews.c.
| anonymous enum | 
Definition at line 82 of file res_calendar_ews.c.
| enum xml_op | 
| Enumerator | |
|---|---|
| XML_OP_FIND | |
| XML_OP_GET | |
| XML_OP_CREATE | |
Definition at line 61 of file res_calendar_ews.c.
| 
 | static | 
Definition at line 946 of file res_calendar_ews.c.
| 
 | static | 
Definition at line 946 of file res_calendar_ews.c.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) | 
Definition at line 946 of file res_calendar_ews.c.
| 
 | static | 
Definition at line 138 of file res_calendar_ews.c.
References ast_log, LOG_WARNING, ast_calendar::name, ewscal_pvt::owner, ewscal_pvt::secret, and ewscal_pvt::user.
Referenced by ewscal_load_calendar().
| 
 | static | 
Definition at line 327 of file res_calendar_ews.c.
References AST_CALENDAR_BS_BUSY, AST_CALENDAR_BS_BUSY_TENTATIVE, AST_CALENDAR_BS_FREE, ast_copy_string(), ast_debug, ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_strlen(), ast_calendar_event::busy_state, xml_context::cdata, cdata(), ast_calendar_event::end, xml_context::event, len(), LOG_ERROR, mstime_to_time_t(), xml_context::op, ast_calendar_event::start, XML_EVENT_BUSY, XML_EVENT_CATEGORY, XML_EVENT_END, XML_EVENT_START, and XML_OP_CREATE.
Referenced by cdata(), chan_pjsip_set_rtp_peer(), rtp_direct_media_data_create(), rtp_direct_media_data_destroy(), send_direct_media_request(), and send_ews_request_and_parse().
| 
 | static | 
Definition at line 386 of file res_calendar_ews.c.
References ao2_container_count(), ao2_link, ast_calendar_merge_events(), ast_calendar_unref_event(), ast_calloc, ast_debug, ast_free, AST_LIST_INSERT_TAIL, ast_log, ast_str_buffer(), ast_str_reset(), ast_str_strlen(), ast_strdup, ast_string_field_set, ast_calendar_event::attendees, ast_calendar_event::categories, categories, xml_context::cdata, ast_calendar_attendee::data, ast_calendar_event::description, xml_context::event, ewscal_pvt::events, ewscal_pvt::items, ast_calendar_event::location, LOG_ERROR, name, ast_calendar_attendee::next, xml_context::op, ast_calendar_event::organizer, ewscal_pvt::owner, ast_calendar_event::priority, xml_context::pvt, ast_calendar_event::summary, XML_EVENT_DESCRIPTION, XML_EVENT_EMAIL_ADDRESS, XML_OP_CREATE, and XML_OP_FIND.
Referenced by send_ews_request_and_parse().
| 
 | static | 
Definition at line 113 of file res_calendar_ews.c.
References ao2_callback, ao2_ref, ast_debug, ast_string_field_free_memory, ewscal_pvt::events, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, ewscal_pvt::session, and ewscal_pvt::uri.
Referenced by ewscal_load_calendar().
| 
 | static | 
Definition at line 770 of file res_calendar_ews.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(), ewscal_pvt::events, ewscal_destructor(), LOG_ERROR, LOG_WARNING, ast_calendar::name, ast_variable::name, ast_variable::next, NULL, ewscal_pvt::owner, ast_calendar::refresh, refreshlock, ewscal_pvt::secret, ewscal_pvt::session, ssl_verify(), ast_calendar::tech_pvt, ast_calendar::unload, ast_calendar::unloading, unref_ewscal(), update_ewscal(), ewscal_pvt::uri, ewscal_pvt::url, url, ewscal_pvt::user, and ast_variable::value.
| 
 | static | 
Definition at line 562 of file res_calendar_ews.c.
References ast_free, ast_str_append(), ast_str_create, ast_str_set(), ast_strdupa, categories, end, msstatus(), mstime(), NULL, xml_context::op, ewscal_pvt::owner, xml_context::pvt, request(), send_ews_request_and_parse(), strsep(), ast_calendar::tech_pvt, and XML_OP_CREATE.
| 
 | static | 
Definition at line 650 of file res_calendar_ews.c.
References ast_debug, ast_free, AST_LIST_FIRST, AST_LIST_HEAD_INIT_NOLOCK, ast_localtime(), ast_log, ast_str_create, ast_str_set(), ast_strftime(), ast_tvnow(), end, xml_context::ids, LOG_ERROR, NULL, xml_context::op, ewscal_pvt::owner, xml_context::pvt, request(), send_ews_request_and_parse(), ast_calendar::timeframe, and XML_OP_FIND.
Referenced by update_ewscal().
| 
 | static | 
Definition at line 497 of file res_calendar_ews.c.
References XML_OP_CREATE, XML_OP_FIND, and XML_OP_GET.
Referenced by send_ews_request_and_parse().
| 
 | static | 
Definition at line 907 of file res_calendar_ews.c.
References ast_calendar_register(), ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ewscal_tech, and LOG_ERROR.
| 
 | static | 
Definition at line 483 of file res_calendar_ews.c.
References AST_CALENDAR_BS_BUSY, AST_CALENDAR_BS_BUSY_TENTATIVE, and AST_CALENDAR_BS_FREE.
Referenced by ewscal_write_event().
| 
 | static | 
Definition at line 470 of file res_calendar_ews.c.
References ast_localtime(), ast_strftime(), buf, and S_OR.
Referenced by ewscal_write_event(), mstime_to_time_t(), and mstime_to_time_t().
| 
 | static | 
Definition at line 163 of file res_calendar_ews.c.
References ast_mktime(), ast_strptime(), and mstime().
Referenced by cdata().
| 
 | static | 
Definition at line 714 of file res_calendar_ews.c.
References ast_free, ast_str_create, ast_str_set(), xml_context::pvt, request(), send_ews_request_and_parse(), and XML_OP_GET.
Referenced by update_ewscal().
| 
 | static | 
Definition at line 511 of file res_calendar_ews.c.
References ast_debug, ast_log, ast_str_buffer(), ast_str_strlen(), cdata(), endelm(), get_soap_action(), LOG_ERROR, LOG_WARNING, xml_context::op, xml_context::parser, xml_context::pvt, request(), ewscal_pvt::session, startelm(), ewscal_pvt::uri, and ewscal_pvt::url.
Referenced by ewscal_write_event(), get_ewscal_ids_for(), and parse_ewscal_id().
| 
 | static | 
Definition at line 153 of file res_calendar_ews.c.
References ast_log, LOG_WARNING, ast_calendar::name, and ewscal_pvt::owner.
Referenced by ewscal_load_calendar().
| 
 | static | 
Definition at line 175 of file res_calendar_ews.c.
References ast_calendar_event_alloc(), ast_calendar_merge_events(), ast_calloc, ast_debug, ast_free, AST_LIST_INSERT_TAIL, ast_log, ast_str_buffer(), ast_str_create, ast_str_reset(), ast_str_set(), ast_string_field_set, xml_context::cdata, xml_context::event, ewscal_pvt::events, id, xml_context::ids, ewscal_pvt::items, LOG_ERROR, name, calendar_id::next, NULL, xml_context::op, ewscal_pvt::owner, xml_context::parser, xml_context::pvt, XML_EVENT_ATTENDEE, XML_EVENT_ATTENDEE_LIST, XML_EVENT_BUSY, XML_EVENT_CALENDAR_ITEM, XML_EVENT_CATEGORIES, XML_EVENT_CATEGORY, XML_EVENT_DESCRIPTION, XML_EVENT_EMAIL_ADDRESS, XML_EVENT_END, XML_EVENT_IMPORTANCE, XML_EVENT_LOCATION, XML_EVENT_MAILBOX, XML_EVENT_NAME, XML_EVENT_ORGANIZER, XML_EVENT_START, XML_OP_CREATE, and XML_OP_FIND.
Referenced by send_ews_request_and_parse().
| 
 | static | 
Definition at line 932 of file res_calendar_ews.c.
References ast_calendar_unregister(), and ewscal_tech.
| 
 | static | 
Definition at line 129 of file res_calendar_ews.c.
References ao2_ref, ast_debug, and NULL.
Referenced by ewscal_load_calendar().
| 
 | static | 
Definition at line 752 of file res_calendar_ews.c.
References ast_free, AST_LIST_NEXT, ast_str_buffer(), get_ewscal_ids_for(), calendar_id::id, calendar_id::next, and parse_ewscal_id().
Referenced by ewscal_load_calendar().
| 
 | static | 
Definition at line 946 of file res_calendar_ews.c.
| 
 | static | 
Definition at line 946 of file res_calendar_ews.c.
| 
 | static | 
Definition at line 52 of file res_calendar_ews.c.
Referenced by load_module(), and unload_module().