Loopback PBX Module.
More...
Go to the source code of this file.
|
static void | __reg_module (void) |
|
static void | __unreg_module (void) |
|
struct ast_module * | AST_MODULE_SELF_SYM (void) |
|
static int | load_module (void) |
|
static int | loopback_canmatch (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
|
static int | loopback_exec (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
|
static int | loopback_exists (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
|
static int | loopback_matchmore (struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
|
static void | loopback_parse (char **newexten, char **newcontext, int *priority, char **newpattern, char *buf) |
|
static char * | loopback_subst (char *buf, int buflen, const char *exten, const char *context, int priority, const char *data) |
|
static int | unload_module (void) |
|
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Loopback Switch" , .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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_switch | loopback_switch |
|
Loopback PBX Module.
Definition in file pbx_loopback.c.
◆ LOOPBACK_COMMON
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ loopback_canmatch()
static int loopback_canmatch |
( |
struct ast_channel * |
chan, |
|
|
const char * |
context, |
|
|
const char * |
exten, |
|
|
int |
priority, |
|
|
const char * |
callerid, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 140 of file pbx_loopback.c.
References ast_canmatch_extension(), ast_extension_match(), and LOOPBACK_COMMON.
static char exten[AST_MAX_EXTENSION]
int ast_canmatch_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Looks for a valid matching extension.
int ast_extension_match(const char *pattern, const char *extension)
Determine if a given extension matches a given pattern (in NXX format)
◆ loopback_exec()
static int loopback_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
context, |
|
|
const char * |
exten, |
|
|
int |
priority, |
|
|
const char * |
callerid, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 150 of file pbx_loopback.c.
References ast_spawn_extension(), and LOOPBACK_COMMON.
int ast_spawn_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid, int *found, int combined_find_spawn)
Launch a new extension (i.e. new stack)
◆ loopback_exists()
static int loopback_exists |
( |
struct ast_channel * |
chan, |
|
|
const char * |
context, |
|
|
const char * |
exten, |
|
|
int |
priority, |
|
|
const char * |
callerid, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 130 of file pbx_loopback.c.
References ast_exists_extension(), ast_extension_match(), and LOOPBACK_COMMON.
static char exten[AST_MAX_EXTENSION]
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
int ast_extension_match(const char *pattern, const char *extension)
Determine if a given extension matches a given pattern (in NXX format)
◆ loopback_matchmore()
static int loopback_matchmore |
( |
struct ast_channel * |
chan, |
|
|
const char * |
context, |
|
|
const char * |
exten, |
|
|
int |
priority, |
|
|
const char * |
callerid, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 158 of file pbx_loopback.c.
References ast_extension_match(), ast_matchmore_extension(), and LOOPBACK_COMMON.
int ast_matchmore_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Looks to see if adding anything to this extension might match something. (exists ^ canmatch) ...
static char exten[AST_MAX_EXTENSION]
int ast_extension_match(const char *pattern, const char *extension)
Determine if a given extension matches a given pattern (in NXX format)
◆ loopback_parse()
static void loopback_parse |
( |
char ** |
newexten, |
|
|
char ** |
newcontext, |
|
|
int * |
priority, |
|
|
char ** |
newpattern, |
|
|
char * |
buf |
|
) |
| |
|
static |
Definition at line 109 of file pbx_loopback.c.
References ast_strlen_zero, and buf.
113 *newpattern = strchr(
buf,
'/');
115 *(*newpattern)++ =
'\0';
116 con = strchr(
buf,
'@');
119 pri = strchr(con,
':');
121 pri = strchr(
buf,
':');
#define ast_strlen_zero(foo)
◆ loopback_subst()
static char* loopback_subst |
( |
char * |
buf, |
|
|
int |
buflen, |
|
|
const char * |
exten, |
|
|
const char * |
context, |
|
|
int |
priority, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 84 of file pbx_loopback.c.
References AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_INSERT_HEAD, AST_LIST_REMOVE_HEAD, ast_var_assign, ast_var_delete(), buf, pbx_substitute_variables_varshead(), and tmp().
90 snprintf(tmp,
sizeof(tmp),
"%d",
priority);
static char exten[AST_MAX_EXTENSION]
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
void ast_var_delete(struct ast_var_t *var)
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define ast_var_assign(name, value)
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
static char context[AST_MAX_CONTEXT]
void pbx_substitute_variables_varshead(struct varshead *headp, const char *cp1, char *cp2, int count)
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
Definition at line 178 of file pbx_loopback.c.
References ast_unregister_switch().
void ast_unregister_switch(struct ast_switch *sw)
Unregister an alternative switch.
static struct ast_switch loopback_switch
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Loopback Switch" , .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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static |
◆ ast_module_info
◆ loopback_switch