|
Asterisk - The Open Source Telephony Project GIT-master-590b490
|
PJSIP Endpoint Maintenance Mode. More...
#include "asterisk.h"#include <pjsip.h>#include "asterisk/res_pjsip.h"#include "asterisk/res_pjsip_session.h"#include "asterisk/manager.h"#include "asterisk/module.h"#include "asterisk/logger.h"#include "asterisk/cli.h"#include "asterisk/sorcery.h"#include "asterisk/astobj2.h"#include "asterisk/strings.h"
Go to the source code of this file.
Enumerations | |
| enum | { MAINT_HASH_BUCKETS = 53 } |
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | ami_maint_entry_cb (void *obj, void *arg, int flags) |
| ao2_callback used to emit one PJSIPMaintenanceStatus AMI list entry | |
| static int | ami_set_maintenance (struct mansession *s, const struct message *m) |
| static int | ami_show_maintenance (struct mansession *s, const struct message *m) |
| static int | apply_maintenance_state (const char *endpoint_name, int enable) |
| struct ast_module * | AST_MODULE_SELF_SYM (void) |
| static char * | cli_complete_endpoint (const char *word) |
| static int | cli_maint_entry_cb (void *obj, void *arg, int flags) |
| ao2_callback used to print one maintenance entry to the CLI | |
| static char * | handle_cli_pjsip_set_maintenance (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static char * | handle_cli_pjsip_show_maintenance (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static int | load_module (void) |
| static void | maint_endpoint_deleted (const void *obj) |
| static int | maint_session_create (struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact, const char *location, const char *request_user, struct ast_stream_topology *req_topology) |
| static int | maint_set_add (const char *endpoint_name) |
| static int | maint_set_remove (const char *endpoint_name) |
| static pj_bool_t | maintenance_on_rx_request (pjsip_rx_data *rdata) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Endpoint Maintenance Mode" , .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_APP_DEPEND, .requires = "res_pjsip,res_pjsip_session", } |
| static const struct ast_module_info * | ast_module_info = &__mod_info |
| static struct ast_cli_entry | cli_maintenance [] |
| static const struct ast_sorcery_observer | endpoint_observer |
| static struct pjsip_module | maintenance_pjsip_mod |
| static struct ast_sip_session_supplement | maintenance_session_supplement |
| static struct ao2_container * | maintenance_set |
PJSIP Endpoint Maintenance Mode.
Provides a runtime toggle to place individual PJSIP endpoints into maintenance mode. While an endpoint is in maintenance mode:
CLI: pjsip set maintenance <on|off> <endpoint|all> pjsip show maintenance [endpoint]
AMI actions: PJSIPSetMaintenance, PJSIPShowMaintenance
Definition in file res_pjsip_maintenance.c.
| anonymous enum |
| Enumerator | |
|---|---|
| MAINT_HASH_BUCKETS | |
Definition at line 154 of file res_pjsip_maintenance.c.
|
static |
Definition at line 754 of file res_pjsip_maintenance.c.
|
static |
Definition at line 754 of file res_pjsip_maintenance.c.
|
static |
ao2_callback used to emit one PJSIPMaintenanceStatus AMI list entry
Definition at line 654 of file res_pjsip_maintenance.c.
References ast_sip_ami::arg, ast_free, ast_sip_create_ami_event(), ast_str_append(), ast_str_buffer(), astman_append(), buf, ast_sip_ami::count, name, and ast_sip_ami::s.
Referenced by ami_show_maintenance().
|
static |
Definition at line 562 of file res_pjsip_maintenance.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, apply_maintenance_state(), ast_log, ast_sip_get_endpoints(), ast_sip_get_sorcery(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), astman_send_error_va(), EVENT_FLAG_SYSTEM, LOG_NOTICE, and manager_event.
Referenced by load_module().
|
static |
Definition at line 672 of file res_pjsip_maintenance.c.
References ast_sip_ami::action_id, ami_maint_entry_cb(), ao2_callback, ao2_find, ao2_ref, ast_sip_ami::arg, ast_free, ast_sip_create_ami_event(), ast_str_append(), ast_str_buffer(), ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), buf, ast_sip_ami::count, ast_sip_ami::m, maintenance_set, NULL, OBJ_NODATA, OBJ_SEARCH_KEY, and ast_sip_ami::s.
Referenced by load_module().
|
static |
Definition at line 212 of file res_pjsip_maintenance.c.
References maint_set_add(), and maint_set_remove().
Referenced by ami_set_maintenance(), and handle_cli_pjsip_set_maintenance().
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 754 of file res_pjsip_maintenance.c.
|
static |
Definition at line 348 of file res_pjsip_maintenance.c.
References ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli_completion_add(), ast_sip_get_sorcery(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_prefix(), ast_strdup, endpoints, and NULL.
Referenced by handle_cli_pjsip_set_maintenance(), and handle_cli_pjsip_show_maintenance().
|
static |
ao2_callback used to print one maintenance entry to the CLI
Definition at line 495 of file res_pjsip_maintenance.c.
References ast_cli(), and name.
Referenced by handle_cli_pjsip_show_maintenance().
|
static |
Definition at line 374 of file res_pjsip_maintenance.c.
References a, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, apply_maintenance_state(), ast_cli(), ast_cli_complete(), ast_cli_completion_add(), ast_log, ast_sip_get_endpoints(), ast_sip_get_sorcery(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strdup, cli_complete_endpoint(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, EVENT_FLAG_SYSTEM, LOG_NOTICE, manager_event, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 503 of file res_pjsip_maintenance.c.
References a, ao2_callback, ao2_container_count(), ao2_find, ao2_ref, ast_cli(), cli_complete_endpoint(), CLI_GENERATE, CLI_INIT, cli_maint_entry_cb(), CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, maintenance_set, NULL, OBJ_NODATA, OBJ_SEARCH_KEY, and ast_cli_entry::usage.
|
static |
Definition at line 714 of file res_pjsip_maintenance.c.
References ami_set_maintenance(), ami_show_maintenance(), AO2_ALLOC_OPT_LOCK_RWLOCK, ARRAY_LEN, ast_cli_register_multiple, ast_log, ast_manager_register_xml, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_sip_get_sorcery(), ast_sip_register_service(), ast_sip_session_register_supplement, ast_sorcery_observer_add(), ast_str_container_alloc_options(), cli_maintenance, endpoint_observer, EVENT_FLAG_REPORTING, EVENT_FLAG_SYSTEM, LOG_ERROR, MAINT_HASH_BUCKETS, maintenance_pjsip_mod, maintenance_session_supplement, and maintenance_set.
|
static |
Definition at line 333 of file res_pjsip_maintenance.c.
References ast_sorcery_object_get_id(), and maint_set_remove().
|
static |
Definition at line 226 of file res_pjsip_maintenance.c.
References ao2_find, ao2_ref, ast_log, ast_sorcery_object_get_id(), LOG_NOTICE, maintenance_set, and OBJ_SEARCH_KEY.
|
static |
Definition at line 171 of file res_pjsip_maintenance.c.
References ao2_find, ao2_ref, ast_str_container_add(), maintenance_set, and OBJ_SEARCH_KEY.
Referenced by apply_maintenance_state().
|
static |
Definition at line 189 of file res_pjsip_maintenance.c.
References ao2_find, ao2_ref, maintenance_set, OBJ_SEARCH_KEY, and OBJ_UNLINK.
Referenced by apply_maintenance_state(), and maint_endpoint_deleted().
|
static |
Definition at line 254 of file res_pjsip_maintenance.c.
References ao2_find, ao2_ref, ast_log, ast_pjsip_rdata_get_endpoint(), ast_sip_get_pjsip_endpoint(), ast_sorcery_object_get_id(), LOG_NOTICE, maintenance_set, method, NULL, and OBJ_SEARCH_KEY.
|
static |
Definition at line 735 of file res_pjsip_maintenance.c.
References ao2_cleanup, ARRAY_LEN, ast_cli_unregister_multiple(), ast_manager_unregister(), ast_sip_get_sorcery(), ast_sip_session_unregister_supplement(), ast_sip_unregister_service(), ast_sorcery_observer_remove(), cli_maintenance, endpoint_observer, maintenance_pjsip_mod, maintenance_session_supplement, maintenance_set, and NULL.
|
static |
Definition at line 754 of file res_pjsip_maintenance.c.
|
static |
Definition at line 754 of file res_pjsip_maintenance.c.
|
static |
Definition at line 555 of file res_pjsip_maintenance.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 338 of file res_pjsip_maintenance.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 317 of file res_pjsip_maintenance.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 242 of file res_pjsip_maintenance.c.
Referenced by load_module(), and unload_module().
|
static |
Endpoints currently in maintenance mode. Protected by the container's own internal RWLOCK. No other locks are ever held simultaneously with this container.
Definition at line 162 of file res_pjsip_maintenance.c.
Referenced by ami_show_maintenance(), handle_cli_pjsip_show_maintenance(), load_module(), maint_session_create(), maint_set_add(), maint_set_remove(), maintenance_on_rx_request(), and unload_module().