93 snprintf(varname,
VAR_SIZE,
"%s_%d", prefix, idx);
182 const char *if_pri =
NULL;
183 char *my_name =
NULL;
186 const char *
prefix =
"IF";
188 int used_index_i = -1, x=0;
202 snprintf(used_index,
VAR_SIZE,
"%d", used_index_i);
203 snprintf(new_index,
VAR_SIZE,
"%d", used_index_i + 1);
210 memset(my_name, 0, size);
220 snprintf(varname,
VAR_SIZE,
"%s_%s", prefix, label);
223 snprintf(end_varname,
VAR_SIZE,
"END_%s",varname);
229 const char *goto_str;
232 snprintf(end_varname,
VAR_SIZE,
"END_%s",varname);
240 ast_verb(3,
"Jumping to priority %d\n", pri);
242 }
else if (end == 2) {
250 if (!end && !if_pri) {
254 memset(goto_str, 0, size);
257 }
else if (end && if_pri) {
259 snprintf(end_varname,
VAR_SIZE,
"END_%s", varname);
264 memset(goto_str, 0, size);
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
ast_include: include= support in extensions.conf
static struct ast_exten * find_matching_priority(struct ast_context *c, const char *exten, int priority, const char *callerid)
int ast_unlock_context(struct ast_context *con)
#define ast_channel_lock(chan)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
static int unload_module(void)
int ast_get_extension_priority(struct ast_exten *exten)
static int if_start_exec(struct ast_channel *chan, const char *data)
Asterisk main include file. File version handling, generic pbx functions.
ast_exten: An extension The dialplan is saved as a linked list with each context having it's own link...
const char * ast_get_context_name(struct ast_context *con)
static int _if_exec(struct ast_channel *chan, const char *data, int end)
const char * ast_get_extension_app(struct ast_exten *e)
int pbx_checkcondition(const char *condition)
Evaluate a condition.
struct ast_context * ast_walk_contexts(struct ast_context *con)
int ast_rdlock_contexts(void)
Read locks the context list.
static int if_end_exec(struct ast_channel *chan, const char *data)
static int load_module(void)
int ast_unregister_application(const char *app)
Unregister an application.
int ast_channel_priority(const struct ast_channel *chan)
#define ast_verb(level,...)
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "If Branch and Conditional Execution")
General Asterisk PBX channel definitions.
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
#define ast_strdupa(s)
duplicate a string in memory from the stack
const char * ast_get_extension_cidmatch(struct ast_exten *e)
const char * ast_channel_exten(const struct ast_channel *chan)
Core PBX routines and definitions.
static int find_matching_endif(struct ast_channel *chan)
static const char * get_index(struct ast_channel *chan, const char *prefix, int idx)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
int ast_context_includes_count(const struct ast_context *con)
int ast_unlock_contexts(void)
Unlocks contexts.
static int if_exit_exec(struct ast_channel *chan, const char *data)
const char * ast_get_extension_name(struct ast_exten *exten)
struct ast_exten * ast_walk_context_extensions(struct ast_context *con, struct ast_exten *priority)
#define ast_channel_unlock(chan)
int ast_extension_match(const char *pattern, const char *extension)
Determine if a given extension matches a given pattern (in NXX format)
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...
const char * ast_get_include_name(const struct ast_include *include)
struct ast_exten * ast_walk_extension_priorities(struct ast_exten *exten, struct ast_exten *priority)
const char * ast_channel_context(const struct ast_channel *chan)
#define ASTERISK_GPL_KEY
The text the key() function should return.
void ast_channel_priority_set(struct ast_channel *chan, int value)
int ast_get_extension_matchcid(struct ast_exten *e)
Asterisk module definitions.
ast_context: An extension context - must remain in sync with fake_context
const struct ast_include * ast_context_includes_get(const struct ast_context *con, int idx)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
int ast_rdlock_context(struct ast_context *con)
Read locks a given context.
static char prefix[MAX_PREFIX]