Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
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) |
'show hanguphandlers all' CLI command implementation function... More... | |
static char * | handle_show_hangup_channel (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
'show hanguphandlers <channel>' CLI command implementation function... More... | |
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.
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, AST_LIST_REMOVE_HEAD, and handlers.
Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().
|
static |
Definition at line 177 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(), AST_LIST_HEAD_INIT_NOLOCK, and handlers.
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, handlers, 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(), handler(), handlers, 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(), handlers, NULL, and publish_hangup_handler_message().
Referenced by __ast_pbx_run(), and ast_hangup().
|
static |
Definition at line 190 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, HANDLER_FORMAT, and handlers.
Referenced by handle_show_hangup_all(), and handle_show_hangup_channel().
|
static |
'show hanguphandlers all' CLI command implementation function...
Definition at line 244 of file pbx_hangup_handler.c.
References a, 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, NULL, and ast_cli_entry::usage.
|
static |
'show hanguphandlers <channel>' CLI command implementation function...
Definition at line 208 of file pbx_hangup_handler.c.
References a, ast_cli_entry::args, 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, NULL, and ast_cli_entry::usage.
int load_pbx_hangup_handler | ( | void | ) |
Provided by pbx_hangup_handler.c
Definition at line 288 of file pbx_hangup_handler.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_register_cleanup(), cli, 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(), handler(), 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 283 of file pbx_hangup_handler.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and cli.
Referenced by load_pbx_hangup_handler().
|
static |
Definition at line 278 of file pbx_hangup_handler.c.
Referenced by load_pbx_hangup_handler(), and unload_pbx_hangup_handler().