Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Realtime PBX Module. More...
#include "asterisk.h"
#include <signal.h>
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/config.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/frame.h"
#include "asterisk/term.h"
#include "asterisk/manager.h"
#include "asterisk/cli.h"
#include "asterisk/lock.h"
#include "asterisk/linkedlists.h"
#include "asterisk/chanvars.h"
#include "asterisk/sched.h"
#include "asterisk/io.h"
#include "asterisk/utils.h"
#include "asterisk/astdb.h"
#include "asterisk/app.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis_channels.h"
Go to the source code of this file.
Data Structures | |
struct | cache_entry |
Macros | |
#define | EXT_DATA_SIZE 256 |
#define | MODE_CANMATCH 2 |
#define | MODE_MATCH 0 |
#define | MODE_MATCHMORE 1 |
Enumerations | |
enum | option_flags { OPTION_CHEAT = (1 << 0) , OPTION_NUMGAMES = (1 << 1) , OPTION_PATTERNS_DISABLED = (1 << 0) } |
Functions | |
AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY, "Realtime Switch") | |
static int | cache_cmp (void *obj, void *arg, int flags) |
static int | cache_hash (const void *obj, const int flags) |
static void * | cleanup (void *unused) |
static struct ast_variable * | dup_vars (struct ast_variable *v) |
static int | extension_length_comparator (struct ast_category *p, struct ast_category *q) |
static void | free_entry (void *obj) |
static int | load_module (void) |
static int | purge_old_fn (void *obj, void *arg, int flags) |
static int | realtime_canmatch (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
static struct ast_variable * | realtime_common (const char *context, const char *exten, int priority, const char *data, int mode) |
static int | realtime_exec (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
static int | realtime_exists (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
static int | realtime_matchmore (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
static struct ast_variable * | realtime_switch_common (const char *table, const char *context, const char *exten, int priority, int mode, struct ast_flags flags) |
static int | unload_module (void) |
Variables | |
struct ao2_container * | cache |
pthread_t | cleanup_thread = 0 |
static struct ast_switch | realtime_switch |
static const struct ast_app_option | switch_opts [128] = { [ 'p' ] = { .flag = OPTION_PATTERNS_DISABLED }, } |
Realtime PBX Module.
Definition in file pbx_realtime.c.
#define EXT_DATA_SIZE 256 |
Definition at line 59 of file pbx_realtime.c.
#define MODE_CANMATCH 2 |
Definition at line 57 of file pbx_realtime.c.
#define MODE_MATCH 0 |
Definition at line 55 of file pbx_realtime.c.
#define MODE_MATCHMORE 1 |
Definition at line 56 of file pbx_realtime.c.
enum option_flags |
Enumerator | |
---|---|
OPTION_CHEAT | |
OPTION_NUMGAMES | |
OPTION_PATTERNS_DISABLED |
Definition at line 61 of file pbx_realtime.c.
AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , |
"Realtime Switch" | |||
) |
|
static |
Definition at line 86 of file pbx_realtime.c.
References CMP_MATCH, cache_entry::context, cache_entry::exten, and cache_entry::priority.
Referenced by load_module().
|
static |
Definition at line 80 of file pbx_realtime.c.
References ast_str_case_hash(), cache_entry::exten, and cache_entry::priority.
Referenced by load_module().
|
static |
Definition at line 124 of file pbx_realtime.c.
References ao2_callback, ao2_container_count(), ast_tvnow(), cache, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and purge_old_fn().
Referenced by __get_from_jb(), aeap_user_data_create(), ast_aeap_user_data_register(), ast_event_new(), ast_rtcp_write(), ast_rtp_dtmf_end_with_duration(), ast_sockaddr_resolve(), AST_TEST_DEFINE(), astobj2_test_1_helper(), broadcast_exec(), build_user(), create_cts(), create_message_types(), digest_check_auth(), digest_create_request_with_auth(), handle_uri(), invalid_record_test(), load_module(), nominal_test(), off_nominal_test(), pjsip_outbound_registration_metrics_init(), query_set_test(), sendtext_exec(), set_outbound_authentication_credentials(), set_outbound_initial_authentication_credentials(), sfu_topologies_on_source_change(), and softmix_bridge_stream_sources_update().
|
static |
Definition at line 95 of file pbx_realtime.c.
References ast_variable_new, ast_variables_destroy(), ast_variable::file, ast_variable::name, ast_variable::next, NULL, and ast_variable::value.
Referenced by realtime_common().
|
static |
Definition at line 144 of file pbx_realtime.c.
References ast_variable_find(), and S_OR.
Referenced by realtime_switch_common().
|
static |
Definition at line 111 of file pbx_realtime.c.
References ast_variables_destroy(), and cache_entry::var.
Referenced by realtime_common().
|
static |
Definition at line 413 of file pbx_realtime.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_SUCCESS, ast_pthread_create, ast_register_switch(), cache, cache_cmp(), cache_hash(), cleanup(), cleanup_thread, NULL, and realtime_switch.
|
static |
Definition at line 117 of file pbx_realtime.c.
References ast_tvdiff_ms(), CMP_MATCH, and cache_entry::when.
Referenced by cleanup().
|
static |
Definition at line 299 of file pbx_realtime.c.
References ast_variables_destroy(), voicemailpwcheck::context, MODE_CANMATCH, priority, realtime_common(), and var.
|
static |
Definition at line 229 of file pbx_realtime.c.
References ao2_alloc, ao2_find, ao2_link, ao2_ref, ast_app_parse_options(), ast_copy_string(), AST_MAX_EXTENSION, ast_strdupa, ast_strlen_zero(), ast_tvnow(), ast_variables_destroy(), buf, cache, cleanup_thread, voicemailpwcheck::context, cache_entry::context, dup_vars(), cache_entry::exten, ast_flags::flags, free_entry(), MODE_MATCH, NULL, OBJ_POINTER, priority, cache_entry::priority, realtime_switch_common(), S_OR, switch_opts, table, var, cache_entry::var, and cache_entry::when.
Referenced by realtime_canmatch(), realtime_exec(), realtime_exists(), and realtime_matchmore().
|
static |
Definition at line 309 of file pbx_realtime.c.
References a, app, ast_channel_appl(), ast_channel_appl_set(), ast_channel_context(), ast_channel_data(), ast_channel_data_set(), ast_channel_exten(), ast_channel_lock, ast_channel_name(), ast_channel_priority(), ast_channel_publish_snapshot(), AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, ast_channel_snapshot_invalidate_segment(), ast_channel_snapshot_type(), ast_channel_unlock, ast_log, ast_strdupa, ast_strlen_zero(), ast_variables_destroy(), ast_verb, COLOR_BRCYAN, COLOR_BRMAGENTA, voicemailpwcheck::context, EXT_DATA_SIZE, LOG_NOTICE, LOG_WARNING, MODE_MATCH, ast_variable::name, ast_variable::next, NULL, pbx_exec(), pbx_findapp(), pbx_substitute_variables_helper(), priority, realtime_common(), S_OR, term_color(), ast_variable::value, and var.
|
static |
Definition at line 289 of file pbx_realtime.c.
References ast_variables_destroy(), voicemailpwcheck::context, MODE_MATCH, priority, realtime_common(), and var.
|
static |
Definition at line 382 of file pbx_realtime.c.
References ast_variables_destroy(), voicemailpwcheck::context, MODE_MATCHMORE, priority, realtime_common(), and var.
|
static |
Definition at line 166 of file pbx_realtime.c.
References ast_category_browse(), ast_category_detach_variables(), ast_category_get(), ast_config_destroy(), ast_config_sort_categories(), ast_copy_string(), ast_extension_close(), ast_extension_match(), ast_load_realtime(), ast_load_realtime_multientry(), AST_MAX_EXTENSION, ast_test_flag, ast_variable_retrieve(), voicemailpwcheck::context, extension_length_comparator(), match(), MODE_CANMATCH, MODE_MATCH, MODE_MATCHMORE, NULL, OPTION_PATTERNS_DISABLED, priority, SENTINEL, table, and var.
Referenced by realtime_common().
|
static |
Definition at line 402 of file pbx_realtime.c.
References ao2_ref, ast_unregister_switch(), cache, cleanup_thread, NULL, and realtime_switch.
struct ao2_container* cache |
Definition at line 77 of file pbx_realtime.c.
Referenced by __frame_free(), add_to_cache(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_frame_free(), AST_TEST_DEFINE(), cache_dtor(), cache_put(), check_cache_aggregate(), cleanup(), expire_objects_from_cache(), load_module(), mark_all_as_stale_in_cache(), mark_object_as_stale_in_cache(), memory_cache_full_update(), memory_cache_populate(), memory_cache_stale_check(), memory_cache_stale_check_object(), memory_cache_stale_update_full(), memory_cache_stale_update_object(), object_add_to_cache_callback(), object_stale_callback(), realtime_common(), remove_all_from_cache(), remove_from_cache(), remove_oldest_from_cache(), schedule_cache_expiration(), sorcery_memory_cache_ami_expire(), sorcery_memory_cache_ami_expire_object(), sorcery_memory_cache_ami_populate(), sorcery_memory_cache_ami_stale(), sorcery_memory_cache_ami_stale_object(), sorcery_memory_cache_close(), sorcery_memory_cache_complete_name(), sorcery_memory_cache_complete_object_name(), sorcery_memory_cache_create(), sorcery_memory_cache_delete(), sorcery_memory_cache_destructor(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_hash(), sorcery_memory_cache_load(), sorcery_memory_cache_open(), sorcery_memory_cache_populate(), sorcery_memory_cache_reload(), sorcery_memory_cache_retrieve_fields(), sorcery_memory_cache_retrieve_id(), sorcery_memory_cache_retrieve_multiple(), sorcery_memory_cache_retrieve_prefix(), sorcery_memory_cache_retrieve_regex(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), sorcery_memory_cached_object_alloc(), stale_cache_update_task_data_alloc(), stale_update_task_data_alloc(), stasis_cache_create_full(), stasis_cache_dump(), stasis_cache_dump_all(), stasis_cache_dump_by_eid(), stasis_cache_get(), stasis_cache_get_all(), stasis_cache_get_by_eid(), stasis_caching_topic_create(), and unload_module().
pthread_t cleanup_thread = 0 |
Definition at line 78 of file pbx_realtime.c.
Referenced by load_module(), realtime_common(), and unload_module().
|
static |
Definition at line 392 of file pbx_realtime.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 67 of file pbx_realtime.c.
Referenced by realtime_common().