124#define MAXRESULT 1024
145 char *s, *appname, *endargs;
153 appname =
strsep(&s,
"(");
155 endargs = strrchr(s,
')');
179 char *s, *appname, *endargs;
187 appname =
strsep(&s,
"(");
189 endargs = strrchr(s,
')');
214 char *truedata =
NULL, *falsedata =
NULL, *
end, *firstcomma, *firstquestion;
226 firstcomma = strchr(parse,
',');
227 firstquestion = strchr(parse,
'?');
229 if ((firstcomma !=
NULL && firstquestion !=
NULL && firstcomma < firstquestion) || (firstquestion ==
NULL)) {
238 ast_log(
LOG_WARNING,
"Deprecated syntax found. Please upgrade to using ExecIf(<expr>?%s(%s))\n", depr.appname, depr.appargs);
241 expr.expr = depr.expr;
242 apps.t = depr.appname;
244 truedata = depr.appargs;
250 ast_log(
LOG_ERROR,
"Usage: ExecIf(<expr>?<appiftrue>(<args>)[:<appiffalse>(<args)])\n");
256 if (
apps.t && (truedata = strchr(
apps.t,
'('))) {
258 if ((
end = strrchr(truedata,
')'))) {
263 if (
apps.f && (falsedata = strchr(
apps.f,
'('))) {
265 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)
char * strsep(char **str, const char *delims)
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)
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.