Asterisk - The Open Source Telephony Project
18.5.0
|
PBX Hangup Handler management routines. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/app.h"
#include "asterisk/cli.h"
#include "asterisk/linkedlists.h"
#include "asterisk/pbx.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Macros | |
#define | HANDLER_FORMAT "%-30s %s\n" |
Functions | |
void | ast_pbx_hangup_handler_destroy (struct ast_channel *chan) |
Destroy the hangup handler container on a channel. More... | |
static void | ast_pbx_hangup_handler_headers (int fd) |
void | ast_pbx_hangup_handler_init (struct ast_channel *chan) |
Init the hangup handler container on a channel. More... | |
int | ast_pbx_hangup_handler_pop (struct ast_channel *chan) |
Pop the top of the channel hangup handler stack. More... | |
void | ast_pbx_hangup_handler_push (struct ast_channel *chan, const char *handler) |
Push the given hangup handler onto the channel hangup handler stack. More... | |
int | ast_pbx_hangup_handler_run (struct ast_channel *chan) |
Run all hangup handlers on the channel. More... | |
static void | ast_pbx_hangup_handler_show (int fd, struct ast_channel *chan) |
static char * | handle_show_hangup_all (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_show_hangup_channel (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
int | load_pbx_hangup_handler (void) |
static void | publish_hangup_handler_message (const char *action, struct ast_channel *chan, const char *handler) |
static void | unload_pbx_hangup_handler (void) |
Variables | |
static struct ast_cli_entry | cli [] |
PBX Hangup Handler management routines.
Definition in file pbx_hangup_handler.c.
#define HANDLER_FORMAT "%-30s %s\n" |
Definition at line 168 of file pbx_hangup_handler.c.
Referenced by ast_pbx_hangup_handler_headers(), and ast_pbx_hangup_handler_show().
void ast_pbx_hangup_handler_destroy | ( | struct ast_channel * | chan | ) |
Destroy the hangup handler container on a channel.
chan | Channel to destroy the hangup handler container on. |
Definition at line 103 of file pbx_hangup_handler.c.
References ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, and AST_LIST_REMOVE_HEAD.
Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().
|
static |
Definition at line 179 of file pbx_hangup_handler.c.
References ast_cli(), and HANDLER_FORMAT.
Referenced by handle_show_hangup_all(), and handle_show_hangup_channel().
void ast_pbx_hangup_handler_init | ( | struct ast_channel * | chan | ) |
Init the hangup handler container on a channel.
chan | Channel to init the hangup handler container on. |
Definition at line 95 of file pbx_hangup_handler.c.
References ast_channel_hangup_handlers(), and AST_LIST_HEAD_INIT_NOLOCK.
Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().
int ast_pbx_hangup_handler_pop | ( | struct ast_channel * | chan | ) |
Pop the top of the channel hangup handler stack.
chan | Channel to push the hangup handler onto. |
TRUE | if a handler was popped off of the stack. |
Definition at line 119 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, AST_LIST_REMOVE_HEAD, and publish_hangup_handler_message().
Referenced by func_channel_write_real().
void ast_pbx_hangup_handler_push | ( | struct ast_channel * | chan, |
const char * | handler | ||
) |
Push the given hangup handler onto the channel hangup handler stack.
chan | Channel to push the hangup handler onto. |
handler | Gosub application parameter string. |
Definition at line 138 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_app_expand_sub_args(), ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, AST_LIST_INSERT_HEAD, ast_malloc, ast_strlen_zero, and publish_hangup_handler_message().
Referenced by func_channel_write_real().
int ast_pbx_hangup_handler_run | ( | struct ast_channel * | chan | ) |
Run all hangup handlers on the channel.
chan | Channel to run the hangup handlers on. |
Zero | if no hangup handlers run. |
non-zero | if hangup handlers were run. |
Definition at line 58 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_app_exec_sub(), ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, AST_LIST_EMPTY, AST_LIST_REMOVE_HEAD, AST_SOFTHANGUP_HANGUP_EXEC, ast_softhangup_nolock(), NULL, and publish_hangup_handler_message().
Referenced by __ast_pbx_run(), and ast_hangup().
|
static |
Definition at line 194 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_cli(), AST_LIST_TRAVERSE, first, and HANDLER_FORMAT.
Referenced by handle_show_hangup_all(), and handle_show_hangup_channel().
|
static |
Definition at line 248 of file pbx_hangup_handler.c.
References ast_cli_args::argc, ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_unref, ast_pbx_hangup_handler_headers(), ast_pbx_hangup_handler_show(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 212 of file pbx_hangup_handler.c.
References ast_cli_args::argc, ast_cli_entry::args, ast_cli_args::argv, ast_channel_get_by_name(), ast_channel_unref, ast_cli(), ast_complete_channels(), ast_pbx_hangup_handler_headers(), ast_pbx_hangup_handler_show(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, ast_cli_entry::usage, and ast_cli_args::word.
int load_pbx_hangup_handler | ( | void | ) |
Provided by pbx_hangup_handler.c
Definition at line 292 of file pbx_hangup_handler.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_register_cleanup(), and unload_pbx_hangup_handler().
Referenced by asterisk_daemon().
|
static |
Definition at line 44 of file pbx_hangup_handler.c.
References ast_channel_hangup_handler_type(), ast_channel_publish_blob(), ast_json_pack(), ast_json_unref(), NULL, RAII_VAR, and S_OR.
Referenced by ast_pbx_hangup_handler_pop(), ast_pbx_hangup_handler_push(), and ast_pbx_hangup_handler_run().
|
static |
Definition at line 287 of file pbx_hangup_handler.c.
References ARRAY_LEN, and ast_cli_unregister_multiple().
Referenced by load_pbx_hangup_handler().
|
static |
Definition at line 282 of file pbx_hangup_handler.c.