Asterisk - The Open Source Telephony Project
18.5.0
|
Calendaring API. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/channel.h"
#include "asterisk/calendar.h"
#include "asterisk/utils.h"
#include "asterisk/astobj2.h"
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/devicestate.h"
#include "asterisk/linkedlists.h"
#include "asterisk/sched.h"
#include "asterisk/dial.h"
#include "asterisk/cli.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | evententry |
struct | eventlist |
struct | techs |
Macros | |
#define | CALENDAR_BUCKETS 19 |
#define | FORMAT "%-20.20s %-10.10s %-6.6s\n" |
#define | FORMAT "%-10.10s %-30.30s\n" |
#define | FORMAT "%-18.18s : %-20.20s\n" |
#define | FORMAT2 "%-12.12s: %-40.60s\n" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_event_to_list (struct eventlist *events, struct ast_calendar_event *event, time_t start, time_t end) |
static int | add_new_event_cb (void *obj, void *arg, int flags) |
void | ast_calendar_clear_events (struct ast_calendar *cal) |
Remove all events from calendar. More... | |
const struct ast_config * | ast_calendar_config_acquire (void) |
Grab and lock pointer to the calendar config (read only) More... | |
void | ast_calendar_config_release (void) |
Release the calendar config. More... | |
struct ast_calendar_event * | ast_calendar_event_alloc (struct ast_calendar *cal) |
Allocate an astobj2 ast_calendar_event object. More... | |
struct ao2_container * | ast_calendar_event_container_alloc (void) |
Allocate an astobj2 container for ast_calendar_event objects. More... | |
void | ast_calendar_merge_events (struct ast_calendar *cal, struct ao2_container *new_events) |
Add an event to the list of events for a calendar. More... | |
int | ast_calendar_register (struct ast_calendar_tech *tech) |
Register a new calendar technology. More... | |
struct ast_calendar_event * | ast_calendar_unref_event (struct ast_calendar_event *event) |
Unreference an ast_calendar_event. More... | |
void | ast_calendar_unregister (struct ast_calendar_tech *tech) |
Unregister a new calendar technology. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static struct ast_calendar * | build_calendar (struct ast_config *cfg, const char *cat, const struct ast_calendar_tech *tech) |
static int | calendar_busy_callback (void *obj, void *arg, int flags) |
static int | calendar_busy_exec (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
A dialplan function that can be used to determine the busy status of a calendar. More... | |
static int | calendar_cmp_fn (void *obj, void *arg, int flags) |
static void | calendar_destructor (void *obj) |
static int | calendar_devstate_change (const void *data) |
static void | calendar_event_destructor (void *obj) |
static int | calendar_event_notify (const void *data) |
static int | calendar_event_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | calendar_hash_fn (const void *obj, const int flags) |
static int | calendar_is_busy (struct ast_calendar *cal) |
static void | calendar_join_attendees (struct ast_calendar_event *event, char *buf, size_t len) |
static int | calendar_query_exec (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | calendar_query_result_exec (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | calendar_write_exec (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
static enum ast_device_state | calendarstate (const char *data) |
static int | cb_pending_deletion (void *user_data, void *arg, int flags) |
static int | cb_rm_pending_deletion (void *user_data, void *arg, int flags) |
static int | clear_events_cb (void *user_data, void *arg, int flags) |
static void | copy_event_data (struct ast_calendar_event *dst, struct ast_calendar_event *src) |
static struct ast_calendar_event * | destroy_event (struct ast_calendar_event *event) |
static void * | do_notify (void *data) |
static void * | do_refresh (void *data) |
static char * | epoch_to_string (char *buf, size_t buflen, time_t epoch) |
static int | event_cmp_fn (void *obj, void *arg, int flags) |
static int | event_hash_fn (const void *obj, const int flags) |
static void | event_notification_destroy (void *data) |
static void * | event_notification_duplicate (void *data) |
static void | eventlist_destroy (void *data) |
static void | eventlist_destructor (void *obj) |
static void * | eventlist_duplicate (void *data) |
static struct ast_calendar * | find_calendar (const char *name) |
static struct ast_calendar_event * | find_event (struct ao2_container *events, const char *uid) |
static char * | generate_random_string (char *buf, size_t size) |
Generate 32 byte random string (stolen from chan_sip.c) More... | |
static char * | handle_dump_sched (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_show_calendar (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_show_calendars (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command to list available calendars. More... | |
static char * | handle_show_calendars_types (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command to list of all calendars types currently loaded on the backend. More... | |
static int | load_config (int reload) |
static int | load_module (void) |
Load the module. More... | |
static int | load_tech_calendars (struct ast_calendar_tech *tech) |
static int | match_caltech_cb (void *user_data, void *arg, int flags) |
static int | merge_events_cb (void *obj, void *arg, int flags) |
static int | null_chan_write (struct ast_channel *chan, struct ast_frame *frame) |
static int | reload (void) |
static int | schedule_calendar_event (struct ast_calendar *cal, struct ast_calendar_event *old_event, struct ast_calendar_event *cmp_event) |
static int | unload_module (void) |
static struct ast_calendar * | unref_calendar (struct ast_calendar *cal) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Asterisk 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, .reload = reload, .load_pri = AST_MODPRI_DEVSTATE_PROVIDER, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_custom_function | calendar_busy_function |
static struct ast_cli_entry | calendar_cli [] |
static struct ast_config * | calendar_config |
static struct ast_custom_function | calendar_event_function |
static struct ast_custom_function | calendar_query_function |
static struct ast_custom_function | calendar_query_result_function |
static struct ast_custom_function | calendar_write_function |
static struct ao2_container * | calendars |
static ast_rwlock_t | config_lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static const struct ast_datastore_info | event_notification_datastore |
static const struct ast_datastore_info | eventlist_datastore_info |
static int | module_unloading |
static const struct ast_channel_tech | null_tech |
static ast_cond_t | refresh_condition |
static pthread_t | refresh_thread = AST_PTHREADT_NULL |
static ast_mutex_t | refreshlock |
static ast_mutex_t | reloadlock |
static struct ast_sched_context * | sched |
static struct techs | techs = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
Calendaring API.
Support responding to a meeting invite
Support writing attendees
Definition in file res_calendar.c.
#define CALENDAR_BUCKETS 19 |
Definition at line 220 of file res_calendar.c.
Referenced by ast_calendar_event_container_alloc(), build_calendar(), and load_module().
#define FORMAT "%-20.20s %-10.10s %-6.6s\n" |
Referenced by handle_show_calendar(), handle_show_calendars(), and handle_show_calendars_types().
#define FORMAT "%-10.10s %-30.30s\n" |
#define FORMAT "%-18.18s : %-20.20s\n" |
#define FORMAT2 "%-12.12s: %-40.60s\n" |
Referenced by handle_show_calendar().
|
static |
Definition at line 1946 of file res_calendar.c.
|
static |
Definition at line 1946 of file res_calendar.c.
|
static |
Definition at line 1119 of file res_calendar.c.
References ao2_ref, ast_calloc, ast_debug, AST_LIST_INSERT_BEFORE_CURRENT, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_log, ast_calendar_event::end, evententry::event, evententry::list, LOG_ERROR, ast_calendar_event::start, ast_calendar_event::summary, and ast_calendar_event::uid.
Referenced by calendar_query_exec().
|
static |
Definition at line 1043 of file res_calendar.c.
References ao2_link, CMP_MATCH, events, NULL, ast_calendar_event::owner, and schedule_calendar_event().
Referenced by ast_calendar_merge_events().
void ast_calendar_clear_events | ( | struct ast_calendar * | cal | ) |
Remove all events from calendar.
cal | calendar whose events need to be cleared |
Definition at line 660 of file res_calendar.c.
References ao2_callback, ast_debug, clear_events_cb(), ast_calendar::events, ast_calendar::name, NULL, OBJ_MULTIPLE, OBJ_NODATA, and OBJ_UNLINK.
Referenced by calendar_destructor().
const struct ast_config* ast_calendar_config_acquire | ( | void | ) |
Grab and lock pointer to the calendar config (read only)
Definition at line 258 of file res_calendar.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, calendar_config, config_lock, and NULL.
Referenced by caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), and ical_load_calendar().
void ast_calendar_config_release | ( | void | ) |
Release the calendar config.
Definition at line 270 of file res_calendar.c.
References ast_rwlock_unlock, and config_lock.
Referenced by caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), and ical_load_calendar().
struct ast_calendar_event* ast_calendar_event_alloc | ( | struct ast_calendar * | cal | ) |
Allocate an astobj2 ast_calendar_event object.
cal | calendar to allocate an event for |
Definition at line 667 of file res_calendar.c.
References ao2_alloc, ast_calendar_unref_event(), AST_LIST_HEAD_INIT_NOLOCK, ast_string_field_init, ast_calendar_event::attendees, calendar_event_destructor(), evententry::event, and NULL.
Referenced by caldav_add_event(), calendar_write_exec(), icalendar_add_event(), parse_tag(), and startelm().
struct ao2_container* ast_calendar_event_container_alloc | ( | void | ) |
Allocate an astobj2 container for ast_calendar_event objects.
Definition at line 689 of file res_calendar.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, CALENDAR_BUCKETS, event_cmp_fn(), event_hash_fn(), and NULL.
Referenced by caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), and ical_load_calendar().
void ast_calendar_merge_events | ( | struct ast_calendar * | cal, |
struct ao2_container * | new_events | ||
) |
Add an event to the list of events for a calendar.
cal | calendar containing the events to be merged |
new_events | an oa2 container of events to be merged into cal->events |
Definition at line 1053 of file res_calendar.c.
References add_new_event_cb(), ao2_callback, ast_calendar::events, merge_events_cb(), OBJ_MULTIPLE, OBJ_NODATA, and OBJ_UNLINK.
Referenced by endelm(), icalendar_update_events(), startelm(), update_caldav(), and update_exchangecal().
int ast_calendar_register | ( | struct ast_calendar_tech * | tech | ) |
Register a new calendar technology.
tech | calendar technology to register |
0 | success |
-1 | failure |
Definition at line 549 of file res_calendar.c.
References AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, ast_module_user_add, ast_verb, ast_calendar_tech::description, evententry::list, load_tech_calendars(), LOG_WARNING, NULL, ast_calendar_tech::type, and ast_calendar_tech::user.
Referenced by load_module().
struct ast_calendar_event* ast_calendar_unref_event | ( | struct ast_calendar_event * | event | ) |
Unreference an ast_calendar_event.
event | event to unref |
Definition at line 321 of file res_calendar.c.
Referenced by ast_calendar_event_alloc(), caldav_add_event(), calendar_devstate_change(), calendar_query_exec(), calendar_write_exec(), do_notify(), endelm(), event_notification_destroy(), handle_show_calendar(), icalendar_add_event(), merge_events_cb(), and parse_tag().
void ast_calendar_unregister | ( | struct ast_calendar_tech * | tech | ) |
Unregister a new calendar technology.
tech | calendar technology to unregister |
0 | success |
-1 | failure |
Definition at line 587 of file res_calendar.c.
References ao2_callback, AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_module_user_remove, ast_verb, evententry::list, match_caltech_cb(), OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, ast_calendar_tech::type, and ast_calendar_tech::user.
Referenced by load_tech_calendars(), and unload_module().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1946 of file res_calendar.c.
|
static |
Create new calendar, old will be removed during reload
Definition at line 400 of file res_calendar.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_link, ao2_unlink, ast_cond_init, ast_free, ast_log, ast_pthread_create, AST_PTHREADT_NULL, ast_strdup, ast_string_field_init, ast_string_field_set, ast_strip(), ast_strlen_zero, ast_true(), ast_variable_browse(), ast_variable_new, ast_calendar::autoreminder, CALENDAR_BUCKETS, calendar_destructor(), event_cmp_fn(), event_hash_fn(), ast_calendar::events, ast_calendar::fetch_again_at_reload, find_calendar(), last, ast_calendar_tech::load_calendar, LOG_ERROR, LOG_WARNING, name, ast_variable::name, ast_calendar::name, ast_variable::next, ast_calendar::notify_channel, notify_channel(), ast_calendar::notify_waittime, NULL, ast_calendar::pending_deletion, ast_calendar::refresh, strsep(), ast_calendar::tech, ast_calendar::thread, ast_calendar::timeframe, ast_calendar::unload, unref_calendar(), value, ast_variable::value, var, and ast_calendar::vars.
Referenced by load_tech_calendars().
|
static |
Definition at line 358 of file res_calendar.c.
References AST_CALENDAR_BS_FREE, ast_tvnow(), and CMP_STOP.
Referenced by calendar_is_busy().
|
static |
A dialplan function that can be used to determine the busy status of a calendar.
Definition at line 1092 of file res_calendar.c.
References ast_log, ast_strlen_zero, calendar_is_busy(), find_calendar(), LOG_WARNING, and unref_calendar().
|
static |
Definition at line 287 of file res_calendar.c.
References CMP_MATCH, CMP_STOP, and ast_calendar::name.
Referenced by load_module().
|
static |
Definition at line 327 of file res_calendar.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_calendar_clear_events(), ast_cond_signal, ast_debug, ast_string_field_free_memory, ast_variables_destroy(), ast_calendar::events, ast_calendar::name, NULL, ast_calendar::tech, ast_calendar::tech_pvt, ast_calendar::thread, ast_calendar::unload, ast_calendar::unloading, ast_calendar_tech::unref_calendar, and ast_calendar::vars.
Referenced by build_calendar().
|
static |
Definition at line 892 of file res_calendar.c.
References ao2_ref, ast_calendar_unref_event(), AST_DEVICE_BUSY, AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_log, ast_tvnow(), calendar_is_busy(), and LOG_WARNING.
Referenced by schedule_calendar_event().
|
static |
Definition at line 609 of file res_calendar.c.
References ast_debug, ast_free, AST_LIST_REMOVE_HEAD, ast_string_field_free_memory, ast_calendar_attendee::data, and evententry::next.
Referenced by ast_calendar_event_alloc().
|
static |
Definition at line 868 of file res_calendar.c.
References ao2_ref, ast_log, ast_pthread_create_background, AST_PTHREADT_NULL, do_notify(), LOG_ERROR, and NULL.
Referenced by schedule_calendar_event().
|
static |
Definition at line 1716 of file res_calendar.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_copy_string(), ast_log, ast_strlen_zero, ast_calendar_event::busy_state, calendar_join_attendees(), ast_calendar_event::categories, ast_datastore::data, ast_calendar_event::description, ast_calendar_event::end, evententry::event, ast_calendar_event::location, LOG_WARNING, ast_calendar::name, NULL, ast_calendar_event::organizer, ast_calendar_event::owner, ast_calendar_event::priority, ast_calendar_event::start, ast_calendar_event::summary, and ast_calendar_event::uid.
|
static |
Definition at line 281 of file res_calendar.c.
References ast_str_case_hash(), and ast_calendar::name.
Referenced by load_module().
|
static |
Definition at line 372 of file res_calendar.c.
References ao2_callback, calendar_busy_callback(), ast_calendar::events, and OBJ_NODATA.
Referenced by calendar_busy_exec(), calendar_devstate_change(), calendarstate(), destroy_event(), and handle_show_calendars().
|
static |
Definition at line 1304 of file res_calendar.c.
References ast_copy_string(), ast_free, AST_LIST_FIRST, AST_LIST_TRAVERSE, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_calendar_event::attendees, ast_calendar_attendee::data, LOG_ERROR, evententry::next, and tmp().
Referenced by calendar_event_read(), and calendar_query_result_exec().
|
static |
Definition at line 1213 of file res_calendar.c.
References add_event_to_list(), ao2_alloc, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, args, AST_APP_ARG, ast_calendar_unref_event(), ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, ast_debug, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero, ast_datastore::data, DATASTORE_INHERIT_FOREVER, end, ast_calendar_event::end, evententry::event, eventlist_destructor(), events, ast_calendar::events, find_calendar(), generate_random_string(), ast_datastore::inheritance, LOG_ERROR, LOG_WARNING, ast_calendar_event::start, ast_calendar_event::summary, and unref_calendar().
|
static |
Definition at line 1322 of file res_calendar.c.
References args, AST_APP_ARG, ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_copy_string(), AST_DECLARE_APP_ARGS, AST_LIST_TRAVERSE, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero, ast_calendar_event::busy_state, calendar_join_attendees(), ast_calendar_event::categories, ast_datastore::data, ast_calendar_event::description, ast_calendar_event::end, evententry::event, events, evententry::list, ast_calendar_event::location, LOG_WARNING, ast_calendar::name, ast_calendar_event::organizer, ast_calendar_event::owner, ast_calendar_event::priority, ast_calendar_event::start, ast_calendar_event::summary, and ast_calendar_event::uid.
|
static |
Definition at line 1415 of file res_calendar.c.
References AST_APP_ARG, ast_calendar_event_alloc(), ast_calendar_unref_event(), AST_DECLARE_APP_ARGS, ast_free, ast_log, AST_STANDARD_APP_ARGS, ast_strdup, ast_string_field_set, ast_strlen_zero, ast_tvnow(), categories, find_calendar(), LOG_ERROR, LOG_WARNING, ast_calendar::name, NULL, pbx_builtin_setvar_helper(), ast_calendar::tech, unref_calendar(), and ast_calendar_tech::write_event.
|
static |
Definition at line 381 of file res_calendar.c.
References AST_DEVICE_INUSE, AST_DEVICE_INVALID, AST_DEVICE_NOT_INUSE, ast_strlen_zero, calendar_is_busy(), find_calendar(), ast_calendar_tech::is_busy, state, ast_calendar::tech, and unref_calendar().
Referenced by load_module().
|
static |
Definition at line 1779 of file res_calendar.c.
References CMP_MATCH, and ast_calendar::pending_deletion.
Referenced by reload().
|
static |
Definition at line 1788 of file res_calendar.c.
References CMP_MATCH, and ast_calendar::pending_deletion.
Referenced by reload().
|
static |
Definition at line 651 of file res_calendar.c.
References CMP_MATCH, and destroy_event().
Referenced by ast_calendar_clear_events().
|
static |
Definition at line 926 of file res_calendar.c.
References ast_calendar_event::alarm, ast_free, AST_LIST_INSERT_TAIL, AST_LIST_REMOVE_HEAD, ast_string_field_set, ast_calendar_event::attendees, ast_calendar_event::busy_state, ast_calendar_event::categories, categories, ast_calendar_event::description, ast_calendar_event::end, ast_calendar_event::location, evententry::next, ast_calendar_event::organizer, ast_calendar_event::owner, ast_calendar_event::priority, ast_calendar_event::start, ast_calendar_event::summary, and ast_calendar_event::uid.
Referenced by merge_events_cb().
|
static |
Definition at line 626 of file res_calendar.c.
References ast_debug, AST_DEVICE_BUSY, AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_sched_del(), ast_calendar_event::bs_end_sched, ast_calendar_event::bs_start_sched, calendar_is_busy(), ast_calendar::name, ast_calendar_event::notify_sched, NULL, and ast_calendar_event::owner.
Referenced by clear_events_cb(), and merge_events_cb().
|
static |
Definition at line 741 of file res_calendar.c.
References ao2_ref, ast_calendar_unref_event(), ast_channel_alloc, ast_channel_context_set(), ast_channel_datastore_add(), ast_channel_exten_set(), ast_channel_lock, ast_channel_nativeformats_set(), ast_channel_priority_set(), ast_channel_release(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_tech_set(), ast_channel_unlock, ast_datastore_alloc, ast_dial_answered_steal(), ast_dial_append(), ast_dial_create(), ast_dial_destroy(), AST_DIAL_OPTION_ANSWER_EXEC, ast_dial_option_global_enable(), AST_DIAL_RESULT_ANSWERED, ast_dial_run(), ast_dial_set_global_timeout(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_slin, ast_free, ast_log, ast_pbx_run(), AST_STATE_DOWN, ast_str_buffer(), ast_str_create, ast_str_set(), ast_str_substitute_variables(), ast_strdupa, ast_strlen_zero, ast_verb, buf, ast_datastore::data, DATASTORE_INHERIT_FOREVER, evententry::event, generate_random_string(), ast_datastore::inheritance, LOG_ERROR, LOG_WARNING, ast_variable::name, ast_variable::next, NULL, pbx_builtin_setvar_helper(), and ast_variable::value.
Referenced by calendar_event_notify().
|
static |
Definition at line 1821 of file res_calendar.c.
References ast_cond_timedwait, ast_mutex_lock, ast_mutex_unlock, ast_sched_runq(), ast_sched_wait(), ast_tvnow(), module_unloading, NULL, and refresh_condition.
Referenced by load_module().
|
static |
Definition at line 1587 of file res_calendar.c.
References ast_localtime(), ast_strftime(), buf, and NULL.
Referenced by handle_show_calendar().
|
static |
Definition at line 307 of file res_calendar.c.
References CMP_MATCH, CMP_STOP, and ast_calendar_event::uid.
Referenced by ast_calendar_event_container_alloc(), and build_calendar().
|
static |
Definition at line 301 of file res_calendar.c.
References ast_str_hash().
Referenced by ast_calendar_event_container_alloc(), and build_calendar().
|
static |
Definition at line 695 of file res_calendar.c.
References ast_calendar_unref_event().
|
static |
Definition at line 703 of file res_calendar.c.
References ao2_ref, evententry::event, and NULL.
|
static |
Definition at line 1193 of file res_calendar.c.
References ao2_ref, and events.
|
static |
Definition at line 347 of file res_calendar.c.
References ao2_ref, ast_free, AST_LIST_REMOVE_HEAD, evententry::event, events, and evententry::list.
Referenced by calendar_query_exec().
|
static |
Definition at line 1200 of file res_calendar.c.
References ao2_ref, events, and NULL.
|
static |
Definition at line 293 of file res_calendar.c.
References ao2_find, name, ast_calendar::name, and OBJ_POINTER.
Referenced by build_calendar(), calendar_busy_exec(), calendar_query_exec(), calendar_write_exec(), calendarstate(), and handle_show_calendar().
|
static |
Definition at line 313 of file res_calendar.c.
References ao2_find, OBJ_POINTER, and ast_calendar_event::uid.
Referenced by merge_events_cb().
|
static |
Generate 32 byte random string (stolen from chan_sip.c)
Definition at line 717 of file res_calendar.c.
References ast_random(), and buf.
Referenced by calendar_query_exec(), and do_notify().
|
static |
Definition at line 1690 of file res_calendar.c.
References ast_sched_dump(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1604 of file res_calendar.c.
References ast_calendar_event::alarm, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ast_cli_args::argc, ast_cli_args::argv, ast_calendar_unref_event(), ast_cli(), ast_strdup, ast_calendar::autoreminder, buf, ast_calendar_event::categories, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_calendar_event::description, ast_calendar_event::end, epoch_to_string(), evententry::event, ast_calendar::events, ast_cli_args::fd, find_calendar(), FORMAT, FORMAT2, ast_calendar_event::location, ast_cli_args::n, ast_calendar::name, ast_calendar::notify_app, ast_calendar::notify_appdata, ast_calendar::notify_channel, ast_calendar::notify_context, ast_calendar::notify_extension, NULL, ast_calendar_event::organizer, ast_cli_args::pos, ast_calendar_event::priority, ast_calendar::refresh, ast_calendar_event::start, ast_calendar_event::summary, ast_calendar::timeframe, ast_calendar_event::uid, unref_calendar(), ast_cli_entry::usage, and ast_cli_args::word.
|
static |
CLI command to list available calendars.
Definition at line 1528 of file res_calendar.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ast_cli(), calendar_is_busy(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, FORMAT, ast_calendar::name, NULL, ast_calendar::tech, ast_calendar_tech::type, unref_calendar(), and ast_cli_entry::usage.
|
static |
CLI command to list of all calendars types currently loaded on the backend.
Definition at line 1559 of file res_calendar.c.
References ast_cli(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_calendar_tech::description, ast_cli_args::fd, FORMAT, evententry::list, NULL, ast_calendar_tech::type, and ast_cli_entry::usage.
|
static |
Definition at line 1065 of file res_calendar.c.
References ast_config_destroy(), ast_config_load2(), ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, CONFIG_FLAG_FILEUNCHANGED, config_lock, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, and LOG_ERROR.
Referenced by load_module(), and reload().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 1900 of file res_calendar.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ARRAY_LEN, ast_cli_register_multiple, ast_cond_init, ast_config_destroy(), ast_custom_function_register, ast_devstate_prov_add(), ast_log, AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_DEVSTATE_PROVIDER, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_EXTENDED, ast_mutex_init, ast_pthread_create_background, ast_sched_context_create(), ASTERISK_GPL_KEY, CALENDAR_BUCKETS, calendar_cmp_fn(), calendar_hash_fn(), calendarstate(), do_refresh(), load_config(), LOG_ERROR, NULL, refresh_condition, refresh_thread, reload(), and unload_module().
|
static |
Definition at line 513 of file res_calendar.c.
References ast_calendar_unregister(), ast_category_browse(), ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, ast_variable_retrieve(), build_calendar(), config_lock, LOG_WARNING, NULL, ast_calendar_tech::type, and unref_calendar().
Referenced by ast_calendar_register(), and reload().
|
static |
Definition at line 575 of file res_calendar.c.
References CMP_MATCH, and ast_calendar::tech.
Referenced by ast_calendar_unregister().
|
static |
Definition at line 1016 of file res_calendar.c.
References ao2_unlink, ast_calendar_unref_event(), CMP_MATCH, copy_event_data(), destroy_event(), find_event(), ast_calendar_event::owner, schedule_calendar_event(), and ast_calendar_event::uid.
Referenced by ast_calendar_merge_events().
|
static |
Definition at line 730 of file res_calendar.c.
|
static |
Definition at line 1795 of file res_calendar.c.
References ao2_callback, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, ast_mutex_lock, ast_mutex_unlock, cb_pending_deletion(), cb_rm_pending_deletion(), evententry::list, load_config(), load_tech_calendars(), LOG_WARNING, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and ast_calendar_tech::type.
Referenced by load_module().
|
static |
Definition at line 954 of file res_calendar.c.
References ast_calendar_event::alarm, ao2_lock, ao2_unlock, ast_cond_signal, ast_debug, ast_mutex_lock, ast_mutex_unlock, AST_SCHED_REPLACE, ast_strlen_zero, ast_tvnow(), ast_calendar::autoreminder, ast_calendar_event::bs_end_sched, ast_calendar_event::bs_start_sched, calendar_devstate_change(), calendar_event_notify(), ast_calendar_event::end, evententry::event, ast_calendar::notify_channel, ast_calendar_event::notify_sched, refresh_condition, and ast_calendar_event::start.
Referenced by add_new_event_cb(), and merge_events_cb().
|
static |
Definition at line 1852 of file res_calendar.c.
References ao2_callback, ao2_cleanup, ARRAY_LEN, ast_cli_unregister_multiple(), ast_cond_signal, ast_config_destroy(), ast_custom_function_unregister(), ast_devstate_prov_del(), AST_LIST_LOCK, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_mutex_lock, ast_mutex_unlock, ast_sched_context_destroy(), ast_unload_resource(), evententry::list, ast_calendar_tech::module, module_unloading, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, refresh_condition, and refresh_thread.
Referenced by load_module().
|
static |
Definition at line 275 of file res_calendar.c.
Referenced by build_calendar(), calendar_busy_exec(), calendar_query_exec(), calendar_write_exec(), calendarstate(), handle_show_calendar(), handle_show_calendars(), and load_tech_calendars().
|
static |
Definition at line 1946 of file res_calendar.c.
|
static |
Definition at line 1946 of file res_calendar.c.
|
static |
Definition at line 1114 of file res_calendar.c.
|
static |
Definition at line 1709 of file res_calendar.c.
|
static |
Definition at line 255 of file res_calendar.c.
Referenced by ast_calendar_config_acquire().
|
static |
Definition at line 1774 of file res_calendar.c.
|
static |
Definition at line 1299 of file res_calendar.c.
|
static |
Definition at line 1410 of file res_calendar.c.
|
static |
Definition at line 1522 of file res_calendar.c.
|
static |
Definition at line 222 of file res_calendar.c.
|
static |
Definition at line 256 of file res_calendar.c.
Referenced by ast_calendar_config_acquire(), ast_calendar_config_release(), load_config(), and load_tech_calendars().
|
static |
Definition at line 235 of file res_calendar.c.
|
static |
Definition at line 241 of file res_calendar.c.
|
static |
Definition at line 228 of file res_calendar.c.
Referenced by do_refresh(), and unload_module().
|
static |
Definition at line 735 of file res_calendar.c.
|
static |
Definition at line 226 of file res_calendar.c.
Referenced by do_refresh(), load_module(), schedule_calendar_event(), and unload_module().
|
static |
Definition at line 224 of file res_calendar.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 225 of file res_calendar.c.
Referenced by caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), and ical_load_calendar().
|
static |
Definition at line 227 of file res_calendar.c.
|
static |
Definition at line 223 of file res_calendar.c.