152 strcpy(
buf, data && *data ?
"0" :
"1");
160 strcpy(
buf, data && *data ?
"1" :
"0");
174 expr =
strsep(&data,
"?");
175 iftrue =
strsep(&data,
":");
180 "Syntax IFTIME(<timespec>?[<true>][:<false>])\n");
212 args2.iftrue = args2.iffalse =
NULL;
223 ast_debug(1,
"<expr>='%s', <true>='%s', and <false>='%s'\n", args1.expr, args2.iftrue, args2.iffalse);
231 args2.iffalse =
ast_strip(args2.iffalse);
244 varname =
strsep(&data,
"=");
284 sprintf(s,
"${%s}",
args.varname);
321 strcpy(
buf,
var ?
"1" :
"0");
366 .
name =
"VARIABLE_EXISTS",
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
General Asterisk PBX channel definitions.
#define ast_channel_lock(chan)
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
#define ast_channel_unlock(chan)
static int import_read2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
static struct ast_custom_function exists_function
static struct ast_custom_function variable_exists_function
static struct ast_custom_function import_function
static struct ast_custom_function set_function
static int set2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
static int import_helper(struct ast_channel *chan, const char *cmd, char *data, char *buf, struct ast_str **str, ssize_t len)
static struct ast_custom_function if_function
static struct ast_custom_function delete_function
static int set(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static struct ast_custom_function if_time_function
static int variable_exists_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static struct ast_custom_function isnull_function
static int delete_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static int load_module(void)
static int unload_module(void)
static int iftime(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int exists(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int isnull(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int acf_if(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int import_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.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
char * strsep(char **str, const char *delims)
#define ast_debug(level,...)
Log a DEBUG message.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Core PBX routines and definitions.
int ast_build_timing(struct ast_timing *i, const char *info_in)
Construct a timing bitmap, for use in time-based conditionals.
int ast_check_timing(const struct ast_timing *i)
Evaluate a pre-constructed bitmap as to whether the current time falls within the range specified.
int ast_destroy_timing(struct ast_timing *i)
Deallocates memory structures associated with a timing bitmap.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
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.
#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 pbx_checkcondition(const char *condition)
Evaluate a condition.
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
char * ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
Strip leading/trailing whitespace and quotes from a string.
#define ast_str_make_space(buf, new_len)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
Support for dynamic strings.