115#define MAXRESULT 1024
136 char *s, *appname, *endargs;
144 appname =
strsep(&s,
"(");
146 endargs = strrchr(s,
')');
170 char *s, *appname, *endargs;
178 appname =
strsep(&s,
"(");
180 endargs = strrchr(s,
')');
205 char *truedata =
NULL, *falsedata =
NULL, *
end, *firstcomma, *firstquestion;
217 firstcomma = strchr(parse,
',');
218 firstquestion = strchr(parse,
'?');
220 if ((firstcomma !=
NULL && firstquestion !=
NULL && firstcomma < firstquestion) || (firstquestion ==
NULL)) {
229 ast_log(
LOG_WARNING,
"Deprecated syntax found. Please upgrade to using ExecIf(<expr>?%s(%s))\n", depr.appname, depr.appargs);
232 expr.expr = depr.expr;
233 apps.t = depr.appname;
235 truedata = depr.appargs;
241 ast_log(
LOG_ERROR,
"Usage: ExecIf(<expr>?<appiftrue>(<args>)[:<appiffalse>(<args)])\n");
247 if (
apps.t && (truedata = strchr(
apps.t,
'('))) {
249 if ((
end = strrchr(truedata,
')'))) {
254 if (
apps.f && (falsedata = strchr(
apps.f,
'('))) {
256 if ((
end = strrchr(falsedata,
')'))) {
static int tryexec_exec(struct ast_channel *chan, const char *data)
static const char app_execif[]
static int execif_exec(struct ast_channel *chan, const char *data)
static const char app_exec[]
static int load_module(void)
static int unload_module(void)
static const char app_tryexec[]
static int exec_exec(struct ast_channel *chan, const char *data)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
General Asterisk PBX channel definitions.
Generic File Format Support. Should be included by clients of the file handling routines....
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_RAW_ARGS(args, parse, sep)
char * strsep(char **str, const char *delims)
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.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Core PBX routines and definitions.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
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.
int pbx_checkcondition(const char *condition)
Evaluate a condition.
struct ast_app * pbx_findapp(const char *app)
Look up an application.
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)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
Registered applications container.
ast_app: A registered application
Main Channel structure associated with a channel.
Support for dynamic strings.