mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
Version 0.1.7 from FTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -43,7 +43,8 @@ struct ast_context *ast_context_find(char *name);
|
|||||||
/* Create a new thread and start the PBX (or whatever) */
|
/* Create a new thread and start the PBX (or whatever) */
|
||||||
int ast_pbx_start(struct ast_channel *c);
|
int ast_pbx_start(struct ast_channel *c);
|
||||||
|
|
||||||
|
/* Execute the PBX in the current thread */
|
||||||
|
int ast_pbx_run(struct ast_channel *c);
|
||||||
|
|
||||||
/* Add an extension to an extension context, this time with an ast_context * */
|
/* Add an extension to an extension context, this time with an ast_context * */
|
||||||
int ast_add_extension2(struct ast_context *con,
|
int ast_add_extension2(struct ast_context *con,
|
||||||
@@ -74,6 +75,14 @@ int ast_exec_extension(struct ast_channel *c, char *context, char *exten, int pr
|
|||||||
/* Longest extension */
|
/* Longest extension */
|
||||||
int ast_pbx_longest_extension(char *context);
|
int ast_pbx_longest_extension(char *context);
|
||||||
|
|
||||||
|
/* Add an include */
|
||||||
|
int ast_context_add_include(char *context, char *include);
|
||||||
|
int ast_context_add_include2(struct ast_context *con, char *include);
|
||||||
|
|
||||||
|
/* Remove an include */
|
||||||
|
int ast_context_remove_include(char *context, char *include);
|
||||||
|
int ast_context_remove_include2(struct ast_context *con, char *include);
|
||||||
|
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
#if defined(__cplusplus) || defined(c_plusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -37,7 +37,6 @@ int load_module(void)
|
|||||||
struct ast_variable *v;
|
struct ast_variable *v;
|
||||||
char *cxt, *ext, *pri, *appl, *data, *tc;
|
char *cxt, *ext, *pri, *appl, *data, *tc;
|
||||||
struct ast_context *con;
|
struct ast_context *con;
|
||||||
|
|
||||||
|
|
||||||
cfg = ast_load(config);
|
cfg = ast_load(config);
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
@@ -53,24 +52,29 @@ int load_module(void)
|
|||||||
if ((con=ast_context_create(cxt))) {
|
if ((con=ast_context_create(cxt))) {
|
||||||
v = ast_variable_browse(cfg, cxt);
|
v = ast_variable_browse(cfg, cxt);
|
||||||
while(v) {
|
while(v) {
|
||||||
tc = strdup(v->value);
|
if (!strcasecmp(v->name, "exten")) {
|
||||||
ext = strtok(tc, ",");
|
tc = strdup(v->value);
|
||||||
if (!ext)
|
ext = strtok(tc, ",");
|
||||||
ext="";
|
if (!ext)
|
||||||
pri = strtok(NULL, ",");
|
ext="";
|
||||||
if (!pri)
|
pri = strtok(NULL, ",");
|
||||||
pri="";
|
if (!pri)
|
||||||
appl = strtok(NULL, ",");
|
pri="";
|
||||||
if (!appl)
|
appl = strtok(NULL, ",");
|
||||||
appl="";
|
if (!appl)
|
||||||
data = strtok(NULL, ",");
|
appl="";
|
||||||
if (!data)
|
data = strtok(NULL, ",");
|
||||||
data="";
|
if (!data)
|
||||||
if (ast_add_extension2(con, 0, ext, atoi(pri), appl, strdup(data), free)) {
|
data="";
|
||||||
ast_log(LOG_WARNING, "Unable to register extension\n");
|
if (ast_add_extension2(con, 0, ext, atoi(pri), appl, strdup(data), free)) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to register extension\n");
|
||||||
|
}
|
||||||
|
free(tc);
|
||||||
|
} else if(!strcasecmp(v->name, "include")) {
|
||||||
|
if (ast_context_add_include2(con, v->value))
|
||||||
|
ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
|
||||||
}
|
}
|
||||||
v = v->next;
|
v = v->next;
|
||||||
free(tc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cxt = ast_category_browse(cfg, cxt);
|
cxt = ast_category_browse(cfg, cxt);
|
||||||
@@ -89,3 +93,8 @@ char *description(void)
|
|||||||
{
|
{
|
||||||
return dtext;
|
return dtext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *key(void)
|
||||||
|
{
|
||||||
|
return ASTERISK_GPL_KEY;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user