64 static char *app =
"SoftHangup";
67 OPTION_ALL = (1 << 0),
87 if (ast_strlen_zero(data)) {
88 ast_log(LOG_WARNING,
"SoftHangup requires an argument (Technology/resource)\n");
97 lenmatch = strlen(args.channel);
106 if (ast_test_flag(&flags, OPTION_ALL)) {
109 cut = strrchr(name,
'/');
113 cut = strrchr(name,
'-');
119 if (!strcasecmp(name, args.channel)) {
120 ast_verb(4,
"Soft hanging %s up.\n", ast_channel_name(c));
122 if (!ast_test_flag(&flags, OPTION_ALL)) {
123 ast_channel_unlock(c);
128 ast_channel_unlock(c);
137 static int unload_module(
void)
142 static int load_module(
void)
147 AST_MODULE_INFO_STANDARD(
ASTERISK_GPL_KEY,
"Hangs up the requested channel");
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
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.
#define ast_channel_unref(c)
Decrease channel reference count.
int ast_softhangup(struct ast_channel *chan, int cause)
Softly hangup up a channel.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
General Asterisk PBX channel definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Core PBX routines and definitions.
const ast_string_field name
union ast_frame::@224 data
Structure used to handle boolean flags.
struct ast_channel_iterator * ast_channel_iterator_by_name_new(const char *name, size_t name_len)
Create a new channel iterator based on name.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.