Version 0.1.8 from FTP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2001-04-17 16:49:37 +00:00
parent 28c41d85c6
commit a71a6a44d3
2 changed files with 38 additions and 15 deletions

View File

@@ -23,15 +23,17 @@
static char *dtext = "Text Extension Configuration";
static char *config = "extensions.conf";
static char *registrar = "pbx_config";
static int static_config = 0;
int unload_module(void)
{
ast_context_destroy(NULL, registrar);
return 0;
}
int load_module(void)
static int pbx_load_module(void)
{
struct ast_config *cfg;
struct ast_variable *v;
@@ -49,7 +51,7 @@ int load_module(void)
cxt = ast_category_browse(cfg, cxt);
continue;
}
if ((con=ast_context_create(cxt))) {
if ((con=ast_context_create(cxt, registrar))) {
v = ast_variable_browse(cfg, cxt);
while(v) {
if (!strcasecmp(v->name, "exten")) {
@@ -66,12 +68,12 @@ int load_module(void)
data = strtok(NULL, ",");
if (!data)
data="";
if (ast_add_extension2(con, 0, ext, atoi(pri), appl, strdup(data), free)) {
ast_log(LOG_WARNING, "Unable to register extension\n");
if (ast_add_extension2(con, 0, ext, atoi(pri), appl, strdup(data), free, registrar)) {
ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);
}
free(tc);
} else if(!strcasecmp(v->name, "include")) {
if (ast_context_add_include2(con, v->value))
if (ast_context_add_include2(con, v->value, registrar))
ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
}
v = v->next;
@@ -84,6 +86,18 @@ int load_module(void)
return 0;
}
int load_module(void)
{
return pbx_load_module();
}
int reload(void)
{
ast_context_destroy(NULL, registrar);
load_module();
return 0;
}
int usecount(void)
{
return 0;