36 #include <sys/ioctl.h> 46 static const char app[] =
"ChanIsAvail";
105 int option_state = 0;
106 int string_compare = 0;
107 int option_all_avail = 0;
130 if (strchr(
args.options,
'a')) {
131 option_all_avail = 1;
133 if (strchr(
args.options,
's')) {
136 if (strchr(
args.options,
't')) {
141 rest =
args.reqchans;
145 while ((tech =
strsep(&rest,
"&"))) {
148 number = strchr(tech,
'/');
163 if (string_compare) {
167 snprintf(trychan,
sizeof(trychan),
"%s/%s", tech, number);
169 }
else if (option_state) {
174 snprintf(trychan,
sizeof(trychan),
"%s/%s", tech, number);
198 if (!option_all_avail) {
228 .optional_modules =
"func_cdr"
Main Channel structure associated with a channel.
ast_device_state
Device States.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static int unload_module(void)
enum ast_device_state ast_parse_device_state(const char *device)
Search the Channels by Name.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_str_alloca(init_len)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static int load_module(void)
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_strlen_zero(foo)
struct ast_channel * ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel.
General Asterisk PBX channel definitions.
static int chanavail_exec(struct ast_channel *chan, const char *data)
Data structure associated with a custom dialplan function.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Core PBX routines and definitions.
struct ast_custom_function * ast_custom_function_find(const char *name)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
Module has failed to load, may be in an inconsistent state.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
char * strsep(char **str, const char *delims)
const char * ast_channel_name(const struct ast_channel *chan)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
#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.