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 exec_exec(struct ast_channel *chan, const char *data)
static int load_module(void)
static const char app_tryexec[]
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
static int unload_module(void)
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
Registered applications container.
#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.
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 const char app_execif[]
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
static int execif_exec(struct ast_channel *chan, const char *data)
static int tryexec_exec(struct ast_channel *chan, const char *data)
static const char app_exec[]
#define ast_strlen_zero(foo)
General Asterisk PBX channel definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Core PBX routines and definitions.
#define AST_NONSTANDARD_RAW_ARGS(args, parse, sep)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static void parse(struct mgcp_request *req)
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)
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
ast_app: A registered application
union ast_frame::@263 data
struct ast_app * pbx_findapp(const char *app)
Look up an application.
#define ASTERISK_GPL_KEY
The text the key() function should return.
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_register_application_xml(app, execute)
Register an application using XML documentation.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
#define AST_APP_ARG(name)
Define an application argument.