Dialplan group functions check if a dialplan entry exists.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Dialplan Context/Extension/Priority Checking Functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, } |
|
static struct ast_custom_function | acf_isexten |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_custom_function | isexten_function |
|
Dialplan group functions check if a dialplan entry exists.
- Author
- Gregory Nietsky AKA irroot grego.nosp@m.ry@n.nosp@m.etwor.nosp@m.ksen.nosp@m.try.c.nosp@m.o.za
-
Russell Bryant russe.nosp@m.ll@d.nosp@m.igium.nosp@m..com
Definition in file func_dialplan.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ acf_isexten_exec()
static int acf_isexten_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
parse, |
|
|
char * |
buffer, |
|
|
size_t |
buflen |
|
) |
| |
|
static |
Definition at line 128 of file func_dialplan.c.
129{
130 int priority_int;
135 );
136
137 if (!chan) {
139 return -1;
140 }
141
143
146 }
147
149 ast_log(
LOG_WARNING,
"Syntax: VALID_EXTEN([<context>],<extension>[,<priority>]) - missing argument <extension>!\n");
150 return -1;
151 }
152
154 priority_int = 1;
155 } else {
156 priority_int = atoi(
args.priority);
157 }
158
162 } else {
164 }
165
166 return 0;
167}
#define ast_strdupa(s)
duplicate a string in memory from the stack
const char * ast_channel_context(const struct ast_channel *chan)
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
#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.
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
structure to hold extensions
References args, AST_APP_ARG, ast_channel_caller(), ast_channel_context(), ast_copy_string(), AST_DECLARE_APP_ARGS, ast_exists_extension(), ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), voicemailpwcheck::context, LOG_WARNING, NULL, priority, and S_COR.
◆ AST_MODULE_SELF_SYM()
◆ isexten_function_read()
static int isexten_function_read |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
data, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
static |
Definition at line 73 of file func_dialplan.c.
75{
76 char *parse;
81 );
82
84
87 return -1;
88 }
89
92
94 int priority_num;
95 if (sscanf(
args.priority,
"%30d", &priority_num) == 1 && priority_num > 0) {
96 int res;
100 if (res)
102 } else {
103 int res;
107 if (res > 0)
109 }
111 int res;
115 if (res)
120 } else {
122 return -1;
123 }
124
125 return 0;
126}
int ast_findlabel_extension(struct ast_channel *c, const char *context, const char *exten, const char *label, const char *callerid)
Find the priority of an extension that has the specified label.
struct ast_context * ast_context_find(const char *name)
Find a context.
References args, AST_APP_ARG, ast_channel_caller(), ast_context_find(), AST_DECLARE_APP_ARGS, ast_exists_extension(), ast_findlabel_extension(), ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), buf, voicemailpwcheck::context, LOG_ERROR, NULL, priority, and S_COR.
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Dialplan Context/Extension/Priority Checking Functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, } |
|
static |
◆ acf_isexten
Initial value:= {
.name = "VALID_EXTEN",
}
static int acf_isexten_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
Definition at line 175 of file func_dialplan.c.
Referenced by load_module(), and unload_module().
◆ ast_module_info
◆ isexten_function
Initial value:= {
.name = "DIALPLAN_EXISTS",
.read_max = 2,
}
static int isexten_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Definition at line 169 of file func_dialplan.c.
Referenced by load_module(), and unload_module().