50 "handler",
S_OR(handler,
""));
142 const char *expanded_handler;
149 if (!expanded_handler) {
152 h_handler =
ast_malloc(
sizeof(*h_handler) + 1 + strlen(expanded_handler));
154 ast_free((
char *) expanded_handler);
157 strcpy(h_handler->
args, expanded_handler);
158 ast_free((
char *) expanded_handler);
168 #define HANDLER_FORMAT "%-30s %s\n" 218 e->
command =
"core show hanguphandlers";
220 "Usage: core show hanguphandlers <channel>\n" 221 " Show hangup handlers of a specified channel.\n";
233 ast_cli(a->
fd,
"Channel does not exist.\n");
255 e->
command =
"core show hanguphandlers all";
257 "Usage: core show hanguphandlers all\n" 258 " Show hangup handlers for all channels.\n";
int load_pbx_hangup_handler(void)
#define ast_channel_lock(chan)
static char * handle_show_hangup_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Main Channel structure associated with a channel.
#define AST_CLI_DEFINE(fn, txt,...)
int ast_pbx_hangup_handler_pop(struct ast_channel *chan)
Pop the top of the channel hangup handler stack.
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
Asterisk main include file. File version handling, generic pbx functions.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
const char * ast_app_expand_sub_args(struct ast_channel *chan, const char *args)
Add missing context/exten to subroutine argument string.
#define ast_channel_unref(c)
Decrease channel reference count.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
static void publish_hangup_handler_message(const char *action, struct ast_channel *chan, const char *handler)
descriptor for a cli entry.
void ast_pbx_hangup_handler_destroy(struct ast_channel *chan)
Destroy the hangup handler container on a channel.
static char * handle_show_hangup_all(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static void ast_pbx_hangup_handler_headers(int fd)
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
static void unload_pbx_hangup_handler(void)
void ast_cli(int fd, const char *fmt,...)
int args
This gets set in ast_cli_register()
#define ast_strlen_zero(foo)
static void ast_pbx_hangup_handler_show(int fd, struct ast_channel *chan)
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
A set of macros to manage forward-linked lists.
#define ast_malloc(len)
A wrapper for malloc()
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Core PBX routines and definitions.
void ast_pbx_hangup_handler_push(struct ast_channel *chan, const char *handler)
Push the given hangup handler onto the channel hangup handler stack.
int ast_pbx_hangup_handler_run(struct ast_channel *chan)
Run all hangup handlers on the channel.
struct sla_ringing_trunk * first
int ast_softhangup_nolock(struct ast_channel *chan, int reason)
Softly hangup up a channel (no channel lock)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define ast_channel_unlock(chan)
struct stasis_message_type * ast_channel_hangup_handler_type(void)
Message type for hangup handler related actions.
struct ast_hangup_handler_list * ast_channel_hangup_handlers(struct ast_channel *chan)
Prototypes for public functions only of internal interest,.
void ast_pbx_hangup_handler_init(struct ast_channel *chan)
Init the hangup handler container on a channel.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
Standard Command Line Interface.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
static void handler(const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
char * ast_complete_channels(const char *line, const char *word, int pos, int state, int rpos)
Command completion for the list of active channels.
int ast_app_exec_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_args, int ignore_hangup)
Run a subroutine on a channel, placing an optional second channel into autoservice.
static struct ast_cli_entry cli[]
Abstract JSON element (object, array, string, int, ...).
void ast_channel_publish_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message.
struct ast_channel_iterator * ast_channel_iterator_all_new(void)
Create a new channel iterator.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...