36 #include "asterisk/pbx.h"
113 snprintf(varname,
VAR_SIZE,
"%s_%d", prefix, idx);
168 int cur_priority = chan->
priority + 1, level=1;
200 const char *while_pri = NULL;
201 char *my_name = NULL;
202 const char *condition = NULL, *
label = NULL;
204 const char *
prefix =
"WHILE";
206 int used_index_i = -1, x=0;
232 snprintf(used_index,
VAR_SIZE,
"%d", used_index_i);
233 snprintf(new_index,
VAR_SIZE,
"%d", used_index_i + 1);
238 size = strlen(chan->
context) + strlen(chan->
exten) + 32;
240 memset(my_name, 0, size);
250 snprintf(varname,
VAR_SIZE,
"%s_%s", prefix, label);
253 snprintf(end_varname,
VAR_SIZE,
"END_%s",varname);
260 const char *goto_str;
263 snprintf(end_varname,
VAR_SIZE,
"END_%s",varname);
271 ast_verb(3,
"Jumping to priority %d\n", pri);
281 if (!end && !while_pri) {
283 size = strlen(chan->
context) + strlen(chan->
exten) + 32;
285 memset(goto_str, 0, size);
290 else if (end && while_pri) {
292 snprintf(end_varname,
VAR_SIZE,
"END_%s", varname);
295 size = strlen(chan->
context) + strlen(chan->
exten) + 32;
297 memset(goto_str, 0, size);
322 const char *
prefix =
"WHILE", *while_pri=NULL;
325 const char *tmp =
get_index(chan, prefix, x);
struct ast_include * ast_walk_context_includes(struct ast_context *con, struct ast_include *inc)
ast_include: include= support in extensions.conf
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.
char * str
Subscriber phone number (Malloced)
int ast_get_extension_priority(struct ast_exten *exten)
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
static const char * get_index(struct ast_channel *chan, const char *prefix, int idx)
ast_exten: An extension The dialplan is saved as a linked list with each context having it's own link...
struct ast_party_caller caller
Channel Caller ID information.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
static int while_start_exec(struct ast_channel *chan, const char *data)
char context[AST_MAX_CONTEXT]
static char * continue_app
const char * ast_get_extension_app(struct ast_exten *e)
static int load_module(void)
int pbx_checkcondition(const char *condition)
Evaluate a condition.
int ast_rdlock_contexts(void)
Read locks the context list.
int ast_unregister_application(const char *app)
Unregister an application.
#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.
struct ast_party_id id
Caller party ID.
const char * ast_get_include_name(struct ast_include *include)
General Asterisk PBX channel definitions.
struct ast_exten * ast_walk_context_extensions(struct ast_context *con, struct ast_exten *priority)
static int while_continue_exec(struct ast_channel *chan, const char *data)
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
static int unload_module(void)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
const char * ast_get_extension_cidmatch(struct ast_exten *e)
struct ast_context * ast_walk_contexts(struct ast_context *con)
const char * ast_get_context_name(struct ast_context *con)
#define ast_strdupa(s)
duplicate a string in memory from the stack
struct ast_exten * ast_walk_extension_priorities(struct ast_exten *exten, struct ast_exten *priority)
int ast_unlock_contexts(void)
Unlocks contexts.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
const char * ast_get_extension_name(struct ast_exten *exten)
#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...
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
static int while_exit_exec(struct ast_channel *chan, const char *data)
static int _while_exec(struct ast_channel *chan, const char *data, int end)
static int while_end_exec(struct ast_channel *chan, const char *data)
static int find_matching_endwhile(struct ast_channel *chan)
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_get_extension_matchcid(struct ast_exten *e)
Asterisk module definitions.
static struct ast_exten * find_matching_priority(struct ast_context *c, const char *exten, int priority, const char *callerid)
ast_context: An extension context
unsigned char valid
TRUE if the number information is valid/present.
char exten[AST_MAX_EXTENSION]
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
int ast_rdlock_context(struct ast_context *con)
Read locks a given context.
static char prefix[MAX_PREFIX]
struct ast_party_number number
Subscriber phone number.