119 strcpy(buf, data && *data ?
"0" :
"1");
127 strcpy(buf, data && *data ?
"1" :
"0");
141 expr =
strsep(&data,
"?");
142 iftrue =
strsep(&data,
":");
147 "Syntax IFTIME(<timespec>?[<true>][:<false>])\n");
179 args2.iftrue = args2.iffalse =
NULL;
190 ast_log(
LOG_WARNING,
"Syntax IF(<expr>?[<true>][:<false>]) (expr must be non-null, and either <true> or <false> must be non-null)\n");
191 ast_log(
LOG_WARNING,
" In this case, <expr>='%s', <true>='%s', and <false>='%s'\n", args1.expr, args2.iftrue, args2.iffalse);
199 args2.iffalse =
ast_strip(args2.iffalse);
252 sprintf(s,
"${%s}",
args.varname);
static struct ast_custom_function set_function
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
static int import_read2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_channel_unref(c)
Decrease channel reference count.
static int exists(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define ast_str_make_space(buf, new_len)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static int acf_if(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int set2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len)
int pbx_checkcondition(const char *condition)
Evaluate a condition.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
static int import_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
#define ast_strlen_zero(foo)
static struct ast_custom_function isnull_function
char * ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
Strip leading/trailing whitespace and quotes from a string.
General Asterisk PBX channel definitions.
static int unload_module(void)
static struct ast_custom_function exists_function
Data structure associated with a custom dialplan function.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
static struct ast_custom_function if_time_function
static struct ast_custom_function import_function
Core PBX routines and definitions.
static int iftime(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
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...
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_destroy_timing(struct ast_timing *i)
Deallocates memory structures associated with a timing bitmap.
#define ast_channel_unlock(chan)
static int load_module(void)
static struct ast_custom_function if_function
int ast_build_timing(struct ast_timing *i, const char *info)
Construct a timing bitmap, for use in time-based conditionals.
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...
char * strsep(char **str, const char *delims)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
static int isnull(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
#define ASTERISK_GPL_KEY
The text the key() function should return.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
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_custom_function_register(acf)
Register a custom function.
static int import_helper(struct ast_channel *chan, const char *cmd, char *data, char *buf, struct ast_str **str, ssize_t len)
#define AST_APP_ARG(name)
Define an application argument.