|
Asterisk - The Open Source Telephony Project GIT-master-6144b6b
|
#include "asterisk.h"#include "asterisk/_private.h"#include "asterisk/pbx.h"#include "asterisk/stasis.h"#include "asterisk/vector.h"#include "pbx_private.h"
Go to the source code of this file.
Macros | |
| #define | AUTOHINT_CMP_CONTEXT_NAME(elem, name) (!strcmp(ast_get_context_name(elem), name)) |
Functions | |
| int | ast_extension_state_autohints_init (void) |
| static void | extension_state_autohints_cleanup (void) |
| static void | extension_state_autohints_device_state_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
| void | pbx_extension_state_autohint_remove (struct ast_context *context, unsigned int forced) |
| void | pbx_extension_state_autohint_set (struct ast_context *context) |
Variables | ||
| static struct stasis_subscription * | autohints_subscription | |
| Subscription to receive updates so we can create hints as needed on autohint enabled contexts. | ||
| struct { | ||
| size_t current | ||
| struct ast_context ** elems | ||
| size_t max | ||
| } | extension_state_autohints | |
| Contexts which have autohints enabled. | ||
| static ast_mutex_t | extension_state_autohints_lock = AST_MUTEX_INIT_VALUE | |
| Lock to protect the autohints vector. | ||
| static const char | registrar [] = "autohints" | |
| The static registrar for the added dialplan hints. | ||
| #define AUTOHINT_CMP_CONTEXT_NAME | ( | elem, | |
| name | |||
| ) | (!strcmp(ast_get_context_name(elem), name)) |
Definition at line 111 of file extension_state_autohints.c.
| int ast_extension_state_autohints_init | ( | void | ) |
Provided by extension_state_autohints.c
Definition at line 174 of file extension_state_autohints.c.
References ast_register_cleanup(), AST_VECTOR_INIT, extension_state_autohints, and extension_state_autohints_cleanup().
Referenced by asterisk_daemon().
|
static |
Definition at line 163 of file extension_state_autohints.c.
References ast_mutex_lock, ast_mutex_unlock, AST_VECTOR_FREE, autohints_subscription, extension_state_autohints, extension_state_autohints_lock, and stasis_unsubscribe().
Referenced by ast_extension_state_autohints_init().
|
static |
Definition at line 50 of file extension_state_autohints.c.
References ast_add_extension(), ast_device_state_message_type(), ast_free_ptr(), ast_get_context_name(), ast_mutex_lock, ast_mutex_unlock, ast_strdup, ast_strdupa, ast_strlen_zero(), ast_unlock_contexts(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_wrlock_contexts(), ast_device_state_message::device, E_MATCH, ast_device_state_message::eid, extension_state_autohints, extension_state_autohints_lock, NULL, pbx_find_extension(), PRIORITY_HINT, registrar, pbx_find_info::stacklen, stasis_message_data(), and type.
Referenced by pbx_extension_state_autohint_set().
| void pbx_extension_state_autohint_remove | ( | struct ast_context * | context, |
| unsigned int | forced | ||
| ) |
Definition at line 133 of file extension_state_autohints.c.
References ast_context_destroy_by_name(), ast_get_context_name(), ast_mutex_lock, ast_mutex_unlock, ast_unlock_contexts(), AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_ELEM_DEFAULT_CMP, AST_VECTOR_REMOVE_CMP_UNORDERED, AST_VECTOR_SIZE, ast_wrlock_contexts(), AUTOHINT_CMP_CONTEXT_NAME, autohints_subscription, extension_state_autohints, extension_state_autohints_lock, registrar, and stasis_unsubscribe().
Referenced by __ast_internal_context_destroy(), ast_context_set_autohints(), and context_promote().
| void pbx_extension_state_autohint_set | ( | struct ast_context * | context | ) |
extension_state_autohints.c functions needed by pbx.c
Definition at line 113 of file extension_state_autohints.c.
References ast_device_state_topic_all(), ast_get_context_name(), ast_mutex_lock, ast_mutex_unlock, ast_rdlock_contexts(), ast_unlock_contexts(), AST_VECTOR_APPEND, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_REMOVE_CMP_UNORDERED, AST_VECTOR_SIZE, AUTOHINT_CMP_CONTEXT_NAME, autohints_subscription, extension_state_autohints, extension_state_autohints_device_state_cb(), extension_state_autohints_lock, NULL, and stasis_subscribe.
Referenced by ast_context_set_autohints(), context_merge(), and context_promote().
|
static |
Subscription to receive updates so we can create hints as needed on autohint enabled contexts.
Definition at line 37 of file extension_state_autohints.c.
Referenced by extension_state_autohints_cleanup(), pbx_extension_state_autohint_remove(), and pbx_extension_state_autohint_set().
| size_t current |
Definition at line 34 of file extension_state_autohints.c.
| struct ast_context* * elems |
Definition at line 34 of file extension_state_autohints.c.
| struct { ... } extension_state_autohints |
Contexts which have autohints enabled.
Referenced by ast_extension_state_autohints_init(), extension_state_autohints_cleanup(), extension_state_autohints_device_state_cb(), pbx_extension_state_autohint_remove(), and pbx_extension_state_autohint_set().
|
static |
Lock to protect the autohints vector.
Definition at line 31 of file extension_state_autohints.c.
Referenced by extension_state_autohints_cleanup(), extension_state_autohints_device_state_cb(), pbx_extension_state_autohint_remove(), and pbx_extension_state_autohint_set().
| size_t max |
Definition at line 34 of file extension_state_autohints.c.
|
static |
The static registrar for the added dialplan hints.
Definition at line 40 of file extension_state_autohints.c.
Referenced by __ast_context_create(), __ast_context_destroy(), __ast_context_destroy(), ast_add_extension(), ast_add_extension2(), ast_add_extension2(), ast_add_extension2(), ast_add_extension2_lockopt(), ast_add_extension2_nolock(), ast_context_add_ignorepat(), ast_context_add_ignorepat2(), ast_context_add_ignorepat2(), ast_context_add_ignorepat2(), ast_context_add_include(), ast_context_add_include2(), ast_context_add_include2(), ast_context_add_switch(), ast_context_add_switch2(), ast_context_add_switch2(), ast_context_add_switch2(), ast_context_create(), ast_context_destroy(), ast_context_destroy_by_name(), ast_context_find_or_create(), ast_context_find_or_create(), ast_context_find_or_create(), ast_context_remove_extension(), ast_context_remove_extension2(), ast_context_remove_extension_callerid(), ast_context_remove_extension_callerid2(), ast_context_remove_ignorepat(), ast_context_remove_ignorepat2(), ast_context_remove_include(), ast_context_remove_include2(), ast_context_remove_switch(), ast_context_remove_switch2(), ast_merge_contexts_and_delete(), ast_merge_contexts_and_delete(), AST_TEST_DEFINE(), context_merge(), context_merge_incls_swits_igps_other_registrars(), extension_state_autohints_device_state_cb(), ignorepat_alloc(), include_alloc(), localized_add_extension2(), localized_context_add_ignorepat2(), localized_context_add_include2(), localized_context_add_switch2(), localized_context_destroy(), localized_context_find_or_create(), localized_merge_contexts_and_delete(), parking_add_extension(), parking_lot_cfg_create_extensions(), parking_lot_cfg_remove_extensions(), pbx_extension_state_autohint_remove(), and sw_alloc().