Asterisk - The Open Source Telephony Project
18.5.0
|
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_WAIT = (1 << 0), 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.
Referenced by realtime_exec().
#define MODE_CANMATCH 2 |
Definition at line 57 of file pbx_realtime.c.
Referenced by realtime_canmatch(), and realtime_switch_common().
#define MODE_MATCH 0 |
Definition at line 55 of file pbx_realtime.c.
Referenced by realtime_common(), realtime_exec(), realtime_exists(), and realtime_switch_common().
#define MODE_MATCHMORE 1 |
Definition at line 56 of file pbx_realtime.c.
Referenced by realtime_matchmore(), and realtime_switch_common().
enum option_flags |
Enumerator | |
---|---|
OPTION_CHEAT | |
OPTION_NUMGAMES | |
OPTION_WAIT | |
OPTION_PATTERNS_DISABLED |
Definition at line 61 of file pbx_realtime.c.
AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , |
"Realtime Switch" | |||
) |
Referenced by load_module().
|
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(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and purge_old_fn().
Referenced by _sip_tcp_helper_thread(), ast_event_new(), ast_rtcp_write(), ast_rtp_dtmf_end_with_duration(), ast_sockaddr_resolve(), ast_stir_shaken_sign(), AST_TEST_DEFINE(), astobj2_test_1_helper(), 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(), realtime_peer(), sendtext_exec(), set_outbound_authentication_credentials(), set_outbound_initial_authentication_credentials(), sfu_topologies_on_source_change(), sipinfo_send(), softmix_bridge_stream_sources_update(), stir_shaken_sign(), and stir_shaken_verify_json().
|
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_INFO_STANDARD_EXTENDED(), AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_SUCCESS, ast_pthread_create, ast_register_switch(), ASTERISK_GPL_KEY, cache_cmp(), cache_hash(), cleanup(), and NULL.
|
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(), MODE_CANMATCH, realtime_common(), and cache_entry::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_entry::context, dup_vars(), cache_entry::exten, free_entry(), MODE_MATCH, NULL, OBJ_POINTER, cache_entry::priority, realtime_switch_common(), S_OR, switch_opts, table, 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, EXT_DATA_SIZE, LOG_NOTICE, LOG_WARNING, MODE_MATCH, ast_variable::name, ast_variable::next, NULL, pbx_exec(), pbx_findapp(), pbx_substitute_variables_helper(), realtime_common(), S_OR, term_color(), ast_variable::value, and cache_entry::var.
|
static |
Definition at line 289 of file pbx_realtime.c.
References ast_variables_destroy(), MODE_MATCH, realtime_common(), and cache_entry::var.
|
static |
Definition at line 382 of file pbx_realtime.c.
References ast_variables_destroy(), MODE_MATCHMORE, realtime_common(), and cache_entry::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(), extension_length_comparator(), match(), MODE_CANMATCH, MODE_MATCH, MODE_MATCHMORE, NULL, OPTION_PATTERNS_DISABLED, SENTINEL, and cache_entry::var.
Referenced by realtime_common().
|
static |
Definition at line 402 of file pbx_realtime.c.
References ao2_ref, ast_unregister_switch(), and NULL.
struct ao2_container* cache |
Definition at line 77 of file pbx_realtime.c.
Referenced by ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), AST_TEST_DEFINE(), cache_dtor(), load_module(), 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_complete_name(), sorcery_memory_cache_complete_object_name(), sorcery_memory_cache_destructor(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_hash(), sorcery_memory_cache_populate(), sorcery_memory_cache_retrieve_fields(), 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_destructor(), stasis_cache_create_full(), stasis_caching_topic_create(), and unload_module().
pthread_t cleanup_thread = 0 |
Definition at line 78 of file pbx_realtime.c.
|
static |
Definition at line 392 of file pbx_realtime.c.
|
static |
Definition at line 67 of file pbx_realtime.c.
Referenced by realtime_common().