91 static int eval_exten_read(
struct ast_channel *chan,
const char *cmd,
char *data,
char *buf,
size_t len)
93 char *exten, *pri, *context, *parse;
97 if (ast_strlen_zero(data)) {
98 ast_log(LOG_WARNING,
"The EVAL_EXTEN function requires an extension\n");
104 context = strsep(&parse,
",");
105 exten = strsep(&parse,
",");
106 pri = strsep(&parse,
",");
112 if (ast_strlen_zero(exten) || ast_strlen_zero(context)) {
113 ast_channel_lock(chan);
114 if (ast_strlen_zero(exten)) {
117 if (ast_strlen_zero(context)) {
120 ast_channel_unlock(chan);
133 .
name =
"EVAL_EXTEN",
134 .read = eval_exten_read,
137 static int unload_module(
void)
142 static int load_module(
void)
147 AST_MODULE_INFO_STANDARD_EXTENDED(
ASTERISK_GPL_KEY,
"Extension evaluation function");
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
int pbx_parse_location(struct ast_channel *chan, char **context, char **exten, char **pri, int *ipri, int *mode, char *rest)
Parses a dialplan location into context, extension, priority.
int ast_get_extension_data(char *buf, int bufsize, struct ast_channel *c, const char *context, const char *exten, int priority)
Fill a string buffer with the data at a dialplan extension.
void pbx_substitute_variables_helper_full_location(struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int cp2_size, size_t *used, const char *context, const char *exten, int pri)
Substitutes variables, similar to pbx_substitute_variables_helper_full, but allows passing the contex...
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
General Asterisk PBX channel definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Data structure associated with a custom dialplan function.
Core PBX routines and definitions.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.