138    if (
args.argc != 2) {
 
  146        ast_log(
LOG_ERROR, 
"Unable to allocate buffer, cause information will be unavailable!\n");
 
  151    if (!strcmp(
args.type, 
"tech_extended")) {
 
  173    if (!strcmp(
args.type, 
"ast")) {
 
  175    } 
else if (!strcmp(
args.type, 
"tech")) {
 
  177    } 
else if (!strcmp(
args.type, 
"tech_extended")) {
 
 
  245    .
name = 
"HANGUPCAUSE",
 
 
  250    .
name = 
"HANGUPCAUSE_KEYS",
 
 
  254static const char app[] = 
"HangupCauseClear";
 
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_iterator_next(iter)
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
General Asterisk PBX channel definitions.
struct ast_control_pvt_cause_code * ast_channel_dialed_causes_find(const struct ast_channel *chan, const char *chan_name)
Retrieve a ref-counted cause code information structure.
#define ast_channel_lock(chan)
struct ast_str * ast_channel_dialed_causes_channels(const struct ast_channel *chan)
Retrieve a comma-separated list of channels for which dialed cause information is available.
const char * ast_cause2str(int cause) attribute_pure
Gives the string form of a given cause code.
struct ao2_iterator * ast_channel_dialed_causes_find_multiple(const struct ast_channel *chan, const char *chan_name)
Retrieve a ref-counted cause code information structure iterator.
void ast_channel_dialed_causes_clear(const struct ast_channel *chan)
Clear all cause information from the channel.
#define ast_channel_unlock(chan)
static int hangupcause_clear_exec(struct ast_channel *chan, const char *data)
static int hangupcause_keys_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int load_module(void)
static int unload_module(void)
static struct ast_custom_function hangupcause_function
static struct ast_custom_function hangupcause_keys_function
static int hangupcause_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Core PBX routines and definitions.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Main Channel structure associated with a channel.
unsigned int cause_extended
Data structure associated with a custom dialplan function.
Support for dynamic strings.